var str = 'abc 123 hello xyz'; How to turn the above string to abc123helloxyz? I tried to trim but it left spaces still between characters. I can't use split(' ') too as the space is not one some time.
I'm trying to acheive a kind of JSON serialization using MsgPack in c# I'm using MsggPack CLI you can find on https://github.com/msgpack/msgpack-cli According msgpack.org Documentation, serialize the model {"model":"message"} give in hexa 81 a5 6d 6f 64 65 6c a7 6d 65 73 73 61 67 65 but when trying to do the same in c# (certainly with a naive approach) using MsgPack.Serialization; public class Test { public string model { get; set; } } public class Program { static void Main(string[] args) { Test a = new Test(); a.model = "message"; var requestSerializer = MessagePackSerializer.Get(a.GetType()
TL:DR - Look at edit 2 for a C# equivalent of code http client code, resulting in ~same issue, so Go http.Client is not the real problem, but C# Web API once deployed to Azure... I'm getting very bad performance from a C# Web API once deployed to Azure Web App [2x Standard S3]. At first I was asking re: Go's http.Client timeout, but writing a similar client in C# and NodeJs gave same results. This is my http.Client: func getWebClient() *http.Client { var netTransport = &http.Transport{ Dial: (&net.Dialer{ Timeout: 5 * time.Second, }).Dial, TLSHandshakeTimeout: 10 * time.Second, MaxIdleConnsPer
I am trying to send a byte array of a file content from angular to the rest api. But I am getting Http 403 forbidden. I don't have any security enabled. I am not sure what I am doing wrong. I tried couple of different MIME types. The below is the http post from angular js and the $scope.encoded_file has the file in byte array. $http({ method:'POST', url:'http://localhost:9200/docupload', data:{'content':$scope.encoded_file,'name':'test','type':'pdf'}, headers:{'Content-Type':'application/octet-stream'} }).success(function(){}); }; DocUploadService @RestController public class DocUploadService
I have two tables that have different data that I need to merge. They do have similarities such as: Order number, Name, type or product. But they have separate data as well like: Order date, and Engravings. Would I do two separate Append queries in Access into a merged table? Or one Append queries? Or just keep the data separate? I am new to Access and trying to find the best way to approach this.
In a sci-fi setting, suppose there is a species that has a very strong cybernetic enhancement, to the point where they can actually form a kind of pseudo-hive-mind, while still retaining their individuality and being able to disconnect from such a system at will. (Or form smaller, isolated clusters.) This way, they can access an enormous amount of brainpower and ideas, and they can quickly reach a joint consensus (or at the very least agree that they disagree very quickly), and they can rely on each other's wisdom at any time. Now, this would imply that members of this species are nearly-omnis
I wants to check on my linux system when which command was fired - at which date and time. I fired commands like this: history 50 It shows me the last 50 commands history, but not with date and time at which it was fired. Does any one knows how to do it?
I am currently using SequenceDiagram Plugin from https://plugins.jetbrains.com/plugin/8286?pr= to generate Sequence Diagrams. But here the drawback is that I am not able to save them in a format like .uml or any other format so anyone can open this file and edit it. It only allows to export the sequnce diagram as an image. Is there any way to save the sequence diagrams generated so they can be edited later?
I have deployed and run spring SAML sample successfully. From SAML Response (IdP -> SP) shown below, can it be identified whether: the SAML response is signed or unsigned? the assertion is encrypted or not? (I guess it's encrypted) the assertion is signed or unsigned? <?xml version="1.0" encoding="UTF-8"?> <samlp:Response xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol" Consent="urn:oasis:names:tc:SAML:2.0:consent:unspecified" Destination="https://MY_SP/spring-security-saml2-sample/saml/SSO" ID="_22bf0c00-9cfa-5dbb-7af7-d34eec7d9b6f" InResponseTo="we3977191e5g4try1b3g52j4f84e43f" IssueInstan
I've been investigating and trialling different AA techniques in OpenGL on both desktop and ES profiles ( es 2.0 & above ) for rendering 2D content to offscreen FBOs. So far I've tried FSAA, FXAA, MSAA, and using the GL_LINE_SMOOTH feature. I've not been able to find an adequate AA solution for ES profiles, where I've been limited to FSAA and FXAA because of API limitations. For example glTexImage2DMultisample ( required for MSAA ) and GL_LINE_SMOOTH functionality are unavailable. FXAA is clever but blurs text glyphs to the point it's doing more harm than good, its only really suited to 3D sce
Python 2.7.6 (default, Jun 22 2015, 17:58:13) [GCC 4.8.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from weasyprint import HTML >>> HTML('http://weasyprint.org/').write_pdf('/tmp/weasyprint-website.pdf') Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/local/lib/python2.7/dist-packages/weasyprint/__init__.py", line 94, in __init__ namespaceHTMLElements=False) TypeError: parse() got an unexpected keyword argument 'override_encoding' >>> I believe I have installed all the dependencies. What is going on here?
I want to convert all the .doc files from a particular folder to .docx file. I tried using the following code, import subprocess import os for filename in os.listdir(os.getcwd()): if filename.endswith('.doc'): print filename subprocess.call(['soffice', '--headless', '--convert-to', 'docx', filename]) But it gives me an error: OSError: [Errno 2] No such file or directory
What am I doing wrong?? It's not running my build.xml file. Also, how would I be able to express the existing Ant logic in Gradle? Ex: Changing a build.xml to build.gradle and be able to have the same out put when compiled. --Stacktrace
I'm trying to use opencv to implement a feature in my app. Basically, my app allows users to authenticate by using their face. Live video will be captured and frames are extracted. Using these extracted images, the model is learned. Next time when a user logs in, frames are sent to the model for deciding if this is the authenticated user. I found this example from opencv site which uses FaceRecognizer. However, they use an existing dataset with 10 classes (10 persons). In my case, only one class is considered (Or we can consider two classes including the authenticated user and unknown users).
Thinking of terraforming a localized region, how (if possible) can we create an artificial high pressure zone, whether practical or not, Initially I thought, perhaps we can arrange heatsinks to induce a pressure trap heated with laser arrays closer to the Sun. Perhaps a tunable cyclonic system or harmonic heat waves along the equator creating an interference pattern focused toward one region. I am unsure about the merits and feasibility of different methods. This is for a video game, so does not need to be scientifically plausible given our technology and resources, though of course it is enco
I am trying to design an api for user login and logout. But I am facing an error of AttributeError: 'ReturnDict' object has no attribute 'pk'. What might be creating this error? traceback in detail File "/home/tushant/Projects/nepMart/account/api/views.py", line 61, in post login(request, serializer.data) File "/home/tushant/.virtualenvs/NepMart/lib/python3.5/site-packages/django/contrib/auth/__init__.py", line 102, in login if _get_user_session_key(request) != user.pk or ( AttributeError: 'ReturnDict' object has no attribute 'pk' Serializers.py class UserLoginSerializer(ModelSerializer): toke
I have booked separate Rajdhani Express Rail tickets for Jammu-Delhi and Delhi-Kolkata. I'll reach Delhi from Jammu on 6am of 23th August. My next train for Kolkata will start on 4:30pm. I have a span of around ten hours (assume Trains are on time!) layover at Delhi. Is this sufficient to travel Agra interim? (Just a quick sight seeing at Taj Mahal!)
I am trying to style all the inputs in my website in a way that when they have a value or have focus the palceholder becomes the title of the input (it moves to the top of the input) but the default behavior of the browser hides the placeholder when there is data on it. I really want to stay away from JS solutions. Current results : My css : input:focus::-webkit-input-placeholder { transform: translate(-1rem,calc(-100% - 0.8rem)); font-size: 0.9rem !important; opacity: 1 !important; //this doesnt seem to keep the placeholder visible display:block !important; //this doesnt seem to keep the plac
I am unit testing a component that is used to edit an object. The object has an unique id that is used in order to grab the specific object from an array of objects that are hosted in a service. The specific idis procured through a parameter that is passed via routing, specifically through the ActivatedRoute class. The constructor is as follows: constructor(private _router:Router, private _curRoute:ActivatedRoute, private _session:Session) {} ngOnInit() { this._curRoute.params.subscribe(params => { this.userId = params['id']; this.userObj = this._session.allUsers.filter(user => user.id.toStrin
I'm trying to solve this scenario with Getopt::Long. ./myscript -m /abc -m /bcd -t nfs -m /ecd -t nfs ... -m is mount point and -t is type of file system (can be placed, but it is not mandatory). Getopt::Long::Configure("bundling"); GetOptions('m:s@' => \$mount, 'mountpoint:s@' => \$mount, 't:s@' => \$fstype, 'fstype:s@' => \$fstype) This is not right. I'm not able pair proper mount and fstype: ./check_mount.pl -m /abc -m /bcd -t nfs -m /ecd -t nfs $VAR1 = [ '/abc', '/bcd', '/ecd' ]; $VAR1 = [ 'nfs', 'nfs' ]; I need to fill unspecified fstype, e.g., with "undef" value. The best solution for me
Whenever a build gets stuck of fails somewhere the timeout kicks in but the build is not aborted and it is stuck running forever until you cancel the build, go into console and press the link Click here to forcibly terminate running steps Here is a sample code that I'm trying but not working: stage concurrency: 1, name: 'Build' def buildSteps = [:] buildSteps['Server'] = { timeout(1) { node('build') { timestamps { bat "waitfor nothing /t 120 >nul" } } } } parallel buildSteps This is the log [Pipeline] stage (Build) Entering stage Build Proceeding [Pipeline] parallel [Pipeline] [Server] { (Bran
I used PIL to open and save the same jpg image, but the size reduces significantly. Could somebody explained what's going on under the hood? I run a = Image.open('a.jpg') a.save('b.jpg') a.jpg has the size 5MB, whereas b.jpg is only 600KB. and I enlarge them and compared side by side and basically see no differences in the picture quality. Could somebody explain this? Much appreciated!
I'd like to be able to change the dropdownlist background colors on my C# web app, can I do this with CSS instead of having to name each dropdown separately? In other words, I want to avoid having to do this: private void Form_Load(object sender, EventArgs e) { comboBox1.BackColor = Color.Aqua; comboBox2.BackColor = Color.Aqua; comboBox3.BackColor = Color.Aqua; etc . . . }
I tried using Pointer lock controls for normal First Person keyboard setup, now i wanted to know if i can include touch settings in pointer lock controls file for moving forward on touch and to look around using swipe. Is it possible to do this using pointer lock controls ?
I am trying to implement role permissions based system using spring boot and spring security. For this, I have taken an example from http://www.baeldung.com/role-and-privilege-for-spring-security-registration , but failed to do that. Efforts SpringSecurity Configuration package com.insight; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.security.authentication.dao.DaoAuthenticationProvider; import org.springframework.security.config.annotat
I'm trying to move a line of text back and forth inside a colored background box. I can do this beautifully with the marquee tag, but as I heard its usage is not recommended so I decided to use CSS instead. Although I copied the form of the animation function from CSS tutorials but I can't figure out why the line doesn't move. Could you show me what's wrong with my code? My HTML code: <!DOCTYPE html> <html> <head> <meta http-equiv="content-type" content="text/html" charset="UTF-8"> <title>Part 1</title> <link rel="stylesheet" content="text/css" href="part1-2.css"> </head> <body> <div class="ba
I have a server broadcasting the video generated by a USB webcam using GStream with the following gst-launch command: gst-launch-1.0 v4l2src ! video/x-raw,width=352,height=288 ! jpegenc! rtpjpegpay ! udpsink host=239.255.12.52 port=5004 Now i need a client to play that broadcast with VLC. I tried playing the following: rtsp://239.255.12.52:5004 But I only get the following error: SDP required: A description in SDP format is required to receive the RTP stream. Note that rtp:// URIs cannot work with dynamic RTP payload format (96). Then i searched trying to find a sdp file that could help me pla
I need to count the number of elements which in this case the number of products held by each customer. My attempt for solving this is by counting the number of "li" tag, then accessing "ticket-type". Any suggestion on how this can be achieved?: List<WebElement> labels = driver.findElements(By.xpath("//label[@class='ticket-type']")); int ProdNum = labels.size(); String strI1 = Integer.toString(ProdNum); System.out.print("Number of products on this card:" + strI1); // getting the name of the last product String LastProd = labels.get(labels.size() - 1).getText(); System.out.print("The last order