on-internet

Sandbox permission errors in Chrome console but I'm not using any iframes

I keep getting these errors even when the html of my page contains no frames: Blocked script execution in '[url]' because the document's frame is sandboxed and the 'allow-scripts' permission is not set. Blocked form submission to '[url]' because the form's frame is sandboxed and the 'allow-forms' permission is not set. Googling these errors return results mostly for people who are using frames. Simple form and the submit is not js-driven but a regular html submit button... I am lost. Anyone out there getting these for non-frame pages?

Join the discussion →

How to receive image file to API server (Node.js)

I want to build API server by node.js, and I want to post image file to my API server. I was able to write GET method logic in my code but, I have no idea write POST method logic. Please help me. ↓My code (node.js) // preprocessing // import library var express = require('express'); var app = express(); var bodyParser = require('body-parser'); var fs = require('fs'); // post setting app.use(bodyParser.urlencoded({ extended: true })); app.use(bodyParser.json()); // port setting var port = process.env.PORT || 3000; // express setting var router = express.Router(); router.use(function(req, res, n

Join the discussion →

Oracle Universal Connection Pool Error UCP-45060 Invalid life cycle state

I am using Oracle UCP (Universal Connection Pool). I am getting the following error after processing around 100K records. oracle.ucp.UniversalConnectionPoolException: Invalid life cycle state. Check the status of the Universal Connection Pool at oracle.ucp.util.UCPErrorHandler.newSQLException(UCPErrorHandler.java:488) ~[ucp-11.2.0.3.0.jar:11.2.0.3.0] at oracle.ucp.util.UCPErrorHandler.throwSQLException(UCPErrorHandler.java:163) ~[ucp-11.2.0.3.0.jar:11.2.0.3.0] at oracle.ucp.jdbc.PoolDataSourceImpl.getConnection(PoolDataSourceImpl.java:943) ~[ucp-11.2.0.3.0.jar:11.2.0.3.0] at oracle.ucp.jdbc.Po

Join the discussion →

Tabs background and font color change when click

I have a tabbed pane in my HTML page. The following changes has to done in the task. When select a tab or hover, background - white, text color - #6baed9, border - 1px same color as text. When tab is unselected (if selected the another tab this become unselected one) - background - #6baed9, text color - white, border - 1px same color as text. My CSS are as following, #my_settings ul.tab li a { display: inline-block; text-align: center; padding: 8px 12px; text-decoration: none; transition: 0.3s; font-size: 17px; height:35px; width:250px; color: #6baed9; } #my_settings ul.tab li a:hover { backgr

Join the discussion →

Does Javascript filter preserve order?

I looked at the documentation and while looking at examples it looks like filter preserves order of the original list (though it returns a new one). Can I rely on that? Ecmascript spec MDN Neither of these reference preserving order. Should I just assume I can't rely on preserved order?

Join the discussion →

How do I correctly use PCA followed by logistic regression?

In the program, I am scanning a number of brain samples taken in a time series of 40 x 64 x 64 images every 2.5 seconds. The number of 'voxels' (3D pixels) in each image is thus approximately 168,000 ish (40 * 64 * 64), each of which is a 'feature' for an image sample. I thought of using principal component analysis (PCA) because of the ridiculously high n to perform dimensionality reduction. I am aware PCA does not actually reduce the number of features. Correct me if I'm wrong, but PCA will produce a new set of features from the original ones. The new features however must follow certain con

Join the discussion →

Producing and consuming JSON in KAFKA

We are going to deploy Apache Kafka 2.10 on our project and communicate via JSON objects between producer and consumer. So far I suppose I need to: Implement a custom serializer to convert JSON into byte array implement a custom deserializer to convert byte array into JSON object Produce the message Read the message in Consumer class Regarding first point, I believe it should be something like this: @Override public byte[] serialize(String topic, T data) { if (data == null) return null; try { ObjectMapper mapper = new ObjectMapper(); return mapper.writeValueAsBytes(data); } catch (Exception e)

Join the discussion →

Why is address 0x400000 chosen as a start of text segment in x86_64 ABI?

In the AMD64 SysV ABI document on p. 33 it says the text segment typically starts at 0x400000, documenting default ld behaviour. Why was this particular address chosen? Is there any reason for that? We can confirm that this is GNU ld's default on Linux: $ ld -verbose | grep -i text-segment PROVIDE (__executable_start = SEGMENT_START("text-segment", 0x400000)); . = SEGMENT_START("text-segment", 0x400000) + SIZEOF_HEADERS; It's surprising because this address is bigger in 32-bit x86 executables: $ ld -verbose | grep -i text-segment PROVIDE (__executable_start = SEGMENT_START("text-segment", 0x08

Join the discussion →

How to add a test run to ALM using REST API

I searched high and low trying to figure out how to create a test run using the REST API for ALM. If anyone has found a better way then I would love to see it! Just figured this out last night. I used the tool called Postman to figure this out. This is how to get your testcycl-id via the REST API. First go to the Test Lab page and create a test set and then add a test case (or multiple test cases) to it. In the execution grid you can add the columns for "Test ID" and "ID". Test ID = test-id ID = test-config-id Next to the Execution Grid there is another button called, "Details". If you click t

Join the discussion →

kafka consumer AbstractCoordinator: Discovered coordinator Java client

I have 3 brokers running with broker id s 0 1 and 2. The Consumer (Java Client) picks up broker 0 as group coordinator and starts to consume messages correctly. But when the broker 0 which is the group coordinator is down, the consumer does not do anything and stalls on the poll() method. The process resumes only when that broker 0 is up and running. How to handle this scenario of group co-ordinator change in the Java client? I get this error when group coordinator dies: 16/09/22 17:42:45 INFO internals.AbstractCoordinator: Discovered coordinator datascience1.sv2.trulia.com:9092 (id: 214748364

Join the discussion →

Implement the removeProperty function that takes an object and a property name

Implement the removeProperty function that takes an object and a property name and does the following: If object obj has property prop, it removes the property from the object. If the property has been removed, it returns true; otherwise it returns false. What is wrong with this code? function removeProperty(obj,prop) { if(obj.hasOwnProperty('prop')) { console.log(obj); delete obj.prop; return true; } else { return false; } } var obj= { name:"John" }; removeProperty({obj,'name'});

Join the discussion →

unable to start nodejs app- Error: npm.load() required

whenever I am starting my Node app it's giving following error. Error: Failed to replace env in config: ${NPM_TOKEN} at /usr/local/lib/node_modules/npm/lib/config/core.js:429:13 at String.replace (native) at envReplace (/usr/local/lib/node_modules/npm/lib/config/core.js:424:12) at parseField (/usr/local/lib/node_modules/npm/lib/config/core.js:400:7) at /usr/local/lib/node_modules/npm/lib/config/core.js:338:17 at Array.forEach (native) at Conf.add (/usr/local/lib/node_modules/npm/lib/config/core.js:337:23) at ConfigChain.addString (/usr/local/lib/node_modules/npm/node_modules/config-chain/index

Join the discussion →

how to make radio button checked on condition based?

I want to make radio button checked on condition based. Like when index=>4, button 4 should be checked. My HTML code is like that: <input id="rating5" type="radio" name="rating" value="5"> <label for="rating5">5</label> <input id="rating4" type="radio" name="rating" value="4"> <label for="rating4">4</label> <input id="rating3" type="radio" name="rating" value="3"> <label for="rating3">3</label> <input id="rating2" type="radio" name="rating" value="2" > <label for="rating2">2</label> <input id="rating1" type="radio" name="rating" value="1"> <label for="rating1">1</label>

Join the discussion →

Conda environments not showing up in Jupyter Notebook

I installed Anaconda (with Python 2.7), and installed Tensorflow in an environment called tensorflow. I can import Tensorflow successfully in that environment. The problem is that Jupyter Notebook does not recognize the new environment I just created. No matter I start Jupyter Notebook from the GUI Navigator or from the command line within the tensorflow env, there is only one kernel in the menu called Python [Root], and Tensorflow cannot be imported. Of course, I clicked on that option multiple times, saved file, re-opened, but these did not help. Strangely, I can see the two environments whe

Join the discussion →

Can't get program to print "not in sentence" when word not in sentence

I have a program that asks for input of a sentence, then asks for a word, and tells you the position of that word: sentence = input("enter sentence: ").lower() askedword = input("enter word to locate position: ").lower() words = sentence.split(" ") for i, word in enumerate(words): if askedword == word : print(i+1) #elif keyword != words : #print ("this not") However I cannot get the program to work correctly when I edit it to say that if the input word is not in the sentence, then print "this isn't in the sentence"

Join the discussion →

Another CacheManager with same name 'cacheManager' already exists in the same VM

I receive this error when starting tomcat with ehcache and Spring. Another CacheManager with same name 'cacheManager' already exists in the same VM. Please provide unique names for each CacheManager in the config or do one of following: 1. Use one of the CacheManager.create() static factory methods to reuse same CacheManager with same name or create one if necessary 2. Shutdown the earlier cacheManager before creating new one with same name. Spring 3.1 ehcache 2.9.0 No test context using this. This is a web JSF app. ehcache.xml <ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi

Join the discussion →

How to print the utf-16 characters in c

int main() { char c = 0x41; printf("char is : %c\n",c); c = 0xe9; printf("char is : %c\n",c); unsigned int d = 0x164e; printf("char is : %c\n",d); return 0; } What I want to print out are: I use Ubuntu 64-bit VMware Workstation on windows and use Octal dump: The hexadecimal value of the three chars from an utf-16 LE txt file. The output: How to print out utf-16 characters correctly?

Join the discussion →

Converting DD-MON-YY to YYYY-MM-DD in informatica

I have a date column in a flat file with a format of DD-Mon-YY which needs to be converted to YYYY-MM-DD. This is the expression which I have used in the expression transformation IIF(IS_DATE(Event_Date,'DD-MON-YY'),TO_DATE(Event_Date,'YYYY-MM-DD'),NULL) There's an error saying invalid string format due to the reason that there's no century (26-Sep-16) information in the input date. Help would be appreciated. Thanks.

Join the discussion →

Getting link from pastebin and downloading from link

I'm trying to get a link from a pastebin. Where the link is the only text in the raw paste. Then I want to download a file from the link in pastebin. WebRequest request = WebRequest.Create("http://pastebin.com/raw/Dtdf2qMp"); WebResponse response = request.GetResponse(); System.IO.StreamReader reader = new System.IO.StreamReader(response.GetResponseStream()); Console.WriteLine(reader.ReadToEnd()); WebClient client = new WebClient(); client.DownloadFile (Link gotten from pastebin here, "c:\\File"); System.Threading.Thread.Sleep(5000);

Join the discussion →

Getting the test that is executing in `setUp` [duplicate]

Is there a way to get the test that is about to be executed (the actual Function name) inside setUp() in PHPUnit? I know that I can put the code inside the test function itself instead of setUp(), but I have created some Abstract Test Cases and since setUp() takes a long time to execute, I want to be able skip unnecessary actions or even tests inside setUp().

Join the discussion →

How do I create a custom header in Magento 2 using HTML and CSS

I want to make a custom header for my theme in Magento 2. I managed to create a working module which just outputs "Hello World" right now and gets displayed in the header section of my shop. Now, how do I remove the old header panel and tell my new one how to look like? I got really confused how Magento uses CSS and LESS or HTML. Can I use HTML code at all? I have a normal HTML website with a link to my Magento shop. I want a smooth transition which means I want my header in Magento look exactly like the one on my "normal" website. How do I achieve that? I have no idea where to start.

Join the discussion →

Using viewport width=device-width, initial-scale=1, maximum-scale=1 doesnt fit my page to my phone screen

I have this but when I open the webpage on my phone it is wider than the screen. <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" /> so I have to pinch in to make it fit. Might this be caused by the fact that there are some images used as the background of the html page? For instance, further below I have the following: <img src="index_files/img2.png" width="970"> I don't know much about HTML so I will not be able to understand complex answers. I also saw some div elements with absolute dimensions like this: <div class="container"> <div class="row"> <div cla

Join the discussion →

Read data from Excel file using Apex in Salesforce

I have a requirement where we need to parse the excel file and insert the data in one of the object using apex. This excel file contains multiple sheets. We need to read the data from multiple sheets (as of now one sheet is also fine) and upload the data. Please help me with a solution.

Join the discussion →

Installing eclipse neon on windows 10

I've been trying to install eclipse neon on my pc which has windows 10 64 bit. I downloaded the exe file from the official page (https://www.eclipse.org/downloads/download.php?file=/oomph/epp/neon/R/eclipse-inst-win64.exe) but it won't run and I don't know why. I have java and jdk up to date but still can't make it run.

Join the discussion →

Oracle Apex 5 interactive report blob image display

I am having an Apex application already available in Oracle APEX 4 which is working fine. Now I am trying to migrate the same apex application to APEX 5. After migrating, some of the functionalities working fine in Apex 4 are not working in Apex 5, like: Displaying Blob images from a DB Table as Icon in a interactive report in Apex 5. I am using the below query to display images in the interactive report: select apex_util.get_blob_file_src('P16_IMAGE', image_id) as icon_image from image_table Inside my application under the list view I am getting a URL generated by the apex_util.get_blob_file_

Join the discussion →

How to click on button when input type =Button in Selenium Web driver by using Java

How to click on button when input type is button , I am using below code, click on button is working but data is not saved. driver.findElement(By.cssSelector("input[type='button'][value='Save']")).click(); driver.findElement(By.cssSelector("input[@type='button'][@value='Save']")).click(); driver.findElement(By.cssSelector("input[@type='button']")).click(); And below is the development code for your reference: <input id="save_btn_expe" class="edit_forms_save_btn" type="button" value="Save">

Join the discussion →

Improve performance of a query with LEFT JOIN, 2 LIKE expressions,GROUP BY, and LIMIT

I am using codeigniter for an application where search needs to be performed i am using "Like" in the query for two tables. One table has data while other table has translations of it. So i need to search the string from both tables to get the result. Following is my query can any body make it more efficient. both tables has almost 10k records which may increase in future. If i am not joining the table then it works faster but with joining it takes long to give the results. $this->db->select('tbl2.translation_title as title,tbl1.id,tbl1.title as title'); $this->db->like('tbl1.title', $searchSt

Join the discussion →

Basic example of selectable list from Material-UI

I'm trying to use a selectable list of items in my Drawer Component. I'm using the sample code defined in the Material-UI List Documentation, but things are not working as expected. Where can I find basic sample code using a selectable list, good documentation, or a tutorial? import React from 'react'; import Component from 'react'; import PropTypes from 'react'; import MobileTearSheet from '../../../MobileTearSheet'; import {List, ListItem, MakeSelectable} from 'material-ui/List'; import Avatar from 'material-ui/Avatar'; import Subheader from 'material-ui/Subheader'; let SelectableList = Make

Join the discussion →
Older stories