I am looking for a way to extract text that is before and after a certain character in Teradata. For example, I have a column that is consistent except for the word in the middle - which I want to extract. I have these two examples: "Customer Activated Account DD: ABCD, ON DATE XXXX" "Customer Activated Account DD: EFGH, ON DATE XXXX" I need the text that exists right after ":" and before "," - in this case ABCD or EFGH. So far I have SUBSTRING (column FROM POSITION ('DD: ' IN column) +4) but that returns everything after the ":" like ABCD, ON DATE XXXX.
I have a string coming from an AJAX call. To inspect the actual string that gets sent to my PHP from some JavaScript I put it into the result and spit it out in the front end. The string looks like this: count: "[{\"cartKey\":\"d9d4f495e875a2e075a1a4a6e1b9770f\",\"qty\":\"3\"}, {\"cartKey\":\"67c6a1e7ce56d3d6fa748ab6d9af3fd7\",\"qty\":\"2\"}, {\"cartKey\":\"f7177163c833dff4b38fc8d2872f1ec6\",\"qty\":\"32\"}]" My problem is getting this to be an actual PHP array. If I do this: $result['count'] = json_decode($updates, true); inside my PHP, the result is 0. Ignore the count name on the result. I'
I'm trying to plot a dataframe and I want the x-axis labels to not override each other like here When dealing with one plot, adding .set_xticklabels(rotation=30) does solve the issue: sns.catplot("foo", data=boo, aspect=5, kind="count" ).set_xticklabels(rotation=30) but when I add the ax argument as here: sns.catplot("foo", data=boo, aspect=5, kind="count" , ax=fig.add_subplot(211) ), it doesn't (see the first snapshot). I tried sns.catplot("foo", data=boo, aspect=5, kind="count", ax=ax1).set_xticklabels(rotation=30) I'm looking for some kind of excel's "wrap text". I tried looking in seaborn
my requirement is really simple, I just want to check that if the getopts argument is empty or not. I am kicking my script using the jenkins and need to check that if the provided value is empty then set the default otherwise use the provided value: and passing the arguments to the shell script like this: ./rds-db-dump.sh -s ${source_instance_id} -c ${target_instance_class} -i ${source_snapshot_id} snippet from shell script: while getopts ":s:c:i:h" opt; do case ${opt} in s) SOURCE_INSTANCE_ID="${OPTARG}" ;; c) TARGET_INSTANCE_CLASS="${OPTARG}" ;; i) SOURCE_SNAPSHOT_ID="${OPTARG}" ;; h) usage
I found that writing a function which is a wrapper around another one can lead to "redundant" keyword arguments. For example look at this few lines: def check_then_execute(foo=1, bar="A"): foo = safe(foo) # will return foo in a safe form bar = safe(bar) execute(foo=foo, bar=bar) # doesn't it feel redundant? In this example execute() is a library function that has keyword arguments. Possibly more than two. Is there a way to pass keyword arguments using the name of the variable as the keyword?
How to disable all animations, transitions in VSCode? For example either through CSS or "\resources\app\out\vs\workbench\electron-browser\bootstrap\index.html"
I am trying to keep the input field placeholder and it works when in focus, but when the input contains a value the placeholder disappears. Any idea how to make this? Fiddle : <input type="text" placeholder="Input some text"> Style sheet input:focus::-webkit-input-placeholder{ color: #202020; font-size: 10px; -webkit-transform: translateY(-15px); transform: translateY(-15px); visibility: visible !important; opacity: 1 padding:3px; } input{ height: 45px; border: 1px solid #1b1a1a; width: 350px; padding: 10px; }
I've been having problem just figuring out this simple code. module diode (switch, led); output led; input switch; reg led; always @* begin led = 1'b0; end endmodule The logic behind it is as follow = press the button, the LED turns on? The problem I am facing is this always block. The way it's supposed to work is that whenever there's a change in switch (the button that I press), the LED should turn on? But the LED turns on automatically all the time entering this always block even if I don't press anything. The only way to 'solve' this is if I put an if/else statement in always block so that
Scenario: Need to select multiple date in the date picker in angular material. currently this scenario is not there in the official documentation in DatePicker Examples Question : How can I implement the multiple date select with the material design? I though of modifying the existing implementation of angular material, but have no idea where to start. Any leads would be very helpful.
Just started using Firestore and Flutter and trying to get my document items from Firestore into a ListView and running into errors. Here is my data structure: and here is my code for the page so far. import 'package:flutter/material.dart'; import 'package:async/async.dart'; import 'package:cloud_firestore/cloud_firestore.dart'; import 'package:flutter_firestore_test/ui/restaurantDetail.dart'; class RestaurantList extends StatefulWidget { final String title; final String director; RestaurantList({Key key, this.title, this.director}) : super(key: key); @override _RestaurantListState createState
I have a 100-bit signal in Verilog: array <= 100'b1000000000000000001111111100000000000000111111100001000000000000000001111110000000000000000001110000; I want to iterate each bit one by one and display each bit individually in the console using a loop or any other logic. Is it possible to do so?
I am trying to update Count=Count+1 if src_ip already exists, else insert into table. I was able to do it with UPSERT successfully: INSERT INTO result('min(_time)', src_ip) VALUES(?,?)ON CONFLICT(src_ip) DO UPDATE SET Count=Count+1; I am looking for another way to do this without using UPSERT. I tried this : # Import csv to SQLite with open('result5.csv', 'r') as f: dr = csv.DictReader(f) for i in dr: c.execute("UPDATE result SET Count = Count + 1 WHERE src_ip = ?", (i['src_ip'],)) if c.rowcount == 0: c.execute("INSERT INTO result ('min(_time)', src_ip, Count) VALUES (?,?,1)", (i['min(_time)']
I'm planing a trip to India for the end of this year, and I want to know if Agra main attractions are closed on the 31st of December (like the Taj Mahal and Agra fort). I didn't find anything in the internet with respect to this. I only see that the Taj is closed on all Fridays.
I am using Eclipse Version: 2018-09 (4.9.0) and I have installed the Spring Tool Suit(STS) in eclipse for building Spring Boot Applications. Question-> Whenever I create a new Spring Starter Project and try to maven build my project without any code addition, the build fails with the below error: [WARNING] The requested profile "pom.xml" could not be activated because it does not exist. [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.1:test (default-test) on project DemoSpringProject: There are test failures. [ERROR] [ERROR] Please refer to C:\Users\SP064774\
I am trying to read a delimited text file with the .csv extension, but it says that it is UTF-16 Unicode text.txt file: df <- read.delim("/Users/admin/Downloads/data1.csv", sep = ",") # Error in make.names(col.names, unique = TRUE) : # invalid multibyte string at '<ff><fe> # # <0a> # # <ff><fe>' warnings() # Warning messages: # 1: In grep("^[^#].*", lines, value = TRUE) : # input string 1 is invalid in this locale # 2: In read.table(path, encoding = encoding, header = header, ... : # line 1 appears to contain embedded nulls How can I avoid this error and correctly read my CSV file?
After the server has been rebooted, my iis hosted website on login fails. I have started seeing the error "A fatal error occurred while creating a TLS client credential. The internal error state is 10013." in the System Logs. Please let me know if something can be done to fix this issue. Thanks Click here to view the error message image
I am trying to find a way/helper to convert.Net Class to Avro.Generic.GenericRecord . Currently, I am manually adding field-name and field-value to Generic record. Is there a serializer/converter which I can use to convert the object to generic record and publish on to a kafka topic. class Plant { public long Id { get; set; } public string Name { get; set; } public List<PlantProperties> PlantProperties{ get; set; } } class PlantProperties { public long Leaves{ get; set; } public string Color{ get; set; } } Please suggest.
Hello I´m trying to run a python manage.py runserver command but getting this error message File "C:\Users\adrie\Anaconda3\lib\sre_compile.py", line 17, in assert _sre.MAGIC == MAGIC, "SRE module mismatch" AssertionError: SRE module mismatch Does anyone have idea of what´s happening here? I had anaconda installed previously and was running fine. But then I´ve deinstalled and reinstalled anaconda, and I´m getting this error now.
After I installed couchdb, I could get the welcome information $ curl localhost:5984 {"couchdb":"Welcome","version":"2.1.2","features":["scheduler"],"vendor":{"name":"The Apache Software Foundation"}} But I can't check the status by systemctl $ systemctl status couchdb.service ● couchdb.service Loaded: not-found (Reason: No such file or directory) Active: failed (Result: start-limit-hit) since 一 2018-12-03 14:52:14 CST; 6min ago Main PID: 30946 (code=killed, signal=USR2) 12月 03 14:52:14 gpuhuawei systemd[1]: couchdb.service: Unit entered failed state. 12月 03 14:52:14 gpuhuawei systemd[1]: couc
I am working on project in which I have to read 5-bit binary values from a text file. I have to read each 5-bit binary number and then assign them to 5 different 1-bit registers one by one. Moreover, I can't use $readmemb because my text file is so huge (almost 2MB), and I think $readmemb can't deal with such a huge file because its not working in my case. How can I use $fopen and $fread` functions to solve my problem because I have not worked on file handling in Verilog until now? Can anyone provide an example similar to my problem?
Is it possible to display an iframe in Dart? Below is the code that I am using void main() => runApp(MyApp()); class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { final wordPair = WordPair.random(); return MaterialApp( title: 'Welcome to Flutter', home: Scaffold( appBar: AppBar( title: Text('Welcome to Flutter'), ), body: Center( child: Text(wordPair.asPascalCase), // With this highlighted text. ), ), ); } } I am not sure how to add an iframe into this. Below is the snippet that is given in the documentation factory IFrameElement() => JS( 'returns:IFrameElement
Hi I have followed this tutorial with the code found here https://github.com/HackerShackOfficial/Smart-Security-Camera How do I use this on a usb camera on a windows 10 laptop? I have tried to convert this with videocapture(0) but I cant get it right someone please have a look for me! The software runs through a raspberry pi camera board and when movement is detected it screen shots she camera and emails me and the camera feed is hosted on an ip server with flask on my router.
I used quote marks around "right way" because I'm already well aware that the right way to use an asynchronous API is to simply let the asynchronous behavior propagate throughout the entire call chain. That's not an option here. I'm dealing with a very large and complicated system designed specifically to do batch processing synchronously in a loop. The reason why suddenly I'm using HttpClient is because prior to now all data for the batch processing was gathered from a SQL database, and now we're adding a Web API call to the mix. Yes, we're calling a Web API in a synchronously executing loop.
My HTML is like this: <div id="grid-container"> <slot name="items-to-be-filled"></slot> </div> I have formatted the above with CSS like this: #grid-container { display: grid; } However, the items that I filled into the slot seem to be out of order. I examined using developer's tool and found out that the slotted items are not being treated as grid items. Is it possible to treat slotted items just as normal children nodes? Thanks.
I am following this post - Change Chrome Settings via Powershell So far I can get the download settings using $settings.download.default_directory but not sure how to set a different value. I have tried using Set-Content and Set-ItemProperty but no luck (former is giving access denied error when trying to execute this command: Set-Content -Path $Settings.download.default_directory -Value 'C:\Users' -Force) FYI I don't want to use Windows Registry to change the settings.
<form action="upload_creation" method="post"> <div class="modal-footer"> <button type="button" class="btn btn-link" data-dismiss="modal">Cancel</button> <button type="submit" class="btn btn-primary">Send</button> </div> </form> this is my code for form, i want to submit a file with button public function upload_creation(Request $request){ $input = $request->all(); $creation = $this->creationRepository->create($input); foreach($request->file('direktori_gambar') as $image) { $name=time().$image->getClientOriginalName(); $image->move(public_path().'/public/img', $name); $input['pictureName']=$ima
How to overcome Python's two complement's notation and get 0b011111111111111 in the last result? Can it be done mathematically? Just can't figure out for hours already... output = 0xFFFF for i in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15): a = 1 << i print(bin(output^a)) Result: 0b1111111111111110 ✅ 0b1111111111111101 ✅ 0b1111111111111011 ✅ 0b1111111111110111 ✅ 0b1111111111101111 ✅ 0b1111111111011111 ✅ 0b1111111110111111 ✅ 0b1111111101111111 ✅ 0b1111111011111111 ✅ 0b1111110111111111 ✅ 0b1111101111111111 ✅ 0b1111011111111111 ✅ 0b1110111111111111 ✅ 0b1101111111111111 ✅ 0b1011111111111111 ✅ 0b111111
I was able to create the path and install pyinstaller appropriately. C:\Users\Ankit.Aggarwal>pip install pyinstaller Requirement already satisfied: pyinstaller in c:\users\ankit.aggarwal\appdata\roaming\python\python36\site-packages (3.4) Requirement already satisfied: setuptools in c:\program files (x86)\microsoft visual studio\shared\python36_64\lib\site-packages (from pyinstaller) (39.0.1) Requirement already satisfied: pefile>=2017.8.1 in c:\users\ankit.aggarwal\appdata\roaming\python\python36\site-packages (from pyinstaller) (2018.8.8) Requirement already satisfied: macholib>=1.8 in c:\us
When the window slides, it can detect the current height, but I don't know the unit of this height. I hope to get the total height (bottom height) using Angular. The height of the document is different from the height unit of the scroll. How do you convert between the two? Or in what way do you get the common unit? For example: import {HostListener,Inject} from "@angular/core"; import { DOCUMENT } from "@angular/platform-browser"; constructor(@Inject(DOCUMENT) private document: Document {} ngOnInit() { } @HostListener("window:scroll", [])onWindowScroll() { //.scrollTop console.log(this.documen