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)
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
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
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'});
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
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>
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
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"
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
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?
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.
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);
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.
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
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.
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.
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_
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
I see that this is not a specific progamming question, however I have asked it in a binary way so perhaps this will pass scrutiny. I've been using Quoda on my Android phone and have started needing to edit .ts / Typescript files, which it does not support. At the moment I am using SGit which just opens whatever Android app to edit a file type based on the extension. Quoda (and general text editors) can open a .ts if opened within the app, however do not have syntax highlighting. So I have searched high and low, the only .ts editor I have found is CodeAnywhere, which is really great in a deskto
my below ansible (2.1.1.0) playbook is throwing "skipping: no hosts matched" error when playing for host [ec2-test]. The ansible hosts file has the fqdn of the newly created instance added. It runs fine if if i re run my playbook second time. but 1st time running throws no hosts matched error :( my playbook: --- - name: Provision an EC2 instance hosts: localhost connection: local gather_facts: no become: False vars_files: - awsdetails.yml tasks: - name: Launch the new EC2 Instance ec2: aws_access_key: "{{ aws_id }}" aws_secret_key: "{{ aws_key }}" group_id: "{{ security_group_id }}" instance_t
I was experimenting on creating new apps with frappe. At some stage after creating the site, I had to switch the default site using bench use library. Now I want to switch back to erpnext (the default app). But it's not working when I run: bench use erpnext or bench use erp-next or bench use erp_next. What's the site name to the default erpnext site. Or is there some other way to achieve this?
When I run the ionic build android command, I get the following error: WARN: ionic.project has been renamed to ionic.config.json, please rename it. Uh oh! Looks like you're missing a module in your gulpfile: Cannot find module 'gulp' Do you need to run `npm install`? I have already tried running this command: npm install --save-dev gulp But I am still getting the same error. Am I missing something here?
Is there a construct in Apache Camel (in Java DSL) similar to Java switch-case? For example: from( incomingRoute ) .choice() .when( simple( "${body.getType} == '" + TYPE.A.name() + "'" ) ) .to( A_Endpoint ) .when( simple( "${body.getType} == '" + TYPE.B.name() + "'" ) ) .to( B_Endpoint ) .when( simple( "${body.getType} == '" + TYPE.C.name() + "'" ) ) .to( C_Endpoint ) .otherwise() .to( errorEndpoint ); Can be translated into something else more similar to switch? I mean that I do not want to use simple predicates, only value of type of body element. Or is my approach completely wrong? (That co
Hello I am having trouble combining both css transition and animations together. The animation is working but some reason when I add a transition, the transition works, but cancels out the animation. Anyone know how to combine them? Here is my CSS: .circle-spin { transition: all 1s ease; } .circle-spin-reverse { transition: all 1s ease; } .success li:hover .circle-spin-reverse { animation:spin-reverse 10s linear infinite; /* the above works until i add the transition below */ transform:scale(1.25); } .success li:hover .circle-spin { animation:spin 10s linear infinite; /* the above works until
How can I extract the description of a package from the package's DESCRIPTION file? I'm interested in getting the text from the Description: field and being able to use it in renderText() for a Shiny app. renderText() just requires a string, so getting it in a string format is my goal (unless someone knows another way to do it). The reason I'm not just copy-pasting is because I want to update the description in one single place (the DESCRIPTION file) and not have to remember to update the description in multiple locations with every new version.
How can I extract the description of a package from the package's DESCRIPTION file? I'm interested in getting the text from the Description: field and being able to use it in renderText() for a Shiny app. renderText() just requires a string, so getting it in a string format is my goal (unless someone knows another way to do it). The reason I'm not just copy-pasting is because I want to update the description in one single place (the DESCRIPTION file) and not have to remember to update the description in multiple locations with every new version.
Why are RandomInt1 and RandomInt2 always the same number each time I run my code? Dim RandomGen1 As New Random Dim RandomInt1 As Integer RandomInt1 = RandomGen1.Next(2, 7) Dim RandomGen2 As New Random Dim RandomInt2 As Integer RandomInt2 = RandomGen2.Next(2, 7)
I'm trying to use the play_hosts variable in an ansible template. I'm trying to setup a master / slave domain setup for wildfly. So I wish to loop over all hosts in the inventory group, without having to specify a group. This is what I'm trying: {%- for host in play_hosts %} {%- if 'master' in hostvars[host][ansible_hostname + '_alias'] %} <remote protocol="remote" host="{{ hostvars[host]['ansible_default_ipv4']['address'] }}" port="9999" /> {%- endif %} {%- endfor %} I get the below error: failed: [atllvjksap012d.hughestelematics.net] (item=host) => {"failed": true, "item": "host", "msg": "An
I would like the URL: http://example.net/category/subcategory/title To point to: http://example.net/posts/category/subcategory/title.php My .htaccess file looks like this: RewriteEngine on RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{QUERY_STRING} !^.+ #RewriteCond post/%{REQUEST_URI}.php -f RewriteRule ^(.*)$ post/$1.php [L] This works. However, when I uncomment the line with "post/" and "REQUEST_URI" above, it does not work. I have tried: RewriteCond /post/%{REQUEST_URI}.php -f RewriteCond post/%{REQUEST_URI}.php -f RewriteCond post%{REQUEST_URI}.php -f None of these work.