query_id
stringlengths
4
64
query_authorID
stringlengths
6
40
query_text
stringlengths
66
72.1k
candidate_id
stringlengths
5
64
candidate_authorID
stringlengths
6
40
candidate_text
stringlengths
9
101k
273edd07044d704cbac9536aef22c1e45a22452c31a0e984a142ef0366fc67a0
['e04a1f3656db41dc90891b6f008710c8']
Ah I tried it out (after some Googling) and it works perfectly and you're about applications relying on the GPU will crash but since I will only run it at boot, that will be no problem! Sorry that I cannot upvote your answer mine reputation isn't high enough.
2bed42e26b8bca90614a115b4587eaef579f13a2e62d6751d7a67abb64c0911f
['e04a1f3656db41dc90891b6f008710c8']
i had used linux once when i was 8 back in 2001 and i used to love it as i played the games that came with the OS, then i left linux until recently since i have been hearing about all this new linux hype so i decided to give it a try. I have used this OS since one semester now, It lives upto its hype and i am seriously in love with it and i had downloaded wine and have been playing games on it even tho all my games do not work "I'll remain patient and hope it soon becomes better" Now the only Issue with the operating system is that the games i used to play was slower, then i went to settings and details and noticed that the laptop was using Intel instead of Nvidia GPU and optimus was not supported. I understand that there might be some devs here and experts so could any one write a tutorial for serious noobs it would help me and all the new people starting to use linux. Also i wonder why ubuntu devs do not integrate Wine into the OS ?. "Sorry for my english and also if i had asked a question that already had been answered as i didn't find any of them fit to work for my laptop, i bricked the OS multiple times" P.S i also always get an error when i boot the OS and unity shows.
e1b188edc7f3a342983f0cb1a34eb2c2512a12e20c15858292b996849931674d
['e056e1b3379c4b6eb0eb9c89d6267f30']
what's the difference between phalcon beanstalk queue's choose and watch methods. the comments of the two are same. namespace Phalcon\Queue { ... /** * Change the active tube. By default the tube is 'default' * * @param string $tube * @return string|boolean */ public function choose($tube){ } /** * Change the active tube. By default the tube is 'default' * * @param string $tube * @return string|boolean */ public function watch($tube){ } ... }
6b1917cf011e336714720d53deb1804381104aa3566ceb7932f78a0d60bbf11b
['e056e1b3379c4b6eb0eb9c89d6267f30']
I have a custom vagrant box based on the offcial box ubuntu 16.04. I simplly run like this to get the packaged box. vagrant init ubuntu/xenial64; vagrant up --provider virtualbox <PERSON> up vagrant ssh # enter the virtual machine and do some custom change on it vagrant halt vagrant package --vagrantfile Vagrantfile --output custom_ubuntu1604.box and then i copy the file custom_ubuntu1604.box to another directory, i use the box like this: vagrant box add ubuntu1604base custom_ubuntu1604.box vagrant init ubuntu1604base vagrant up # at this point the machine will be stopped at "Started Journal Servie" my new virtualbox machine base on the new packaged box will stop at: the screenshot And finally it timed out: Timed out while waiting for the machine to boot. This means that Vagrant was unable to communicate with the guest machine within the configured ("config.vm.boot_timeout" value) time period. If you look above, you should be able to see the error(s) that Vagrant had when attempting to connect to the machine. These errors are usually good hints as to what may be wrong. If you're using a custom box, make sure that networking is properly working and you're able to connect to the machine. It is a common problem that networking isn't setup properly in these boxes. Verify that authentication configurations are also setup properly, as well. If the box appears to be booting properly, you may want to increase the timeout ("config.vm.boot_timeout") value.
aaaf75d3ecba6197949ddd53e48284233103cf74d404fc30fae4d0e7428d1a84
['e07059bada9147a5bed18aa1077a2810']
I am making an app using the qrCode scanner and when i open the app on my iphone and touch the button for the qrCode scanning it shuts down automatically , not opening even the camera.I used barcode_scan in pubspec.yaml and the code is: String qrResult = "Not yet Scanned"; onPressed: () async { String scaning = await BarcodeScanner.scan(); setState(() { qrResult = scaning; }); }, The app is made in flutter
72d15b47001aef95525d532e8180f94e9e7ea9b3797a901524ef93bae4755c9e
['e07059bada9147a5bed18aa1077a2810']
I am trying to make my UI scrollable but when i add the SingleChildScrollView i get this white screen not showing anything at all.I should erase the Column from the begining?Use a container?I already search on internet but i don't know what to add. Here is my code, please tell me what i can erase or add to make it work .. class _UserProfilesState extends State<UserProfiles> { @override @override Widget build(BuildContext context) { return Scaffold( body: SingleChildScrollView( child: Column( children: <Widget>[ Expanded( child: Stack( children: <Widget>[ Padding( padding: EdgeInsets.symmetric(horizontal: 10.0, vertical: 40.0), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: <Widget>[ IconButton( icon: Icon(Icons.arrow_back), iconSize: 30.0, color: Colors.black, onPressed: () => Navigator.pop(context), ), ])), Positioned( left: 24, top: MediaQuery.of(context).size.height / 6.5 - 28, child: Container( height: 84, width: 84, //profilepic child: CircleAvatar( radius: 10, backgroundImage: NetworkImage(widget.avatarUrl != null ? widget.avatarUrl : "https://icon-library.com/images/add-image-icon/add-image-icon-14.jpg"), ), ), ), Positioned( right: 24, top: MediaQuery.of(context).size.height / 6.5 + 16, child: Row( children: <Widget>[ Container( height: 32, width: 100, child: RaisedButton( onPressed: () { Navigator.of(context).push(MaterialPageRoute( builder: (context) => ChatScreen( serviceProviderId: widget.serviceProviderId, userName: widget.userName, avatarUrl: widget.avatarUrl, ))); }, color: Colors.black, textColor: Colors.white, child: Text( "Message", style: TextStyle(fontWeight: FontWeight.bold), )), ), SizedBox( width: 16, ), Container( height: 32, width: 32, decoration: BoxDecoration( image: DecorationImage( image: NetworkImage( "https://lh3.googleusercontent.com/Kf8WTct65hFJxBUDm5E-EpYsiDoLQiGGbnuyP6HBNax43YShXti9THPon1YKB6zPYpA"), fit: BoxFit.cover), shape: BoxShape.circle, color: Colors.blue), ), ], ), ), Positioned( left: 24, top: MediaQuery.of(context).size.height / 4.3, bottom: 0, right: 0, child: Container( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[ Text(widget.userName, style: TextStyle( color: Colors.black, fontWeight: FontWeight.bold, fontSize: 22, )), SizedBox( height: 4, ), Padding( padding: const EdgeInsets.all(1.0), child: Text( widget.address == "default" ? "No Address yet" : "${widget.address}", style: TextStyle( color: Colors.black, fontSize: 12, ), )), Padding( padding: const EdgeInsets.all(1.0), child: Text( "${widget.categoryName}", style: TextStyle( color: Colors.black, fontSize: 12, ), )), ], ), )) ], )) ], ), ), ); } }
f2de41c16fac9da421f530a1df7388de63ea55f771a6778f0f515b5aa29cbdd4
['e077741ab24248c4ac6722fa9ccc7e33']
In an assignment, it asks to "Draw two separate samples of 100 independent standard normals" using R. I assume that I use the rnorm function, which returns a value from a normal distribution. Given that the standard normal is the same every time, if I just use rnorm(100, mean = 0, std = 1) will that meet the requirements? Thanks!
512338e11daa8703a17ed751ad8b536719a792104f16dcb48977b2338ff4d8ad
['e077741ab24248c4ac6722fa9ccc7e33']
I'm trying to get all the URLs for the class='profile-search-school-link' but cannot even get a soup object. I do the following: site = "http://www.geteducated.com/profiles/search/Computer%20Science%20%26%20IT&SS=Search%20by%20Subject%20%3E%20Computer%20Science%20%26%20IT/?start=15" """ gets a list of the urls for the degree programs """ r = requests.get(site) html_source = r.text soup = BeautifulSoup(html_source) print(soup.prettify()) output: <class 'bs4.BeautifulSoup'> # print statement [] # my depressingly empty soup What's up with the code? Link is not broken when I paste into my browser. How do I get the URLs?
26dd48abb7a8b8da7de53311245456d829fb325b6a8ba965da87a9712b86002c
['e07ff19788104eddbbdd47623690c61c']
In my calculation, I got $$x^{3/2}e^{-x}=C$$ $$ \frac{3}{2} \log{[x]}-x=\log{C}$$ Where $C<<1$, I know that the general solutions to this equation are Lambert Functions, but considering $C$ value I was hoping maybe I can use a simpler, asymptotic behavior of $x$ to make the rest of my calculation easier. Can anyone help me with that?
eedc194f6e4aaddb06a2605ba8eff67e12ac1b89c837028bfcb3cd960fd0d705
['e07ff19788104eddbbdd47623690c61c']
I have designed a PC program using Profound UI. PUI presents IBM iSeries software to the user in a Windows format. One program is for recording inventory of items that are moving from one location to another. There is a grid -- table that includes various fields for description and one field for a jpg photo of the item. One of the features of the program allows the user to export the grid to a csv file and then open in Excel (ver 7). Is there any way to populate the column where the pictures should appear with the .jpg images? Right now, the .csv just diplays "0." Many thanks for any response.
72101979533bcc15065a1b30caf6a9cd5a2f729ea3b679eec7cddcfc50ceb612
['e0869e7ef768465a8afd42b7ff891576']
I ended up using PortAudio (very low-level, flexible license) and wrote a mixer myself. See this topic i made on the C++ forums for some other people's tips on writing a custom mixer. It's not hard at all, really; i'm surprised that there are so many mixer libraries out there. For a breakdown of the WAV format (ready-to-stream raw audio data with a 44-byte header) see this.
5fe7449ae0c8ef65bededf83fb31e08172a4eec41ec4d68af6649dd67b8f1848
['e0869e7ef768465a8afd42b7ff891576']
I'm looking for a simple-ish library for outputting audio. I'd like it to meet these criteria: Licensed under LPGL/zlib/MIT or something similar – i'm going to use it in an indie commercial application and i don't have the money for a license. Written in C, but C++ is fine. Cross-platform (Windows, Linux, maybe OSX) Able to read from some sort of audio file (i'd prefer WAV or OGG but i will gladly use less popular formats if need be) in memory (i've seen the use of a memfile struct and user-defined I/O callbacks). I need the file to be in memory because i put all my resources into a .zip archive, and i use another library to load those archived files into memory. Supports playing multiple sounds at the same time, having a max of 8 or so is ok. I'd really like to either have the source code or a static library (MinGW/GCC lib???.a), but if nothing else is available i will use a shared library. I must have come accross two dozen different audio libraries in my search, all of which haven't quite met these criteria...
92a1b225518b0560097ac4289deb8664899048a4343366a15d3c2ac5c9bd68ec
['e0918e4f812d430ba9cfd63488c69c70']
Using command-line : docker run -it --name <WHATEVER> -p <LOCAL_PORT>:<CONTAINER_PORT> -v <LOCAL_PATH>:<CONTAINER_PATH> -d <IMAGE>:<TAG> Using docker-compose.yaml : version: '2' services: cms: image: <IMAGE>:<TAG> ports: - <LOCAL_PORT>:<CONTAINER_PORT> volumes: - <LOCAL_PATH>:<CONTAINER_PATH> Assume : IMAGE: k3_s3 TAG: latest LOCAL_PORT: 8080 CONTAINER_PORT: 8080 LOCAL_PATH: /volume-to-mount CONTAINER_PATH: /mnt Examples : First create /volume-to-mount. (Skip if exist) $ mkdir -p /volume-to-mount docker-compose -f docker-compose.yaml up -d version: '2' services: cms: image: ghost-cms:latest ports: - 8080:8080 volumes: - /volume-to-mount:/mnt Verify your container : docker exec -it CONTAINER_ID ls -la /mnt
35f5e015f52b885d868b42d72a23c13e3f146d68193406483b08ee37b86f01d1
['e0918e4f812d430ba9cfd63488c69c70']
Fist you have to careful with the / (trailing slash) on the proxy_pass : The configuration should look likes below : worker_processes 1; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; sendfile on; keepalive_timeout 65; server { listen 8000 ssl; server_name localhost; ssl_certificate /etc/ssl/localhost/localhost.crt; ssl_certificate_key /etc/ssl/localhost/localhost.key; root <PATH_TO_APPS>; index index.html; location / { try_files $uri $uri/ /index.html; } location /facebook { rewrite ^(/.*)$ https://www.facebook.com permanent; } location /google { rewrite ^(/.*)$ https://www.google.com permanent; } } server { listen 443 ssl; server_name localhost; ssl_certificate /etc/ssl/localhost/localhost.crt; ssl_certificate_key /etc/ssl/localhost/localhost.key; ssl_session_cache shared:SSL:1m; ssl_session_timeout 5m; ssl_ciphers HIGH:!aNULL:!MD5; ssl_prefer_server_ciphers on; location / { return 301 https://localhost:8000; } } include servers/*; }
963cd6ebbf22e86ee42994f496dad93773b17fb5a46f36c9b64fbf76972ab680
['e0932cc23fae430d9b8484af6d900b07']
Here is an example of the method you can use with the map view: [googleMap setRegion:MKCoordinateRegionMake(location, coordSpan]; googleMap will be you MKMapView object and the location would be a CLLocationCoordinate2D (The lat. & lon. values) struct and coordSpan would be a MKCoordinateSpan struct (Specifies how large the viewing area is). Update: This can be used for custom latitude and longitude valuesThe suggestion of using mapView.showsUserLocation = YES; Would be the easiest direct way if your just concerned with the users exact location.
c27cc57c589df00397fe3d6fdb91fa877eae8cffeb09d4e5e69c267d6091b82d
['e0932cc23fae430d9b8484af6d900b07']
I trained a CNN on CIFAR10 (implemented in PyTorch) with the following architecture: INPUT: (3,32,32) --> Conv2d layer (kernel: 3x3, stride:1x1, filters: 64) --> Activation: ReLU --> Max pooling (kernel: 2x2) --> Conv2d layer (kernel: 3x3, stride:1x1, filters: 16) --> Activation: ReLU --> Max pooling (kernel: 2x2) --> Fully connected layer of 784 --> Softmax (I used <PERSON> optimize, <PERSON> initialization, and variable learning rate, training in mini-batches of 100 with 5000 train samples and 1000 test samples) Training for 50 epochs yeilded train accuracy of 77% and test accuracy of 48%. When modifing the model to have kernel of 5x5 in both conv layers (and fitting the linear layer for the required size), the network results was 44% for train accuracy and 50% for the test accuracy. I am trying to explain why the results are getting worse when training with bigger kernel, it seems that, in general, the opposite will make sence: larger kernel can learn as the smaller one and even further. Two other observations I couldn't explain is that the convergence around 50% in the small kernel arrives around 10 epochs and keeps that accuracy for the rest of the training while the larger kernel slightly improves test accuracy during all the training. Also, it seems like the 5x5 kernel generalize better (the gap between train and test acc is smaller). Any ideas? This is the plot of the 3x3 kernel size: and the 5x5 kernel size:
c7a9f20e629a4791ebe37ab1907bd384eda50252ad7045cdd95c17062673c10c
['e0a273d9a0294116a017569eac6a05c1']
I'm struggling with understanding hazard in the context of survival analysis. Unfortunately I can't find any example calcuations online with simple values, and I struggle with the respective equations, so I invented an example and would be very grateful for comments if I understood the matter correctly. Let's assume participants can either leave a study (censored) or get diagnosed with a disease (event). $$\begin{array}{c|c|c|} & \text{day of exam $t$} & \text{sample size $n(t)$} & \text{events} & \text{proportion surviving $p(t)$} & \text{$\hat S(t)$}\\ \hline \text{} & 0 & 20 & 0 & 1 & 1\\ \hline \text{} & 1 & 20 & 1 & 19/20 & 1*19/20 = 19/20\\ \hline \text{} & 3 & 19 & 1 & 18/19 & 19/20*(18/19)=9/10\\ \hline \text{} & 20 & 18 & 0 & 18/18=1 & 9/10*1=9/10\\ \hline \end{array}$$ $\hat S(t)$ denotes the Kaplan Meier estimate. Let $h(t)$ be the hazard at time point $t$ At day 30, one patient has been censored (left the sample without event recorded). I'm not sure how to calculate the hazard from these values, and if ths is even meaningful. My first intuition was to calculate the probability of an event during one day, under the condition of having survived without an event up to the respective time point. For day 1, this would yield a hazard of $h(1)=1/20$. Given this understanding is correct, I'm not sure how to proceed to day 3. Since the conditional probability of survival up to day 3, given the participant has survived up to day 1, is $p(3)=18/19$, the conditional probability of the event is 1/19. To my understanding the conditional probability of the event at day 3 is still different from the hazard $h(3)$, which has to take the number of days into account. As a sidenote, I'm not sure if there is a difference between the terms "hazard rate" (not hazard ratio) and "hazard" and would be grateful for an explanation.
2f45134608a21aa09c34b9f54ae2f9fadaae9e45776ab6fc44dfe091fe371085
['e0a273d9a0294116a017569eac6a05c1']
I have a very large file on a different company's server (not the company I work for, just a company we work with). I have FTP credentials to login and download/upload files from them. I need to get this very large file onto our website's (the company I work for) live server. What I'd like to avoid is the step of downloading the file to my laptop, then uploading the file to our server. I'd like a command line option that can "skip the middle man" so to speak. Unfortunately at this point my command line knowledge is passable at best, and is something I need to work on. I'm afraid at times it prevents me from looking for or asking the right questions, which may be the case here if this question is already answered, but I couldn't find a way to frame it using Google searches to get an answer I understand. I had a coworker point me to this article: http://blogs.reliablepenguin.com/2009/08/11/ftps-with-lftp However, the article doesn't explain what is happening very clearly, and I don't feel like it fully addresses what I'm trying to do, or may imply a certain level of command line understanding that I don't have. Any help would be appreciated.
2669768baceebcc5cf9cc78c0ce7e660e719863039c91b819f036218144019c7
['e0b09fb8ddc64af3a80ffd70ba0664b2']
You have probably added the list to a sitepage. Permissions work differently for sitepages and apps. If you grant a user permission to view a sitepage you implicitly grant the permission to view any webpart on that sitepage. If the user does not have permission to view the contents of the app inside of the webpart, the app will display as having no content. To get the error message you desire when no read permission was granted, you have to share the URL of your list. Go to you site contents (gear icon top right corner) and click on your list. Now copy the URL from your navigation bar and share it with your users.
e2cadb8bfc0257f331d5fef6fe0b87911776c94f8f2960314dc024b27a2c8531
['e0b09fb8ddc64af3a80ffd70ba0664b2']
What you are doing is not migrating the appointments, but creating new ones. The property "organizer" is read-only and can't be changed, so you will not succeed this way. What I'd try is to get the organizers of the appointments from User A, impersonate those (or using delegate access) and send an invitation to User B. Hot to impersonate another user: https://msdn.microsoft.com/en-us/library/office/dd633680(v=exchg.80).aspx Hot to get delegate access: https://msdn.microsoft.com/en-us/library/office/dn641957(v=exchg.150).aspx
f2f0bcbe460ccc13b00534e8a50a6dc5f2db4971303a758c33324e633e7663e4
['e0b43fdd3bdf42fe9ce8ac159a88f396']
There are 2 problems. A problem with Scanner and with the condition keyboard.nextDouble(), keyboard.next() etc... (all except .nextLine() ) leave the newline ( \n or Enter ) in the buffer. This can cause problems etc.. I suggest adding a delimiter using keyboard.useDelimiter("\n");. This only needs to be done once and can be done right after initialization of keyboard. That way, it will only see the Enter as a signal to end that current input. Also, the conditions must all be using the .equals() method or .equalsIgnoreCase() which is written as: operation.equals("Multiplication"); or operation.equalsIgnoreCase("multiplication");
89e352a5f5ee2d52d2a2fb8b9fd680714182089d3e1e9cad7a1720f63955d00d
['e0b43fdd3bdf42fe9ce8ac159a88f396']
The ButtonListener needs to be added to the button only, so that it will be activated when you press the button and trigger the event. You can remove 'digitN.addActionListener(new ButtonListener());` and instead use: button.addActionListener(new ButtonListener()); Like that, you are instructing Java to listen to the button being pressed and not the text field (which will trigger it when pressing the Enter key)
9947077950bf55d13be595de63063fc6c7a08b8c0ad8d281c7b61dcd70ae59b0
['e0b58f80a88944d49b1521aba97e29fd']
I just do a coding challenge and I know how to solve it with a classic if-else statement using a forEach loop without arrow functions. Now I wonder how can I achieve this using ES6 within the forEach loop? // Create a function that returns the product of all odd integers in an array. const odds = [ 2, 3, 6, 7, 8 ]; const oddProduct = (arr) => { arr.forEach(function(element) { if (element % 2 === 0) { console.log(element); } }); }; oddProduct(odds); I already learned how to create an arrow function for the forEach loop, but I have no clue how to add in the if-else statement. const oddProduct = (arr) => { arr.forEach((element) => console.log(element)); }; Also, if someone could tell me the shortest possible way to do this using shorthand statements, I'd be happy to learn!
0a7926d3bfaefad26aaa14280446db2ed919219264c580af222e7771656d09a4
['e0b58f80a88944d49b1521aba97e29fd']
I am creating a script with Python3 that runs a couple of Linux terminal commands for me (https://github.com/stefanrows/ceos3c-baseline-installer) Everything works so far except the following line: os.system('sudo -u {} sudo sh -c 'echo "deb [arch=amd64 signed-by=/usr/share/keyrings/packages.microsoft.gpg] https://packages.microsoft.com/repos/vscode stable main" > /etc/apt/sources.list.d/vscode.list'.format(user)) I am pretty sure it has something to do with character escaping, but I don't know where exactly I have to change something. Would be great if someone could point me in the right direction!
3f9d2308507ad4b5c6ea2ccd9c7ab194ff32e1e62b3f6d6ef6d174f807e7daa9
['e0b71478e3584aee9c9a0607f2ab2374']
I have some text with non-breaking hyphen in word. I need that text as it is in output. But am getting text with non-breaking hyphen removed. Word.Range rangeObj = _wordDoc.Range(ref x, ref y); txt += rangeObj.Text; I am using the above code. And in txt variable I am getting output but with non breaking hyphen removed. Thanks in advance.
1efbf8635c1eb34e81bb99ca3c87207e728e6c625704df7e86c68ae38026316d
['e0b71478e3584aee9c9a0607f2ab2374']
is there any way to find a next match in a specified range if there are 2 matches in the range. or if there is any way to get a list of all the matches. currently I am using the below interop method to find the match but it will highlight only the first match. bool found = foundRange.Find.Execute(ref oFindText, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing); Thank you.
e002ac2cb1e0dc39dda2ddc25fb42766bb562f4545833c52d7163398820e45f8
['e0bcf080b1424f21967c1e61826deb68']
Good day, Currently I am working on an EventSystem for an Unity Porject. Therefore I want to make use of the UnityEvent (which have been improved during the last year as I heard). The EventManager shall be as generic as possible and therefore register the Events by their EventType. Therefore I created a generic BaseEvent which derives from UnityEvent. The type shall be of IEventData, which is an interface for defining EventData objects. public class BaseEvent<T> : UnityEvent<T> where T : IEventData {} public interface IEventData {} public struct SomeEventData : IEventData { public readonly float someFloat; public readonly bool someBool; public SomeEventData(float param1, bool param2) { someFloat = param1; someBool = param2; } } Now I have following problems in the Eventmanager. As the EventManager holds a dictionary with BaseEvent I get errors when trying to access them from the generic Methods like AddListener. public class EventManager { private Dictionary<System.Type, BaseEvent<IEventData>> m_events; private static EventManager m_instance; public static EventManager Instance { get { if (m_instance == null) { m_instance = new EventManager(); } return m_instance; } } public static void AddListener<T>(BaseEvent<T> listener) where T : IEventData { BaseEvent<T> tempEvent; if (Instance.m_events.TryGetValue(typeof(T), out tempEvent)) { tempEvent.AddListener(listener); } else { tempEvent = new BaseEvent<T>(); tempEvent.AddListener(listener); Instance.m_events.Add(typeof(T), tempEvent); } } The error is obvious. It's not possible to convert from BaseEvent of T to out BaseEvent of IEventData. But I don't know how I have to change the code to get it working. I thought "where T : IEventData" fixes the problem, but I think it does not, as T may be a derived class. My question is: Is it possible to add generic BaseEvents as I intend to do it? Many thanks in advance!
0914aeccd398bc745f647b2555ca1ce57e4005b5c3070509f3dc94fe444cb31e
['e0bcf080b1424f21967c1e61826deb68']
For everyone who needs automatic SDD payments in Odoo v13, here's the Automated Action that works for me (one more, thanks <PERSON> for your assistance): Modell: account.move Trigger: on update Action: Execute python code Domain (before update): ["&","&","&","&",["sdd_paying_mandate_id","=",False],["partner_id.sdd_mandate_ids","!=",False],["type","=","out_invoice"],["invoice_payment_state","=","not_paid"],["state","=","draft"]] Domain (after update): ["&","&","&","&",["sdd_paying_mandate_id","=",False],["partner_id.sdd_mandate_ids","!=",False],["type","=","out_invoice"],["invoice_payment_state","=","not_paid"],["state","!=","draft"]] Python code to execute: payment = env['account.payment'].create({ #'name' : env['ir.sequence'].next_by_code('account.payment.customer.invoice'), #'payment_type': 'inbound', #'partner_type' : 'customer', 'payment_method_id' : 6, 'partner_id': record.partner_id.id, 'journal_id' : 10, 'amount' : record.amount_residual}).post() You have to upate the journal and payment_method ids within the python code to match your IDs in order to get the action running properly. Any improvements and/or feedback are welcome. Best regards, <PERSON>
19752042f0068389df24cf2999a2fb8a31b9f7fb6a009a699c6dfc49303ad714
['e0c295eb11524776a2e37006a1a80f1c']
so i have this: def main(): num = input("Enter a number:") total = 0 for digit in str(num): total += int(digit) print(total) main() what this does, is take the digits in a string and add them together (321 would have an output of 6). What i need to do, is do a for in range loop that takes all of the number in the range, take their digits, and add the sum to a whole new total. Basically doing what the first function does but with multiple numbers (for example, entering 10 and 15 would add together 1(10: 1 + 0), 2(11: 1+1), 3(12: 1+2), 4(13: 1+3), 5(14: 1+4), and 6 (15: 1+5). 1+2+3+4+5+6=21. So entering 10 and 15 in the range would have an output of 21.
f5143b5c0b558eb31c5dbb21c7aac456747aec3ecbd6cc18d6dacf1b5955c546
['e0c295eb11524776a2e37006a1a80f1c']
import random #set counters counter2=0 counter3=0 counter4=0 counter5=0 counter6=0 counter7=0 counter8=0 counter9=0 counter9=0 counter10=0 counter11=0 counter12=0 doubles=0 def main(): #get input from user rolls = int(input("How many times would you like to roll the dice?") for count in range(rolls+1) #roll dice die1 = random.randint(1,6) die2 = random.randint(1,6) #add up dice totals to counters if die1 + die2 = 2: counter2 += 1 if die1 + die2 == 3: counter3 += 1 if die1 + die2 == 4: counter4 += 1 if die1 + die2 == 5: counter5 += 1 if die1 + die2 == 6: counter6 += 1 if die1 + die2 == 7: counter7 += 1 if die1 + die2 == 8: counter8 += 1 if die1 + die2 == 9: counter9 += 1 if die1 + die2 == 10: counter10 += 1 if die1 + die2 == 11: counter11 += 1 if die1 + die2 == 12: counter12 += 1 if die1 == die2: doubles += 1 #print data print("2 - ", counter2, \ "3 - ", counter3, \ "4 - ", counter4, \ "5 - ", counter5, \ "6 - ", counter6, \ "7 - ", counter7, \ "8 - ", counter8, \ "9 - ", counter9, \ "10 - ", counter10, \ "11 - ", counter11, \ "12 - ", counter12, \ "Doubles - ", doubles) main() the object of the program is to roll the 2 dice however many times the user wants, then list how many times the dice rolled 1,2, 3, 4, etc etc. the lines "die1 = random.randint(1,6) and die2 = random.randint(1,6) give me a syntax error and highlight the "die1" mind telling me what i'm doing wrong?
7d263247d09f1c27195e865449765efc4ef74aabbfcd1221cbfaa3c822bd298d
['e0cda6ae6f4141d8a378e75ae1a04449']
I have created a JFrame with a JPanel containing different components, and for example I want the JPanel to have a visible border and a visible image when the mouse is inside the bounds of the JPanel. My problem is that as soon as the mouse hovers over an "interactable" component inside the JPanel it will register as the mouse exited the JPanel. I'd like it to draw these things as long as it's inside the bounds of the JPanel, and when the mouse exits the JPanel's bounds the border and image "dissappear". Is there any way to achieve this? Here's a little demo: public class Test { /** * @param args the command line arguments */ public static void main(String[] args) { new TestFrame(); } static class TestFrame extends JFrame{ JPanel panel; JButton hoverButton; JButton appearingButton; public TestFrame() { super(); this.setDefaultCloseOperation(EXIT_ON_CLOSE); panel = new JPanel(); panel.setBackground(Color.red); hoverButton = new JButton("Hover me!"); appearingButton = new JButton("I appeared!"); appearingButton.setVisible(false); panel.add(hoverButton); panel.add(appearingButton); panel.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseEntered(java.awt.event.MouseEvent evt) { System.out.println("Entered!"); appearingButton.setVisible(true); } public void mouseExited(java.awt.event.MouseEvent evt) { System.out.println("Exited!"); appearingButton.setVisible(false); } }); add(panel); setSize(new Dimension(200, 200)); setVisible(true); } } } While having the mouse inside the JPanel (covering the full JFrame) the second button will appear. Hovering over the first button will however make the second button dissappear. I'd like the second button to show as long as you are inside the bounds of the JPanel.
88ae402a29cd31778f8e44e2e511df26a48664e9cfac1b0621a9922edd0727d1
['e0cda6ae6f4141d8a378e75ae1a04449']
I want to create a list of Views, where the images shown in each View is downloaded from a server as you scroll the list (lazy loading). This is the code I have got so far: public class CustomAdapter extends ArrayAdapter<Component> { private final List<Component> components; private final Activity activity; public CustomAdapter(Activity context, List<Component> components) { super(context, android.R.layout.simple_list_item_1, components); this.components = components; this.activity = context; } @Override public View getView(int position, View convertView, ViewGroup parent) { ViewHolder viewHolder; if (convertView == null) { LayoutInflater inflater = activity.getLayoutInflater(); convertView = inflater.inflate(R.layout.item, null, false); viewHolder = new ViewHolder(); viewHolder.imageView = (ImageView) convertView.findViewById(R.id.image); convertView.setTag(viewHolder); } else { viewHolder = (ViewHolder)convertView.getTag(); } Component component = components.get(position); // Don't show any image before the correct one is downloaded viewHolder.imageView.setImageBitmap(null); if (component.getImage() == null) { // Image not downloaded already new DownloadImageTask(viewHolder.imageView).execute(component); } else { viewHolder.imageView.setImageBitmap(component.getImage()); } return convertView; } private class ViewHolder { ImageView imageView; } private class DownloadImageTask extends AsyncTask<Component, Void, Component> { private ImageView imageView; public DownloadImageTask(ImageView imageView) { this.imageView = imageView; } @Override protected Component doInBackground(Component... params) { String url = params[0].getImageURL(); Component component = params[0]; // Download the image using the URL address inside found in component Bitmap image = ImageDownloader.getImage(url); // Set the Bitmap image to the component so we don't have to download it again component.setImage(image); return component; } @Override protected void onPostExecute(Component component) { // Update the ImageView with the downloaded image and play animation imageView.setImageBitmap(component.getImage()); Animation animation = AnimationUtils.loadAnimation(activity, R.anim.fade_in); imageView.startAnimation(animation); } } } Basically, when getView() is run it gets data (in this case a Bitmap) from Component (which is used to cache data from the item), unless there is no data. In that case it executes the DownloadImageTask which will download the image and store it inside a Component. Once it's stored it puts the image in the ImageView. My problem is that when using the ViewHolder pattern the ImageViews, instead of the "wrong way" (calling findViewById() each time), scrolling through the list will make the wrong ImageViews get the downloaded Bitmap. This gif shows how it looks: Preview Obviously, I want the images to only appear where they should. Is there any good way to make this work as supposed to?
b8170792ae3ad5cbe9ea97c15076835681677f40b177b5d7d16779db3cda51d9
['e0e08bef37ec43bdb702e294a34409e1']
I was having a similar problem with my react-redux setup and realized my events array of objects wasn't formatted correctly. Other than checking this, I'd also check to see if BigCalendar is getting rendered with anything from this.props.events in the first place. Every time the events prop is changed for BigCalendar it updates itself.
04fc9410788fff408487b2f9391d19e97a070abf3bde76440c090b4735317da9
['e0e08bef37ec43bdb702e294a34409e1']
I'll weigh my 2 cents on the issue as I just spent a good deal of time getting it to work. It's a medley of answers I've found googling the issue. var doc = new PDFDocument(); var stream = doc.pipe(blobStream()); var files = { img1: { url: 'http://upload.wikimedia.org/wikipedia/commons/0/0c/Cow_female_black_white.jpg', } }; Use the above object at a place to store all of the images and other files needed in the pdf. var filesLoaded = 0; //helper function to get 'files' object with base64 data function loadedFile(xhr) { for (var file in files) { if (files[file].url === xhr.responseURL) { var unit8 = new Uint8Array(xhr.response); var raw = String.fromCharCode.apply(null,unit8); var b64=btoa(raw); var dataURI="data:image/jpeg;base64,"+b64; files[file].data = dataURI; } } filesLoaded += 1; //Only create pdf after all files have been loaded if (filesLoaded == Object.keys(files).length) { showPDF(); } } //Initiate xhr requests for (var file in files) { files[file].xhr = new XMLHttpRequest(); files[file].xhr.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { loadedFile(this); } }; files[file].xhr.responseType = 'arraybuffer'; files[file].xhr.open('GET', files[file].url); files[file].xhr.send(null); } function showPDF() { doc.image(files.img1.data, 100, 200, {fit: [80, 80]}); doc.end() } //IFFE that will download pdf on load var saveData = (function () { var a = document.createElement("a"); document.body.appendChild(a); a.style = "display: none"; return function (blob, fileName) { var url = window.URL.createObjectURL(blob); a.href = url; a.download = fileName; a.click(); window.URL.revokeObjectURL(url); }; }()); stream.on('finish', function() { var blob = stream.toBlob('application/pdf'); saveData(blob, 'aa.pdf'); }); The biggest issue I came across was getting the info from the arraybuffer type to a string with base64 data. I hope this helps! Here is the js fiddle where most of the xhr code came from.
35308d94b7dd63be381b12d06cd99c50aa9dafbe3fb9848d53f591a776a26c69
['e0e3399333d14847b1ac99c72878f5a7']
What is the difference between the not() operator and !=? See this example: <?xml version="1.0" encoding="UTF-8"?> <body> <test>123</test> </body> <xsl:template match="/"> <xsl:if test = "/body/test = (123, 2)">true1</xsl:if> <xsl:if test = "not(/body/test != (123, 2))">true2</xsl:if> </xsl:template> http://xsltransform.net/jyH9rMx Why do i get true1 as a result, but not true2? I would expect the two lines to be equivalent. Why are they not?
db978a8359f38439484ff2a1b4cde20d514f2eb3c6e325d4ad40253e1bced8a8
['e0e3399333d14847b1ac99c72878f5a7']
I found a way to solve this with a different approach: <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="@*|node()"> <xsl:apply-templates select="@*|node()"/> </xsl:template> <xsl:template match="root"> <root> <xsl:apply-templates select="@*|node()"/> </root> </xsl:template> <xsl:template match="item"> <item> <xsl:apply-templates select="@*|node()"/> </item> </xsl:template> <xsl:template match="c | d"> <xsl:copy-of select="."/> </xsl:template> </xsl:stylesheet> However it still bugs me what is wrong with my original idea, so I'd be very happy if someone can help me there.
b2dd0b64269bff2ce780e690dd17cb15239fd6f8ac7390d396bc012fbc877670
['e0e683ed9ea4497499ff24586e064a41']
`for (var i in this.current.questionnaireProfil) { if (this.current.questionnaireProfil.hasOwnProperty(i)) { console.log(i + " -> " + this.current.questionnaireProfil[key+1]); }; } for(var question in this.current.questionnaireProfil[i]){ this.current=this.current.questionnaireProfil[i][question]; }` with this, I go from p1 to p32 (the last one for this group question).
90bb0be3de34ca06f9085c634e5ce622296f21e05ddbcaf1c0fa67caf7abff03
['e0e683ed9ea4497499ff24586e064a41']
for(var i=1 ;i<=this.current.response.length; i++){ var result = this.current.response[i]; while(verif < this.current.response.length){ if(result[verif]==true){ console.log(result) ok= true;console.log("ouououo"); } verif++; } } if(ok==false){ error=true } because with this code, I put to the real first item and each item takes into account the truth of the first question; I want to reset the value so that I can redo it for each question. My question is this.current.response => 1: {} (first question) 2: {} (second question) ect ...
6ba2003cdd1581b227727a19d455b518dca1ba6a5020b1e54f9eb3856ddf82b0
['e0e9dd29ce2f4ba6802ee43f0cfb2b38']
The JavaDoc of DB.getCollection states: Gets a collection with a given name. If the collection does not exist, a new collection is created. However, it seems that the collection is actually created later. Right after the getCollection() is does not exist. When I e.g., insert a doc, then it created. Consider this: myCollection.getDB().getCollection("dummy").getStats() (com.mongodb.CommandResult) { "serverUsed" : "localhost/<IP_ADDRESS>:27801" , "ok" : 0.0 , "errmsg" : "ns not found"} In my case I was calling a mapreduce job which I passed a collection that did not yet exist. This also results in '{ "serverUsed" : "localhost/<IP_ADDRESS>:27801" , "ok" : 0.0 , "errmsg" : "ns doesn't exist"}'. I guess the JavaDoc is incorrect. Actually the collection is lazily created later. If so, what would be the best way to achieve the behavior to immediately create the collection? I am using java driver version 2.11.3
ccfef93e2616c246e6748e4abfbfb4bbc8095d524395a2c6f793e82bfc471d5d
['e0e9dd29ce2f4ba6802ee43f0cfb2b38']
I think both advantages are there but are not that useful. The main problems remain the same: UnmodifiableList still is a List and thus all the setters are available and the underlying collections still are modifiable. Making the class UnmodifiableList public would add to the illusion of being unmodifiable. The nicer way would be for the compiler to help, but for that the collection class hierarchies would have to changed a lot. E.g., the collection API of Scala is way more advanced in that respect. A disadvantage would be the introduction of at least three additional classes / interfaces into the API. Because of them not being that useful, I think leaving them out of the API is a good choice.
e7fdfe94fc8c4aca81fd955404f09ed0bca6baa8eee5b7f184794b7bd9eda844
['e0ebdfad823a48839de8638808c137fd']
This is a widescope question. (like the length of a piece of string), but Ill try to make this helpful: If you have values in local store in webserver I assume your webserver is JSON? Or did you use the sql local storage option? Regardless of type of storage, you need to build an interface that both handles: a) Reading data from your local database -> its important to involve some kind of date or index value in here if you are aiming to sync databases... this is to make sure you send IN ORDER all transactions / updates which are in your database. For this to happen you must store your data not only as tables with inforamtion but also tables that contain events of when updates happened and what was updated. (change tables). This will help check in the server end that everything is sync and also means you dont send data to the server that is not needed and can be kept locally. ((otherwise what is the point of local store if you cant save yourself server database space by only syncing waht is necessary?) b) A HTTP local server to send the data to your destination client server or database server, etc (however you have set your infrastructure) - I recommend using industry standards for your language and server, which is Ajax and JQuery. If you do a lot of streaming of data then i recommend looking into RXjs with Ajax to get a http interface built (interface in this sense just means a way to expose your client like an API and post http calls) c) An event loop to handle how often and what triggers the synchronization so that you dont destroy your users machine with overdoing it (you dont want to do this too often, but also want to it to be meaninful rather than "every night" maybe user enabled whenever you detect an event which triggers wifi available again.) - i recommend using native wifi reading capabilities built into Apache Cordova and also industry standards for your server setup (for example Express.js for Node.JS). Obviously the backend server needs to have its API set up and authentication / authorizations, etc.
b1c31d7fc43b5770a55c7c04b01cefc48c3e5af2614089e96ecfea83be7c628a
['e0ebdfad823a48839de8638808c137fd']
Basically I want to chain multiple calls from the server to the databse but only with one call from the client... yes i know its suicidal for cost but necessary unfortunately :( The groundworks: So I am abstracting this to a high level design of my "servers". (Ignore the fact that I have left protocols and firewalls out please... on purpose) This is what I want to implement to make sure authorizations are almost bullet proof (not authentication): 1)The user makes a call: (END USER CLIENT)--->(call)-->(server) 2)Server transforms the call to look up a authorizations table with users access: (EUCLIENT)--->(call)-->(server)(module1: gets auth for user)--> (dbserver) 3)DB server returns the data: (EUCLIENT)--->(call)-->(server)(module1)<----return---(dbserver) 4)Now another module applies this auth and adds it as a filter on a newwly built query on top of the user query: (EUCLIENT)--->(call)-->(server)(module2: ==new query==) 5) Finally a module send the finished query to the db sesrver one last time: (EUCLIENT)--->(call)-->(server)(module3)--call----> (dbserver) 6) DB sends response, server serves response back to user: -----------------------(server)(module3) <--return----(dbserver) (EUCLIENT)<---return<--(server)(module4) The question: Is it possible to query 2 times the db query all with just one call from the client side?(I know this incurs a roundtrip time cost doing 2 calls but I have my reasons :) finally What verbs do I need to use in module 2 or 3 to do this so the call remains open, is it just a a callback? thank <PERSON> very much for yout time in advance <PERSON> Ive tried chainig middleware but this is very early stages and appreicate any help ... dont want to go down the rabbit hole if its not possible to come back out!
5230cda7ac2ecaa56baa739bef6acf3666c7426c5c2aaf6ff7cc043a8402b2df
['e0fd824821c6443ab5fe586ca7bf83ee']
How do i increment camp by say 3 instead of 1 , each time over here? <div class="row" ng-repeat="camp in camps"> <div class="col-lg-3"> <img src={{camp.img}} alt="" height="200pt" width="250pt"/></div> <div class="col-lg-5 col-lg-offset-1">{{camp.email}}<br/> <span>{{camp.campname}}</span><br/> {{camp.about}}<br/> {{camp.tgtamt}}<br/> {{camp.enddate}}<br/><br/> <button id="view" class="btn btn-default" value1='{{camp.campname}}' value2='{{camp.email}}'>View</button> </div></div> <hr/> </div>
ab5d3a2e3257609b37157ecb02e3af41c523619436bc2603a9d42aecab88bc6c
['e0fd824821c6443ab5fe586ca7bf83ee']
After last software update,I'm find a new problem: When i use my speakers from jack,don't use any players - i hear when switch on auto mute,and noisy sound like ultrasound. First of all i tried switch off "auto mute" in alsamixer - not solved my problem. Then I tried to delete alsa and pulse - not solved my problem.
1daf47a979a08db7840be20ce113b9a2952395afe909efdc6b1869698bf06d03
['e102fe4399d44891ace5ba304237480f']
I have fixed the issue by checking if the user has any current active subscriptions before I subscribe them, I am not sure why it was happening in the first place but I presume it was due to internet speed or disconnection on mobile devices, so javascript was sending the request but before it redirects the user, it would have lost it's connection. Here is how I fixed it with stripe SDK: customer = stripe.Customer.retrieve(user_membership.stripe_customer_id) if customer.subscriptions.total_count > 0: for i in customer.subscriptions.data: if i.plan['id'] == selected_membership.stripe_plan_id and i.plan['active'] == True: messages.info( request, "Your have already subscribed to this plan") return redirect(reverse('membership:update-transactions', kwargs={ 'subscription_id': i.id })) else: pass # Maybe we can check if users have a subscription that needs renewing else: If anyone have a cleaner code please share it with me.
b5d5df8cb40d4df56e2cc94e343a837b446e3dd989bea637ac6b2e132ac0a956
['e102fe4399d44891ace5ba304237480f']
I have got the following javascript which I wish to use on my website, but it doesn't work, can somebody check this and tell me why? Thanks I have taken the code from this website https://codepen.io/anon/pen/wrrYZN I am new to Javascript and this code seems quit advance to me but I need it for a project. Below I have included my basic html and css file too. Thank you in advance for helping me :) var density = 90, speed = 2, winHeight = window.innerHeight, winWidth = window.innerWidth, start = { yMin: winHeight - 50, yMax: winHeight, xMin: (winWidth / 2) + 10, xMax: (winWidth / 2) + 40, scaleMin: 0.1, scaleMax: 0.25, scaleXMin: 0.1, scaleXMax: 1, scaleYMin: 1, scaleYMax: 2, opacityMin: 0.1, opacityMax: 0.4 }, mid = { yMin: winHeight * 0.4, yMax: winHeight * 0.9, xMin: winWidth * 0.1, xMax: winWidth * 0.9, scaleMin: 0.2, scaleMax: 0.8, opacityMin: 0.5, opacityMax: 1 }, end = { yMin: -180, yMax: -180, xMin: -100, xMax: winWidth + 180, scaleMin: 0.1, scaleMax: 1, opacityMin: 0.4, opacityMax: 0.7 }; function range(map, prop) { var min = map[prop + 'Min'], max = map[prop + 'Max']; return min + (max - min) * Math.random(); } function sign() { return Math.random() < 0.5 ? -1 : 1; } function randomEase(easeThis, easeThat) { if (Math.random() < 0.5) { return easeThat; } return easeThis; } function spawn(particle) { var wholeDuration = (10 / speed) * (0.7 + Math.random() * 0.4), delay = wholeDuration * Math.random(), partialDuration = (wholeDuration + 1) * (0.2 + Math.random() * 0.3); TweenLite.set(particle, { y: range(start, 'y'), x: range(start, 'x'), scaleX: range(start, 'scaleX'), scaleY: range(start, 'scaleY'), scale: range(start, 'scale'), opacity: range(start, 'opacity'), visibility: 'hidden' }); // Moving upward TweenLite.to(particle, partialDuration, { delay: delay, y: range(mid, 'y'), ease: randomEase(Linear.easeOut, Back.easeInOut) }); TweenLite.to(particle, wholeDuration - partialDuration, { delay: partialDuration + delay, y: range(end, 'y'), ease: Back.easeIn }); //Moving on axis X TweenLite.to(particle, partialDuration, { delay: delay, x: range(mid, 'x'), ease: Power1.easeOut }); TweenLite.to(particle, wholeDuration - partialDuration, { delay: partialDuration + delay, x: range(end, 'x'), ease: Power1.easeIn }); //opacity and scale partialDuration = wholeDuration * (0.5 + Math.random() * 0.3); TweenLite.to(particle, partialDuration, { delay: delay, scale: range(mid, 'scale'), autoAlpha: range(mid, 'opacity'), ease: Linear.easeNone }); TweenLite.to(particle, wholeDuration - partialDuration, { delay: partialDuration + delay, scale: range(end, 'scale'), autoAlpha: range(end, 'opacity'), ease: Linear.easeNone, onComplete: spawn, onCompleteParams: [particle] }); } window.onload = createParticle; function createParticle() { var i, particleSpark; for (i = 0; i < density; i += 1) { particleSpark = document.createElement('div'); particleSpark.classList.add('spark'); document.body.appendChild(particleSpark); spawn(particleSpark); } } body { background-color: #13001C; } html, body { height: 100%; overflow: hidden; } .spark { background-color: #DE4A00; font-family: 'Helvetica', sans-serif; visibility: hidden; position: absolute; width: 4px; height: 4px; border-radius: 30%; box-shadow: 0 0 5px #AB000B; } <!DOCTYPE html> <head> <link rel="stylesheet" type="text/css" href="style.css"> </head> <body> <script src="scripts/main.js"></script> <script type="text/javascript" src="scripts/sparks.js"></script> </body>
094cb1860828a3f6058a582417e84ccc2a1ec31df0f88c7ed8e3492272f1100b
['e105a066f7f541758a03602471b07c0a']
you are not specifying any where criteria for your specific item...so you are getting all results..try specifying criteria for the item (id , name etc) you are looking for. And keep in mind cross partition queries consume much more RUs n time, you can revisit architecture of your data model..Ideally always do queries with in same partition
f88ef79cc83915445026a749e44f4899f5d05859d11e1afa500c750111be44c3
['e105a066f7f541758a03602471b07c0a']
I use Azure Service Bus Queue to receive message and start a long running activity which can last from couple of minutes to couple of hours. During the activity a separate thread renews lock each 30 secs until activity is complete. On BrokeredMessage.RenewLock(), exception occurred, full trace below: "Microsoft.ServiceBus.Messaging.SessionLockLostException" (This happened for the first time) Here is the code that renews lock Timer resetToken = new System.Threading.Timer (e => RenewLockQueueJobMessage (), null, TimeSpan.Zero, TimeSpan.FromSeconds (30)); private void RenewLockQueueJobMessage () { brokeredMessage.RenewLock (); } Configuration of Queue: QueueDescription queueDescription = new QueueDescription (queueName); queueDescription.EnablePartitioning = true; queueDescription.RequiresSession = true; queueDescription.RequiresDuplicateDetection = true; queueDescription.EnableDeadLetteringOnMessageExpiration = true; queueDescription.DefaultMessageTimeToLive = TimeSpan.MaxValue; queueDescription.LockDuration = TimeSpan.FromMinutes (1); var manager = NamespaceManager.CreateFromConnectionString (connectionString); manager.CreateQueue (queueDescription); Exception Trace: Microsoft.ServiceBus.Messaging.SessionLockLostException: Channel:uuid:;Link: TrackingId:, SystemTracker:net.tcp:, ---> System.ServiceModel.FaultException`1[System.ServiceModel.ExceptionDetail]: at Microsoft.ServiceBus.Messaging.Sbmp.DuplexRequestBindingElement.DuplexRequestSessionChannel.ThrowIfFaultMessage(Message wcfMessage) at Microsoft.ServiceBus.Messaging.Sbmp.DuplexRequestBindingElement.DuplexRequestSessionChannel.HandleMessageReceived(IAsyncResult result) --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at Microsoft.ServiceBus.Common.AsyncResult.End[TAsyncResult](IAsyncResult result) at Microsoft.ServiceBus.Messaging.Sbmp.DuplexRequestBindingElement.DuplexRequestSessionChannel.EndRequest(IAsyncResult result) at Microsoft.ServiceBus.Messaging.Channels.ReconnectBindingElement.ReconnectChannelFactory`1.RequestSessionChannel.RequestAsyncResult.<>c.<GetAsyncSteps>b__9_3(RequestAsyncResult thisPtr, IAsyncResult r) at Microsoft.ServiceBus.Messaging.IteratorAsyncResult`1.StepCallback(IAsyncResult result) --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at Microsoft.ServiceBus.Common.AsyncResult.End[TAsyncResult](IAsyncResult result) at Microsoft.ServiceBus.Messaging.Channels.ReconnectBindingElement.ReconnectChannelFactory`1.RequestSessionChannel.EndRequest(IAsyncResult result) at Microsoft.ServiceBus.Messaging.Sbmp.RedirectBindingElement.RedirectContainerChannelFactory`1.RedirectContainerSessionChannel.RequestAsyncResult.<>c__DisplayClass8_1.<GetAsyncSteps>b__4(RequestAsyncResult thisPtr, IAsyncResult r) at Microsoft.ServiceBus.Messaging.IteratorAsyncResult`1.StepCallback(IAsyncResult result) --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at Microsoft.ServiceBus.Common.AsyncResult.End[TAsyncResult](IAsyncResult result) at Microsoft.ServiceBus.Messaging.Sbmp.RedirectBindingElement.RedirectContainerChannelFactory`1.RedirectContainerSessionChannel.EndRequest(IAsyncResult result) at Microsoft.ServiceBus.Messaging.Channels.ReconnectBindingElement.ReconnectChannelFactory`1.RequestSessionChannel.RequestAsyncResult.<>c.<GetAsyncSteps>b__9_3(RequestAsyncResult thisPtr, IAsyncResult r) at Microsoft.ServiceBus.Messaging.IteratorAsyncResult`1.StepCallback(IAsyncResult result) --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at Microsoft.ServiceBus.Common.AsyncResult.End[TAsyncResult](IAsyncResult result) at Microsoft.ServiceBus.Messaging.Channels.ReconnectBindingElement.ReconnectChannelFactory`1.RequestSessionChannel.EndRequest(IAsyncResult result) at Microsoft.ServiceBus.Messaging.Sbmp.SbmpMessageReceiver.RenewLockAsyncResult.<>c.<GetAsyncSteps>b__10_1(RenewLockAsyncResult thisPtr, IAsyncResult a) at Microsoft.ServiceBus.Messaging.IteratorAsyncResult`1.StepCallback(IAsyncResult result) --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at Microsoft.ServiceBus.Common.AsyncResult.End[TAsyncResult](IAsyncResult result) at Microsoft.ServiceBus.Messaging.Sbmp.SbmpMessageReceiver.OnEndRenewMessageLocks(IAsyncResult result) --- End of inner exception stack trace --- at Microsoft.ServiceBus.Common.ExceptionExtensions.ThrowException(Exception exception) at Microsoft.ServiceBus.Common.AsyncResult.End[TAsyncResult](IAsyncResult result) at Microsoft.ServiceBus.Messaging.ReceiveContext.EndRenewLock(IAsyncResult result) at Microsoft.ServiceBus.Messaging.ReceiveContext.EndRenewLock(IAsyncResult result)
6a2da0e864d26ecea36f0235abd2c97881b202eff99af9680caca3ac4b69f934
['e11b3bbad56b4e858e36268b60cea252']
I have a snackbar handler in Main that I want to pass down to each Route component as a prop. How can I achieve this ? <Router history={browserHistory}> <Main history={browserHistory}> <Switch> <Route path="/comp1" component={comp1} /> <Route path="/comp2" component={comp2} /> <Route path="/comp3" component={comp3} /> <Route path="/comp4" component={comp4} /> </Switch> </Main> </Router>
eea462a9dc3b7777bdf89d3e6862785346000eb7d11bff194482919fefbcd2ea
['e11b3bbad56b4e858e36268b60cea252']
It seems that you want distinct non-numeric values. You may change data_len as len(data_r) if you want the longest non-numeric records ALTER TABLE <yourtable> ADD data_r as REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE (data, '0', ''),'1', ''),'2', ''),'3', ''),'4', ''),'5', ''),'6', ''),'7', ''),'8', ''),'9', '') ,data_len as len(data) SELECT * FROM <yourtable> t WHERE EXISTS ( SELECT MAX(data_len), data_r FROM <yourtable> t1 WHERE t.data_r = t1.data_r AND t.data_len = t1.data_len GROUP BY data_r )
d1bcb434a2b2c2cac9e640843854968ad7d06897237e596d8cdc2b369f02a75e
['e11f15d29271476396b7f514fd5503b8']
You might want to iterate over the json: var arr = [ {"id":"10", "class": "child-of-9"}, {"id":"11", "classd": "child-of-10"}]; for (var i = 0; i < arr.length; i++){ var obj = arr[i]; for (var key in obj){ var attrName = key; var attrValue = obj[key]; console.log(attrName + " " + attrValue) } } This will produce the following output: "id 10" "class child-of-9" "id 11" "classd child-of-10" This might help: https://stackoverflow.com/a/1112609/3504189
f1ef0aa7ce47aa788345bea25372fd243e6a5248512eeb97d5a3cbc25c51f6f2
['e11f15d29271476396b7f514fd5503b8']
Since sorting is only possible for the timestamp and tags, you might think about using a tag instead of a field for value2. But beware that this is only reasonable if the content of the newly created tag is not too variable. Otherwise you might kill influxDB with too many timeseries. Details to be found here: https://docs.influxdata.com/influxdb/v1.7/concepts/schema_and_data_layout/ A different option could be to SELECT all data and to sort "manually" – in your code. But if that is reasonable depends on the usecase and the amount of data you get.
712a7e7ed3b6525ae1488bf1c9b2476fd661c980add743e6d31099ad1361602b
['e122455960f44afea0109f1e029e1892']
I need to design a truck fleet monitoring system and make a prototype of it during my traineeship this year. I've been looking into the different buse networks that are already implemented in trucks nowadays notably the famous OBD II. I wonder if it is possible, if I want to add new sensors to the trucks, to implement them within the already existing buses (CAN or other)? otherwise what is the best way to communicate both with the OBD system in the truck and the multiple sensors I might add to the truck? Finally can I make my own CAN buse system in the truck in addition to the one already in it? I'll appreciate your help.
65c8301e2313f7bc63b3a37214bccac04d203321765e884ca931bf88b464f734
['e122455960f44afea0109f1e029e1892']
I could suggest ultrasonic welding boots! About Ultrasonic welding This welding technique has a minimal damage on the surfaces, and can weld together or eventually release all type of materials If the damage is still an issue and as it is science fiction, you could even make it so the welding happen at the atomic level and therefore display no damages. In reality a surface would be never flat enough and always contains impurity to allow such atomic level welding, this is why I add it as side note. (It can also bring a topic for an event in your story)
0b5b908633f77de66a4c83a7f55272d1088e0ba301c23e318dff109f6556356a
['e1301b887bca416d8ebd5ab40e6a2fe4']
everyone I am currently having some problems with shutting down my Lubuntu 17.10, it hangs on the logo screen, but is able to reboot normally. I have already tried a few tricks, but none of them seem to work. I have edited the grub file, excluding the 'quiet' and 'splash', and also edited the blacklist.conf file and also tried the shutdown command. During the shutting down process, however, I realized that it hangs on --[ end Kernel panic - not syncig: Attempted to kill init! exitcode=0x00000000 I have searched, but do not know what to do to solve this problem. A little help would be very much appreciated. Thanks
fb4922bb4501a108de999cd7c7abe59d0709894c3fd12c67f4f9670785002261
['e1301b887bca416d8ebd5ab40e6a2fe4']
Let's say a student takes a set of tests, each with different difficulties of multiple choice questions and a different amount of questions. If I take the percentage of each test, how can I compare them? E.g. Can I say based on the difference of percentages between "test A" and "test B", the student did a "difference of percentage" better on "test a"? When comparing the different percentages, what level of measurement would it be? Ordinal, interval, or rational?
c963a1b36e8e62db4a44895502a6df984fa4a0701b5edc72998ca4129b889ea8
['e133104e5fe44e0696c4d7954fd4f107']
Use JavaScript/jQuery for form validation. All you need to do is add an id to form, and in the corresponding Javascript, do something like document.getElementById("#form").onsubmit = checkForm(); or using jQuery $("#form").submit(checkForm); where checkForm() returns true upon successful validation, and false otherwise. (Note that, if you do not return false, form submission will continue as usual.) Which fields you check for/validate can also change by using Django's templates.
1d679a78aede5bbece4823bf26ec45a907e69ba67f6d5a746035e6c1e71da136
['e133104e5fe44e0696c4d7954fd4f107']
Unless you're willing to get down to the nitty-gritty and configure, run, and host your own Apache Server (or another server config) AND register a domain name, you CANNOT change the domain name from within Python/Django. Django only handles everything that comes after the domain name, such as the /home/ portion of the URL http://www.mysite.com/home/. If you're up to it, the Django book has a pretty good section on deploying Django and setting up the server to run it, but it doesn't cover all the bases.
6dc1d959e791dde8e58a777b9cf30b710379418545a90c98114f9a00ae2b67fa
['e137a9011e1d4512839610fe4eb05287']
One of my static pages(generated by <PERSON>) is loading slow on mobile mode, but the exact same page was fine on desktop mode. (google page load speed desktop score 97, but failed Core Web Vitals on mobile) On the chrome-devtools desktop mode, the stalled time was only 2.6 ms, but on mobile mode was 458.74ms. There was no initial and SSL connection time on desktop mode, mobile mode 458.61ms initial time, 233.98ms SSL. Any idea how to fix it? My server is CentOS 7 64GB RAM, Apache 2.4 event module, 1GB Memcached, mod_pagespeed, + tmpfs. <IfModule mpm_event_module> StartServers 30 MinSpareThreads 100 MaxSpareThreads 400 ThreadsPerChild 64 MaxRequestWorkers 256 MaxConnectionsPerChild 0 </IfModule>
eaf676b130b6560a2a501f27876d251532745722fde64632ca3d110339ec264c
['e137a9011e1d4512839610fe4eb05287']
I am new to Solr. I tried to do Atomic update, the .json update file not only changing field values, but field name also has become "fieldname.set", for instance, "price" become "price.set". Any help will be appreciated. # /usr/local/solr/bin/solr version 8.5.1 # curl http://localhost:8983/solr/books/select?q=id%3A0371558727 "response":{"numFound":1,"start":0,"docs":[ { "id":"<PHONE_NUMBER>", "price":19.0, "_version_":1667214802265571328}] } # cat test.json [ {"id":"<PHONE_NUMBER>", "price":{"set":19.95} } ] # /usr/local/solr/bin/post -p 8983 -c books test.json # curl http://localhost:8983/solr/books/select?q=id%3A0371558727 "response":{"numFound":1,"start":0,"docs":[ { "id":"<PHONE_NUMBER>", "price.set":[19.95], "_version_":1667214933776924672}] }
904479f2d74f85e8b54267d4eef94c7c62983806d8294ea9a30d1a3389a27b4d
['e144680009ff4ba49cfd86f10ac9dd3d']
I have two hiveserver2 instances running. One uses Binary Transport (for HUE), the other uses HTTP transport (for ODBC connections). I am trying to grant access for one user (ra01 in the screenshot) to only a specific table in Hive. The user account is intended to be used for ODBC connection from PowerBI. I set the policy as seen in the screenshot. The policy seems to work if I try it in HUE but if I use the same user via ODBC, it seems to grant all permissions and it is using "Hadoop-ACL" instead of "Ranger-ACL" as seen in the attached screenshot. What am I missing?
118779e86b6187a37ffcec7583de5b4f30a5aaf74e0a834af6c4f7f7fe288fe8
['e144680009ff4ba49cfd86f10ac9dd3d']
I am trying to POST a JSON file (using Apache NiFi) onto an app that only accepts values with max 10 decimal places. JSON format: { "timestamp" : "2016-04-17", "zoom" : 13, "dc" : 100, "CloudCoverPercentage" : 74.707, "mean" : 0.18735192480231655, "num" : 127, "FirstQuartile" : 0.142807444773004, "median" : 0.17882054533925174, "max" : 0.32004310344827586, "min" : 0.059890294413970674, "ThirdQuartile" : 0.22603810187853218, "StandardDeviation" : 0.06846369990524923 } Question: How do I transform each decimal value in Apache Nifi, so it would only have 10 decimal places? I read somewhere that JoltTransformJSON can be used for this. How do I write the Jolt Spec for this kind of operation?
b7eaa3a5e0ec3dbc1403cb840594c84a6007ab27aa026ce5fd912a68091e5136
['e1613a029d8f423dbafdc96afeee3273']
I updated from 18.04 to 20.04 a couple of weeks ago. With 18.04 the mean temperature was between 28 and 40° in light usage (YouTube, browsing etc.), now with 20.04 is always over 40°, also while in idle. I tried updating the Kernel from 5.4 to 5.6.10 and now 5.6.14, but nothing. I have an MSI Prestige 15, with an i7-10750U.
b9295eb8d46a9126566038361e7e296b7c3cda44360b1da1d0ce7a9eca3d00f9
['e1613a029d8f423dbafdc96afeee3273']
Try to run pip via desired python binary as a module -m pip: python3 -m pip install --user --ignore-installed pywinrm Then test it: test if python can find winrm module: import winrm s = winrm.Session('windows:5985', auth=('user', 'password')) r = s.run_cmd('ipconfig', ['/all']) print(r.status_code) print(r.std_out.splitlines(True)) test if your Ansible has access to winrm module and your target: ansible windows -i inventory.ini -m win_ping
72bb97457ed1a995ed73113a056ebd2233baa773ee3a52628bab3063fdecaec7
['e16982d05a354ecbaba042ef00c055ec']
I need to do a mass insert into my database. I have French characters(e.g é) into my table When i connect to SQLPlus and run the query manually INSERT INTO TEST VALUES ('é'); Data is inserted properly. When i save the same query in an Sql file and execute same through SQLplus I get below error: SQLPLUS>@test.sql; ERROR: ORA-01756: quoted string not properly terminated Can anyone guide me. thanks
40777757ab45b8726496413df40396e00ba45cc0788e3e0d9b53106694a90ddb
['e16982d05a354ecbaba042ef00c055ec']
I need some help in regards to a batch scripting. The purpose of the script is to open a web page when the user login into windows. The web page is hosted into our local servers. My issue is that the page still open(Obviously it does not display anything) even though the user is not connected to the network. Unfortunately Ping is restricted. I am trying to either check if the webpage is accessible or if the user is connected to the network in order to launch the page. Any ideas? thanks & regards
9c0ea986d65b09e52d6b8f02cc40e6ca08fd9dd31bc137b83a3501e4ce387910
['e169a4cc26d947ab87b8cbfed258b6ef']
I have created one structure which is followed by web content. Structure Contains 2 fields. One is Area name and the second is Zip Code. I stored data in web content followed by this structure. I want to search for data based on zip code or area name entered by the user. I want to provide a dropdown to the user to select criteria to search like by Zipcode / by Area name. The problem is web content data is stored in XML format. So whenever a user searches for a keyword it will return all results which contain given text. I want to restrict that. I am using this method for search data. List<JournalArticle> results = JournalArticleLocalServiceUtil.search( themeDisplay.getCompanyId(), //company id themeDisplay.getScopeGroupId(), // group id null, //folderIds Log list 0, //classname null, //version null,//title null, //description searchkeyword, // here put your keywords to search new Date(), // startDate new Date(), // endDate 0, //status null, //review Date QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
9a37092fb76c14aaf06d6166f5f7db3bc8b8d57986c6bf7ee069382fb25b5157
['e169a4cc26d947ab87b8cbfed258b6ef']
As of now, instagram APIs are changed. You need to get media id as described here https://developers.facebook.com/docs/instagram-api/reference/user/media#get-media and after of that you need to call API for each media post and get image and other post details. Here you can restrict your API calls.
56a6729e1e645be2719d17ca3afdc46f4c604fe0df0ba19808e2fde7bdc33987
['e16e9ef720cc4326b3aab42a31a78725']
As stated at Google Maps Android API v2 Documentation: Note: The info window that is drawn is not a live view. The view is rendered as an image (using View.draw(Canvas)) at the time it is returned. This means that any subsequent changes to the view will not be reflected by the info window on the map. To update the info window later (e.g., after an image has loaded), call showInfoWindow(). Furthermore, the info window will not respect any of the interactivity typical for a normal view such as touch or gesture events. However you can listen to a generic click event on the whole info window as described in the section below. Perhaps you should try to call showInfoWindow() somewhere again in your code.
c1d580bd084c360aefc2979d31195584bc8b19933e063f6ea457d3855a04f1ee
['e16e9ef720cc4326b3aab42a31a78725']
There are a couple things you can try: You might want to try drawing a 9patch in top of your image. There's also this short tuto by <PERSON> : http://www.curious-creature.org/2012/12/11/android-recipe-1-image-with-rounded-corners/ BitmapShader shader; shader = new BitmapShader(bitmap, Shader.TileMode.CLAMP, Shader.TileMode.CLAMP); Paint paint = new Paint(); paint.setAntiAlias(true); paint.setShader(shader); RectF rect = new RectF(0.0f, 0.0f, width, height); // rect contains the bounds of the shape // radius is the radius in pixels of the rounded corners // paint contains the shader that will texture the shape canvas.drawRoundRect(rect, radius, radius, paint); Instead of using drawRoundRect() method of canvas, you may try using drawPath() to get the desired shape. Hope this puts you on the right direction.
68062329c00cde96b780584fab7a0f0eb9d4274f0eeb98275e686a6603e88f06
['e1746355b7c1493495fc9227a5878460']
I have screengrabbed the relevant code here if it helps: https://imgur.com/a/5kGZwxW Once again I truly appreciate your efforts here <PERSON>. I need to get this resolved soon. The Ajax based search is superb in BuddyBoss, however it must be revealing data to non-logged in members, hence the need to remove it.
307058ca008541ea1547bff83e012016733afe07df4c62b07b21785299a15c5a
['e1746355b7c1493495fc9227a5878460']
Hi <PERSON>. Thanks for your response. Makes Sense. I do not have code but can supply what is needed. I am indeed using the child theme for BuddyBoss. I would rather not just hide the search button with CSS, but remove it from a few pages, most importantly home. I have 2 headers, one is the buddy boss native header, the other an implentation of it based on their Elementor Header templates. Simple: My ideal scenario is to choose header based on logged in or logged out. This would solve everything as I am granting a few "inner" pages to non-logged in (w/ no search)
ef6b4ac2603213e1c090ea35ed896b505371f1545b4c89c8cde0c049db8dda60
['e18e4f414b4d477d831d94453d04f604']
It seems you have trailing whitespace enabled in User Preferences too. I'd suggest opening your configuration file of VSCode using CtrlShiftP or CmdShiftP in Mac and then go to Open User Settings. I'm sure the next line is around there somewhere, delete it or change it to false. files.trimTrailingWhitespace": true
d5e9e52439718a2a6cc8a984efb8086be38e50c49ef76a7d631209731aff70fd
['e18e4f414b4d477d831d94453d04f604']
I don't really understand what you are trying to achieve using a submit button, if it's not mandatory I'd use an <a>. With pure HTML5 using the download attribute <a href="test.txt" download>Money Dispenser</a> Or with Javascript if you have to use a <button> This has already been covered grealy in this question But the gist of it is, create a function to download files as shown on that thread and add it to your <button> <button onclick="donwloaURI('data:text/plain,Test', 'Test.txt')">Money Dispenser</button>
a4834914996c5d24fd056c52c52ec2d2dd8763fb0dfc15df66a5708a401e3980
['e18edca17b1046eea446403f0c52c25b']
I have a trouble when using %C in ConversionPattern with AsyncAppender. My Lo4J configuration is: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"> <appender name="console" class="org.apache.log4j.ConsoleAppender"> <layout class="org.apache.log4j.PatternLayout"> <param name="ConversionPattern" value="%d{yyyy/MM/dd HH:mm:ss,SSS} %C{1} - %m%n" /> </layout> </appender> <appender name="async_console" class="org.apache.log4j.AsyncAppender"> <param name="BufferSize" value="1000" /> <appender-ref ref="console" /> </appender> <root> <level value="debug" /> <!-- <appender-ref ref="console" /> --> <appender-ref ref="async_console" /> </root> </log4j:configuration> And my test code is: @Test public void testAsync() { DOMConfigurator .configure("src/test/resources/learningtest/log4j/log4j_test_async.xml"); Logger log = Logger.getLogger(getClass()); log.debug("Hello, world!"); try { Thread.sleep(1000); } catch (InterruptedException e) { e.printStackTrace(); } } The result of the test code is: 2012/03/15 11:51:22,570 ? - Hello, world! Without AsynAppender, it works fine: 2012/03/15 11:51:06,002 Log4jTest - Hello, world! With %c (category), it works fine, too. What am I missing? Please let me know. Thanks in advance :-) Reference: http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/PatternLayout.html
72953f7de2d473aa0bd11bb6fc9724079b680d9d51a6953079bcc709f728e0ac
['e18edca17b1046eea446403f0c52c25b']
InfluxMeterRegistry is a StepMeterRegistry, so the created Counter from it is a StepCounter. StepCounter.increment() increments the count in the current step but StepCounter.count() will return the count in the previous step. That's why you're seeing 0 with count() although you've already invoked increment() several times. You can see it in the next step and the default step is 1 minute, so you have to wait for 1 minute to see it. See the following test to get an idea on how it works: https://github.com/izeye/sample-micrometer-spring-boot/blob/influx/src/test/java/com/izeye/sample/InfluxMeterRegistryTests.java
e0aedb3bab6680ca2c50fb3e2aa0916ab28ba72ae0596d4b7dfe29f3327161e6
['e18f2baa59a8459f9deed44be0e83a49']
Broadcast receivers have nothing to do with the life cycle of your application, Android reads your Application's Manifest and sends the Broadcasts to respective app expecting the particular action. If you wish to stop receiving broadcasts when App is not active then you need to unregister your broadcast in onDestroy of your Activity/Service unregisterReceiver(BroadcastReceiver receiver)
4456cbc10c3a528c49e49d4d4b7b522676a23c16e6d0fc95c4ff921f3e726c8c
['e18f2baa59a8459f9deed44be0e83a49']
Scheduling a job must have these basic functionalities Scheduling Job Unscheduling/Deleting scheduled job Processing based on priority (Will be useful in long-term), Maybe you can prioritize based on the categories you have. Explore redis here as it has amazing capabilities to save ordered set I would suggest keeping the job queueing service and job processing service (i.e workers) different as this will enable your application to work as an black box
eec2ef40c630d22c66778533c4b534510f5881200230bd14ef9d6744816b63ea
['e192e254bfe04c7bbeb3d83d9bfedd03']
Maybe. Test your application in your test environment, same as production but distinct and upgraded first. Now would be a good time to create such an environment if it does not exist yet. A newer Python, or keeping the same Python, has never been easier to test with lightweight virtualenvs and/or containers. Also test how you will upgrade and manage the host OS, whether VM or bare metal.
7cd676a775400128b5c6c8b03308019f78c95966583f5f394f0e6e72975453cb
['e192e254bfe04c7bbeb3d83d9bfedd03']
Do both to a test host and see what happens. As IP packets are higher level than either of them, your connectivity may be impacted. Unless your host has interface level redundancy. Administratively down is a thing for interfaces, including Linux. From https://www.kernel.org/doc/Documentation/networking/operstates.txt Linux distinguishes between administrative and operational state of an interface. Administrative state is the result of "ip link set dev up or down" and reflects whether the administrator wants to use the device for traffic. However, an interface is not usable just because the admin enabled it - ethernet requires to be plugged into the switch and, depending on a site's networking policy and configuration, an 802.1X authentication to be performed before user data can be transferred. Operational state shows the ability of an interface to transmit this user data. Also, stop using ifconfig on Linux, it has been obsolete for almost two decades. As the documentation implies, ip command (iproute package) is what to use, it also has commands for the link level.
11d610204ce88cebeab08209d3b06e298f35070db954f6db8fa1452f0bd2d6b2
['e195ccc075224d9ca7675c61b34afa0c']
I'm a newbie to Graphics.I'm drawing a rectangle which will change its color after one second. - (void)drawRect:(CGRect)rect { [self setWidthHeightOfRectangle]; [self changeColorOfNumbers]; CGContextRef ctx = UIGraphicsGetCurrentContext(); CGContextClearRect(ctx, rect); // Draw a solid square CGContextSetRGBFillColor(ctx, 255, 255, 255, 1); CGContextFillRect(ctx, CGRectMake(0.0, 24.0, 380.0, 2.0)); CGContextSetRGBFillColor(ctx, redNumber, greenNumber, blueNumber, 1); CGContextFillRect(ctx, frameToDraw); } I'm changing the color of the rectangle using the changeColorOfNumbers method. Here is the method - (void)changeColorOfNumbers { iHit++; if (iHit==100) { redNumber=249; greenNumber=252; blueNumber=0; } else if (iHit==200) { redNumber=0; greenNumber=168; blueNumber=245; } else if (iHit==300) { redNumber=255; greenNumber=0; blueNumber=140; } else if (iHit==400) { redNumber=255; greenNumber=125; blueNumber=0; } else if (iHit==500) { redNumber=0; greenNumber=176; blueNumber=72; } else if (iHit==600) { redNumber=128; greenNumber=0; blueNumber=148; } else if (iHit==700) { redNumber=8; greenNumber=79; blueNumber=168; } else if (iHit==800) { redNumber=127; greenNumber=212; blueNumber=20; } else if (iHit==900) { redNumber=255; greenNumber=0; blueNumber=0; } else if (iHit==1) { redNumber=0; greenNumber=0; blueNumber=0; frameToDraw=CGRectMake(0.0, 0.0, 0.0, 50.0); } else if (iHit==2) { redNumber=255; greenNumber=255; blueNumber=255; } } Problem is that some of the RGB colors that I'm applying aren't showing up. What am I doing wrong here?..... Thanks...
2feb0d3b20411867e4c18aacd509b87c81a09c55eb918fcac2fe950b8f8b31ba
['e195ccc075224d9ca7675c61b34afa0c']
Let's put it this way, First we create a UIImageView to the size of the circle you want.Let's say you want this image to be a circular image, http://united4iran.org/wp-content/uploads/2010/11/cell-phone-in-canada.jpg Then you create another UIImageView one top of the previous one to the size of 320x480 and set this image to it (Assume this image size is 320x480), Note: also remember that inner area of the circle in above image is transparent. Then you should get a image like this, http://img580.imageshack.us/img580/782/testjkn.png Hope this will help you.
7d36c0813817c1cf5d2d7f4b6d1a3d3b4bec2539a1e980f2f1bc7ba9e7e81f88
['e1aacaf28e7744afa0a260d3c9671aca']
I have a table like this +----------------+---------------------+--------------+--------+ | student_serial | reg_date | batch_serial | status | +----------------+---------------------+--------------+--------+ | 1 | 2019-10-31 10:25:17 | 1 | C | | 2 | 2019-10-31 10:32:45 | 3 | A | | 3 | 2019-11-04 10:57:51 | 1 | A | +----------------+---------------------+--------------+--------+ And I want the o/p as batch_serial count_a count_c 1 1 1 3 1 0 i.e. the o/p must group by the values of status column, and display it as separate column
0f8cf1e7eb525eb39b096d0dcfbe14c50e8ce2f2c8d54102dada11631f765b64
['e1aacaf28e7744afa0a260d3c9671aca']
We have a situation where procedures with DML operations are often run by different users at different point in time, and I need to shutdown my database for recovery purpose. So, I want to know what happens to the PL/SQL blocks (procedures with DML operations in this case) if shutdown immediate or shutdown transactional command is issued In case of normal SQL command shutdown immediate will just rollback the DML operations and Shutdown transactional will wait for the transaction to complete, but what with PL/SQL blocks. I have searched by not found answer to this question, every where reference to SQL command is only given.
8193aa285020390919980eb0105958dcfaf04c1af7bc59a570fd104141615a15
['e1abc14a5f8249f3af1cb520cbf13f8c']
For what I can understand one can build Logic Apps with Terraform. However, the docs are still not very good, and it looks like this feature is pretty new. What are the limitations when it comes to TF and Azure Logic Apps? Are there any? I want to build a two apps, one that is triggered every month and another that is triggered by a https request. I want these then to run two python scripts, and I want the later one to return the result from this script to the client that called the https. Is this possible to automate in Terraform? At this moment, there are very little examples and documentation on this. Any comment or tip is helpful and greeted with open arms!
77674456b066bbbd4e964126ceab0881fbebd7ead01849588f496d5177124cca
['e1abc14a5f8249f3af1cb520cbf13f8c']
I'm trying to use this Azure Function App python library, and following the small Hello World tutorial in the readme. The push to Docker hub works fine, the function is created and appears in Portal, and I can access the main URL in my browser (Your Functions 2.0 app is up and running). Everything seems fine until I try to call the API with the http: http://funcmandag.azurewebsites.net/api/HttpTriggerJS1?name=NorwegianClassic It returns http error code 500. This also happens locally. In Portal the function blade of the Function app in Function Apps says: Read-Only. What does this mean? Has anyone a suggestion? How can I debug this?
7bd7c4477d96175655e6672f839646302ee42f1c241aaf4be8ee85c2a3fa5293
['e1d9aeb4bb0247bca9786967a761d28f']
Ok, I found a solution. Tomcat as service runs as system user, therefore we need to add certificate to that user's folder. Initially, as home user I have accepted to permanently trust my svn certificate Then just copy matching file from C:\Users\[username]\Application Data\Subversion\auth\svn.ssl.server to C:\Windows\System32\config\systemprofile\AppData\Roaming\Subversion\auth\svn.ssl.server
ed68998ccccb2ee05570afb1ec5542a866ea394fbe258dd6b3a7dba490ebe4c9
['e1d9aeb4bb0247bca9786967a761d28f']
I do have a problem with configuring svn to work with OpenGrok (on Tomcat85) on Windows 10 as I need the svn https certificate to be added to trusted ones. According to http://www.microhowto.info/howto/configure_subversion_to_trust_a_given_ssl_certificate.html and https://github.com/oracle/opengrok/issues/846 it seems that i need to add certificate to some config file but it needs to be added to Tomcat85 service user. How to get it to work?
a8c99effe56a4353abc0d56a94509d079388ae207e3cb99ecd28e15da57f0e5f
['e1dcc9465be94e2ab005290d28576c0b']
I am using the Python library smtplib to send Email messages with Office365 as the SMTP server. Everything was fine until a few days ago when my From: header seemed to not be processed. The Python code I am using: import smtplib from email.mime.text import MIMEText def login(): server = smtplib.SMTP(mail.mail_server, mail.mail_port) server.starttls() server.login(mail.mail_username, mail.mail_password) return server def send(subject, body): msg = MIMEText(body) msg["From"] = mail.mail_from msg["To"] = ", ".join(mail.mail_to) msg["Subject"] = subject server = login() server.sendmail(mail.mail_username, mail.mail_to, msg.as_string()) server.quit() send("test", "test") What is strange is that if I log onto Outlook or OWA, I can see my header if I view the sent message details. I sent a test header of From: xxxx <info@...> However on the recipients inbox message, the header is simply the Office365 User's name and the info address as shown above (From: Name <info@...>). The xxxx custom header is gone. What can be causing my header to be dropped?
6ccf67864a2c75a12ba1212813d3ac860e9fc30a1e3e68f8cb82a7b7f76c4cd4
['e1dcc9465be94e2ab005290d28576c0b']
If I have a list as follows: [ { "a": "1", "b": "2" }, { "a": "3", "b": "4" }, { "a": "5", "b": "6" } ] How can I rename the keys of the first list and append static items to each dict using a Jijja2 filter? For example: [ { "a2": "1", "b2": "2", "c2": "test" }, { "a2": "3", "b2": "4", "c2": "test" }, { "a2": "5", "b2": "6" "c2": "test" } ] I have attempted something like the following: {{ my_list | map('json_query', '{a2:a, b2:b}') | list }} Which is half the battle, but how would I append a static item to the resulting dict?
f57b52ee5061fe8f724425d47c5f5cb196b6e042c41253361a18af7475f1d89f
['e1e09d80df3741729a0cb503d45fd042']
They are sort of free. As you already know, the pricing documentation only mentions charges for Simultaneous connections GB stored GB downloaded However, if you refer to the Understanding Realtime Database Billing, you can see that writes contribute to billing through connections and writing data using the Firebase Console. It is different from Cloud Firestore in the sense that a single write does not generate billing charges, but writing can lead to them through other ways.
ae255948a26fe13b2f249d6083a79297166c6fc28dd84240e9cc441982c196d2
['e1e09d80df3741729a0cb503d45fd042']
According to the predefined variables documentation for Realtime Database, the auth variable contains the token payload if a client is authenticated, or null if the client isn't; the token itself, contains an email key. This means that you need to add the email key to the token variable in the simulator. Try writing this in the Auth token payload section: { "token":{ "email": "<EMAIL_ADDRESS>" } }
7aeeab426bd6449c86c0db21051718deda751d1b860ff71c8da9d94fe8365fff
['e1f622d0ad0841368a459652f4ed092b']
Trying write javascript that prints "username=john01" and "password=password123" from the url below. Currently it prints nothing... index.html?username=john01&password=password123&lt=_c1F9F2B16-96B3-9D7B-CC19-D22A43D4FCA1_kA54D6D0E-881B-2792-22D3-B857150B1EFC&_eventId=submit&submit=Sign+In <html> <body> <p> This code is for educational purposes only, and is not to be used with malicious intent. </p> <script> string = window.location.search; content = string.split(""); usernameStart = 1; usernameEnd = content.indexOf("&",0); username = content.substring(usernameStart,usernameEnd)); document.write("Your username is " + username); </script> </body> </html>
35311f77bf530b12a6d6fd2e1a0a22ecaa04c35375e2f26deb6701b78c045953
['e1f622d0ad0841368a459652f4ed092b']
I am having trouble layering the images circle and line with the actual text. My goal is to have all of the elements lined up in the center of the page. Should I use a table to float? What the best method? Currently looks like this Goal HTML <div id="two"> <img src="line.png" id="line"> <img src="circle.png" id="circle"> <ul> <li> Photography </li> <li> Computer Shortcut </li> <li> Skiiing </li> <li> Podcasts </li> <li> Road Biking </li> <li> Quality </li> </ul> </div> CSS #two{ background-color: #D6E6F4; width: 100%; height: auto; display: -webkit-flex; display: flex; } #circle{ position: relative; top: 0px; width: 20px; height: 20px; justify-content: center; } #line{ position: relative; top:5px; } #two ul{ text-align: center; justify-content: center; list-style-type: none; } #two li{ font-family: AvenirNext-Regular; font-size: 32px; color: #FFFFFF; line-height: 26px; background: #B55252; border-radius: 8px; text-align: center; justify-content: center; padding: 15px; }
08ac297db7a97b91f127ef4a9323175977da3c08ccbc2e2339ff01721e90690e
['e21b4179844048e4869c9ac16974b509']
After sorting out my code I keep getting a null on my second screen when i hit the submit button having trouble spotting my mistake any help would be appreciated. first class import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.view.Menu; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; import android.widget.Spinner; public class IwiSelect extends Activity { Spinner spinner1, spinner2, spinner3, spinner4, spinner5; Button btnSubmit; String iwi1; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_iwiselect); addListenerOnButton(); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.activity_iwi_select, menu); return true; } // get the selected drop down list value public void addListenerOnButton() { spinner1 = (Spinner) findViewById(R.id.spinner1); spinner2 = (Spinner) findViewById(R.id.spinner2); spinner3 = (Spinner) findViewById(R.id.spinner3); spinner4 = (Spinner) findViewById(R.id.spinner4); spinner5 = (Spinner) findViewById(R.id.spinner5); btnSubmit = (Button) findViewById(R.id.btnSubmit); btnSubmit.setOnClickListener(new OnClickListener() { public void onClick(View view) { String text = spinner1.getSelectedItem().toString(); //Starting a new Intent Intent intent = new Intent(); intent.putExtra("spinnerText", text); Intent nextScreen = new Intent(IwiSelect.this, SecondScreenActivity.class); //Sending data to another Activity nextScreen.putExtra("USERNAME", iwi1); //nextScreen.putExtra(spinner2.getContext().toString(), false); // starting new activity startActivity(nextScreen); } }); } } this first class the user selects from a spinner (will have 5 spinners in total) second class public class SecondScreenActivity extends Activity { TextView FirstIwi; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.selected_iwi); FirstIwi = (TextView) findViewById(R.id.textView1); Intent intent = getIntent(); String text = intent.getStringExtra("spinnerText"); //Spinner spinnername2 = (Spinner) findViewById(R.id.spinner2); FirstIwi.setText("First Iwi " + text); } } this activity is for selecting an option from a spinner <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".IwiSelect" > <Spinner android:id="@+id/spinner1" android:layout_width="match_parent" android:layout_height="wrap_content" android:entries="@array/IwiList" android:prompt="@string/Iwi_prompt" /> <Spinner android:id="@+id/spinner4" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignBottom="@+id/spinner5" android:layout_alignParentLeft="true" android:layout_marginBottom="70dp" android:entries="@array/IwiList" android:prompt="@string/Iwi_prompt" /> <Spinner android:id="@+id/spinner3" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_below="@+id/spinner5" android:layout_marginTop="24dp" android:entries="@array/IwiList" android:prompt="@string/Iwi_prompt" /> <Spinner android:id="@+id/spinner5" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_below="@+id/spinner1" android:layout_marginTop="90dp" android:entries="@array/IwiList" android:prompt="@string/Iwi_prompt" /> <Spinner android:id="@+id/spinner2" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_below="@+id/spinner3" android:layout_marginTop="14dp" android:entries="@array/IwiList" android:prompt="@string/Iwi_prompt" /> <Button android:id="@+id/btnSubmit" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:layout_centerHorizontal="true" android:onClick="onClick" android:text="Submit" /> </RelativeLayout> and this activity is for displaying the selected options <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".IwiSelect" > <TextView android:id="@+id/textView1" android:layout_width="match_parent" android:layout_height="wrap_content" android:textAppearance="?android:attr/textAppearanceLarge" android:text="TEXT"/> </RelativeLayout>
a4f672b38b3fce1d3c5a634bd3615e9b1802ef3d658d161eb286abb0e3b8d236
['e21b4179844048e4869c9ac16974b509']
I have written a log in function for my android app, I am wanting to make it work on API 17, right now it give a network on main thread exception, which I understand you cant do network operations on the main thread, I have played around with trying to put threads in but it doesn't seem to go. So i am trying a asynctask now any help suggestions would be great package khs.studentsupport; import java.util.HashMap; import khs.supportapp.library.DatabaseHandler; import khs.supportapp.library.UserFunctions; import org.json.JSONException; import org.json.JSONObject; import android.app.Activity; import android.app.ProgressDialog; import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; import android.content.SharedPreferences.Editor; import android.os.AsyncTask; import android.os.Bundle; import android.util.Log; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.TextView; public class New_Login extends Activity{ // Progress Dialog private ProgressDialog pDialog; public String storedEmail=""; public String stroedPW = ""; boolean GCMFlag=false; // Shared Preferences SharedPreferences pref; // Editor for Shared preferences Editor editor; // Context Context _context; // Shared pref mode int PRIVATE_MODE = 0; // Sharedpref file name private static final String PREF_NAME = "AndroidHivePref"; // All Shared Preferences Keys private static final String IS_LOGIN = "IsLoggedIn"; // User name (make variable public to access from outside) public static final String KEY_NAME = "name"; // Email address (make variable public to access from outside) public static final String KEY_EMAIL = "email"; // Constructor public void SessionManager(Context context){ this._context = context; pref = _context.getSharedPreferences(PREF_NAME, PRIVATE_MODE); editor = pref.edit(); } /** * Create login session * */ public void createLoginSession(String name, String email){ // Storing login value as TRUE editor.putBoolean(IS_LOGIN, true); // Storing name in pref editor.putString(KEY_NAME, name); // Storing email in pref editor.putString(KEY_EMAIL, email); // commit changes editor.commit(); } // Internet detector ConnectionDetector cd; AlertDialogManager alert = new AlertDialogManager(); Button btnLogin; Button btnLinkToRegister; EditText inputEmail; EditText inputPassword; TextView loginErrorMsg; // JSON Response node names private static String KEY_SUCCESS = "success"; //private static String KEY_ERROR = "error"; //private static String KEY_ERROR_MSG = "error_msg"; private static String KEY_UID = "uid"; private static String KEY_STUDENT_ID = "studentUser"; private static String KEY_CREATED_AT = "created_at"; public HashMap<String, String> getUserDetails(){ HashMap<String, String> user = new HashMap<String, String>(); // user name user.put(KEY_NAME, pref.getString(KEY_NAME, null)); //ID of student user.put(KEY_STUDENT_ID, pref.getString(KEY_STUDENT_ID, null)); // user email id user.put(KEY_EMAIL, pref.getString(KEY_EMAIL, null)); // return user return user; } @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.login); } // Response from Activity @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); // if result code 100 if (resultCode == 100) { // if result code 100 is received // means user edited/deleted product // reload this screen again Intent intent = getIntent(); finish(); startActivity(intent); } } /** * Background Async Task to Load all product by making HTTP Request * */ class LoadAlldetails extends AsyncTask<String, String, String> { /** * Before starting background thread Show Progress Dialog * */ @Override protected void onPreExecute() { super.onPreExecute(); pDialog = new ProgressDialog(New_Login.this); pDialog.setMessage("Logging you in. Please wait..."); pDialog.setIndeterminate(false); pDialog.setCancelable(true); pDialog.show(); } /** * getting user details from url * */ protected String doInBackground(String... args) { cd = new ConnectionDetector(getApplicationContext()); String storedEmail = Appconfig.stored_user_name.toString(); String stroedPW = Appconfig.stored_password.toString(); // Check if Internet present if (!cd.isConnectingToInternet()) { if((inputEmail.toString()==storedEmail)&&(inputPassword.toString()==stroedPW)) { // Launch Dashboard Screen Intent dashboard = new Intent(getApplicationContext(), DashboardActivity.class); // Close all views before launching Dashboard dashboard.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); startActivity(dashboard); } } // Importing all assets like buttons, text fields inputEmail = (EditText) findViewById(R.id.loginEmail); inputPassword = (EditText) findViewById(R.id.loginPassword); //Auto fill for login only if the user has logged in before if((Appconfig.stored_user_name.length()>0)&&(Appconfig.stored_password.length()>0)) { inputEmail.setText(Appconfig.stored_user_name.toString()); inputPassword.setText(Appconfig.stored_password.toString()); } // Importing all assets like buttons, text fields btnLogin = (Button) findViewById(R.id.btnLogin); btnLinkToRegister = (Button) findViewById(R.id.btnLinkToRegisterScreen); loginErrorMsg = (TextView) findViewById(R.id.login_error); // Login button Click Event btnLogin.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { new LoadAlldetails().execute(); String email = inputEmail.getText().toString(); String password = inputPassword.getText().toString(); UserFunctions userFunction = new UserFunctions(); Log.d("Button", "Login"); JSONObject json = userFunction.loginUser(email, password); //Check to see if user has put in details if ((email.matches("")||(password.matches("")))) { loginErrorMsg.setText("Please enter your details "); } else { //Checks to see if first time in the app // launces gcm activity if (Appconfig.GCMactivity == false) { Intent intent = new Intent(); intent.setClass(getApplicationContext(),RegisterForGCMActivity.class); startActivity(intent); //set to true so GCm register wont show again Appconfig.GCMactivity=true; } else{ // check for login response try { if (json.getString(KEY_SUCCESS) != null) { loginErrorMsg.setText(""); String res = json.getString(KEY_SUCCESS); if(Integer.parseInt(res) == 1){ // user successfully logged in // Store user details in SQLite Database DatabaseHandler db = new DatabaseHandler(getApplicationContext()); JSONObject json_user = json.getJSONObject("user"); Appconfig.stored_user_name=json_user.getString(KEY_EMAIL); Appconfig.stored_password = password; if(Appconfig.email_is_set==false) { Appconfig.student_ID = json_user.getString(KEY_STUDENT_ID); } Appconfig.email_is_set=true; // Clear all previous data in database userFunction.logoutUser(getApplicationContext()); db.addUser(json_user.getString(KEY_NAME), json_user.getString(KEY_EMAIL), json.getString(KEY_UID), json_user.getString(KEY_CREATED_AT)); // Launch Dashboard Screen Intent dashboard = new Intent(getApplicationContext(), DashboardActivity.class); // Close all views before launching Dashboard dashboard.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); startActivity(dashboard); // Close Login Screen finish(); }else{ // Error in login loginErrorMsg.setText("Incorrect username/password"); } } } catch (JSONException e) { e.printStackTrace(); } } }}}); GCMFlag = true; // Link to Register Screen btnLinkToRegister.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { Intent i = new Intent(getApplicationContext(), RegisterActivity.class); startActivity(i); finish(); } }); return null; } public boolean isLoggedIn(){ return pref.getBoolean(IS_LOGIN, false); } } /** * After completing background task Dismiss the progress dialog * **/ protected void onPostExecute(String file_url) { // dismiss the dialog after getting user details pDialog.dismiss(); // updating UI from Background Thread runOnUiThread(new Runnable() { public void run() { } }); } }
7d44b1ea2fd1eabf6c1f05fe17dcc3459c18d21f42f6e0bf5ee14936a204735b
['e21d50c8a6f643feac5fe13bad0eb169']
If you need to load a module both locally AND from a remote URL, you should name the module when defining it and add an "alias" module which is named like the URL, with both modules defined inside the same file. Example: //define a module NAMED "moment" using the first optional name paramter define("moment", ["require"], function (require) { /*module code goes here*/ }); //alias module to use when lazy loading from URL define("http://momentjs.com/downloads/moment.min.js", ["require"], function (require) { return require("moment");//returns original module }); You can read more about this in a blog post I wrote here.
4e4b3d267ea27510c98d028f518fd1b500bb58d5bdf109619d87bfbd78edfad5
['e21d50c8a6f643feac5fe13bad0eb169']
Running the following comparison by using jQuery's "is" function will return false, since the DOM elements aren't exactly the same, although visually and functionally they are the same: var $a = $('<div id="test" href="http://www.google.com"></div>'); var $b = $('<div href="http://www.google.com" id="test"></div>'); $a.is($b);//FALSE Using direct comparison of the DOM objects will return false as well. See Running example: http://jsfiddle.net/6zqwn/5/ So, is there a way to avoid taking the attributes' order into account when comparing? (Why am I asking this question: I am using these comparisons in cross-browser unit tests in which different browsers change the attributes' order while still functionally creating the same DOM elements.)
24955406743ac6050d5c58d11aee1a8b31e64ad8409aa78e305601bc5767ff7a
['e21fd2e1d2cb4c81b3de638c15a471af']
I am generating report in Microsoft Word from HTML content and right now I am using html_to_doc.inc It is working perfect but fails to display the Images as they have used image path from the server so the document will not display an image if the internet is off which is wrong. I have also tried to use base64 for this I have generated a base64 image in HTML but not able to see the image in Microsoft Word. Anyone have any good alternative or hint for this? Thanks for your valuable time for this
5ff839b2e02d186f9cd373ceb7e19d82828fec54baa4ceee9ebc2d38fe07817f
['e21fd2e1d2cb4c81b3de638c15a471af']
I am sending an email from the PHP code. But when I send the email it return the error status. But I do not know how to get the stack trace/error. Below is the code snippet which I am using. if(mail($to, $subject, $message,$headers)) { echo "Success......................."; } else { echo "Error......................."; } It says's error. I want to get a detailed stack trace so I can fix the issue. Please suggest the code snippet to detect if any
be6fb10ba1f583914e1efd326652fe8e0da8f25f17698b6b1cedef04517e9134
['e220bb1a3afc4e7984afc3642bcb6f6a']
Zomg, way late but I spent 2 hours figuring this out and want to share! I used Android Studio to create the icon, starting from a new blank project. I was able to figure out how to get to the icon generator from the description here, though I feel like I got lucky finding it, so if you need it, you can pay the $40 to view the video to see where that interface is. Then, I copied the files generated from the /app/src/main/res folder in that project, to my /res/icons/android directory. Then, I added this to config.xml (I have other things inside this block too, but this is the relevant stuff: <platform name="android"> <!-- Depend on v21 of appcompat-v7 support library --> <framework src="com.android.support:appcompat-v7:21+" /> <edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application"> <application android:icon="@mipmap/ic_launcher" android:roundIcon="@mipmap/ic_launcher_round" /> </edit-config> <resource-file src="res/icons/android/drawable/ic_launcher_background.xml" target="app/src/main/res/drawable/ic_launcher_background.xml" /> <resource-file src="res/icons/android/drawable-v24/ic_launcher_foreground.xml" target="app/src/main/res/drawable-v24/ic_launcher_foreground.xml" /> <resource-file src="res/icons/android/mipmap-anydpi-v26/ic_launcher_round.xml" target="app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml" /> <resource-file src="res/icons/android/mipmap-anydpi-v26/ic_launcher.xml" target="app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml" /> <resource-file src="res/icons/android/mipmap-hdpi/ic_launcher_foreground.png" target="app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png" /> <resource-file src="res/icons/android/mipmap-hdpi/ic_launcher_round.png" target="app/src/main/res/mipmap-hdpi/ic_launcher_round.png" /> <resource-file src="res/icons/android/mipmap-hdpi/ic_launcher.png" target="app/src/main/res/mipmap-hdpi/ic_launcher.png" /> <resource-file src="res/icons/android/mipmap-mdpi/ic_launcher_foreground.png" target="app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png" /> <resource-file src="res/icons/android/mipmap-mdpi/ic_launcher_round.png" target="app/src/main/res/mipmap-mdpi/ic_launcher_round.png" /> <resource-file src="res/icons/android/mipmap-mdpi/ic_launcher.png" target="app/src/main/res/mipmap-mdpi/ic_launcher.png" /> <resource-file src="res/icons/android/mipmap-xhdpi/ic_launcher_foreground.png" target="app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png" /> <resource-file src="res/icons/android/mipmap-xhdpi/ic_launcher_round.png" target="app/src/main/res/mipmap-xhdpi/ic_launcher_round.png" /> <resource-file src="res/icons/android/mipmap-xhdpi/ic_launcher.png" target="app/src/main/res/mipmap-xhdpi/ic_launcher.png" /> <resource-file src="res/icons/android/mipmap-xxhdpi/ic_launcher_foreground.png" target="app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png" /> <resource-file src="res/icons/android/mipmap-xxhdpi/ic_launcher_round.png" target="app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png" /> <resource-file src="res/icons/android/mipmap-xxhdpi/ic_launcher.png" target="app/src/main/res/mipmap-xxhdpi/ic_launcher.png" /> <resource-file src="res/icons/android/mipmap-xxxhdpi/ic_launcher_foreground.png" target="app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png" /> <resource-file src="res/icons/android/mipmap-xxxhdpi/ic_launcher_round.png" target="app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png" /> <resource-file src="res/icons/android/mipmap-xxxhdpi/ic_launcher.png" target="app/src/main/res/mipmap-xxxhdpi/ic_launcher.png" /> </platform> I'm not fully sure if the appcompat line is necessary so you can try without it if you like. I did also need to remove the android platform & re-add each time I made a change, to get it to notice the change. At one point I also deleted the folder .idea/caches to clear cache. All that, and now it works!! I think it's a better solution than the accepted answer here, because you aren't mucking with the platforms folder & thus won't need to hand-copy things every time, once and done. Hope this saves someone some time!
cc5aeab5cbf4112e058ae10e1494327602b31bcbb253cb4a433febeb951a3ae0
['e220bb1a3afc4e7984afc3642bcb6f6a']
This should be a simple question, but I'm having trouble with it: how can I get php to trigger a 404 error, so that the page the user sees has a true 404 header? I've seen several answers to this, but none have worked for me, maybe because I'm on nginx. I've tried: header("Status: 404 Not Found"); header("HTTP/1.0 404 Not Found"); When I've tried each of these (with an exit() afterwards), the server has sent a 200 header. It seems like this question has been asked in many permutations (Apache / php / sending 404s from the server level, etc) but I'm having trouble finding someone trying to do what I'm trying to do. So, apologies if this is a duplicate - if it is I won't be surprised, and please let me know. Thank you :) - <PERSON>
99401acd586ed0f4d40b7b48aaa38b43f4ca076d4de5bad96853eceb58378ac8
['e22396ece4e448669ba70e1fbd7eea9c']
This is my code #include<iostream> using namespace std; int main() { int s,count1; long long N,R,max1; cin>>s; for (int i=0; i<s; i++) { cin>> N>>R; } cout<< N << R <<endl; return 0; } for input 1 5 6 output 56 but I want the output as 5 6 I am good in c know how to do the same in c,now started learning c++ please help
c44a45c3d05eea13dc93ee4e388dc8b63e35959fc086949496ca50bf91685f09
['e22396ece4e448669ba70e1fbd7eea9c']
I know how to take the mean of the whole image which is of size mxnx3 uint8 by using the following command m = mean(I(:)); my understanding of this command is supposed we have a matrix A=[1 2 3;4 5 6; 7 8 9]; mean_1=mean(A(:)); output is A = 1 2 3 4 5 6 7 8 9 mean_1 = 5 A color image is stored as an mxnx3 matrix where each element is the RGB value of that particular pixel (hence it’s a 3D matrix). You can consider it as three 2D matrices for red, green and blue intensities. so how mean is calculated in this case for three 2D matrices in Matlab?
9381893d478f24bdbf7fb69af8742434f8f1a325ef35d7144d99d35243e10bee
['e223aff9c1b542fc8c31c866450b5958']
This is a more explicit approach. I assume you want to count the number of characters per birth year, per your example. In this case, we handle the ranking first, then add a column to the original dataset, then plot. The new 'label' field is either blank/NA or has members of the top set. I suppress the pesky missing data warning in the geom_label arguments. data = starwars %>% filter(mass < 500) # counts names per birthyear, returns vector of top 4 top4 <- data %>% drop_na(birth_year) %>% count(birth_year, sort = TRUE) %>% top_n(4) %>% pull(birth_year) # adds column to data with the names from the top 4 birth years data <- data %>% mutate(label = ifelse(birth_year %in% top4, name, NA)) # plots data with label, dropping NAs data %>% ggplot(aes(x = mass, y = height, label = label)) + geom_point() + geom_label(na.rm = TRUE)
a22c3f7d74a567e367dab4d8af4c64f472c8ac5ecf696236e4675fc460dcd7f1
['e223aff9c1b542fc8c31c866450b5958']
This doesn't answer your question exactly, but if your use case is EDA only, you can take a massive shortcut and just use the skimr package. Basic histograms are printed in the console output. skimr<IP_ADDRESS>skim(iris) Skim summary statistics n obs: 150 n variables: 5 -- Variable type:factor -------------------------------------------------------- variable missing complete n n_unique top_counts ordered Species 0 150 150 3 set: 50, ver: 50, vir: 50, NA: 0 FALSE -- Variable type:numeric ------------------------------------------------------- variable missing complete n mean sd p0 p25 p50 p75 p100 hist Petal.Length 0 150 150 3.76 1.77 1 1.6 4.35 5.1 6.9 ▇▁▁▂▅▅▃▁ Petal.Width 0 150 150 1.2 0.76 0.1 0.3 1.3 1.8 2.5 ▇▁▁▅▃▃▂▂ Sepal.Length 0 150 150 5.84 0.83 4.3 5.1 5.8 6.4 7.9 ▂▇▅▇▆▅▂▂ Sepal.Width 0 150 150 3.06 0.44 2 2.8 3 3.3 4.4 ▁▂▅▇▃▂▁▁
f9e1d140666e8b820601adbd7071430252cd1f64356d60650d215bc6577c924e
['e2273c4af244420384cf2173aff7f22e']
Make sure that you're calling [super viewWillAppear:] and [super viewDidAppear:] in all the places where you override viewWillAppear or viewDidAppear. Probably true of all the other viewDidWhatever and viewWillWhatever methods as well. The problem you're having suggests that the UITextView isn't getting the message to draw itself on the screen when you're first displaying the table but does get the message when it needs to refresh.
e274f94b12f782ade90ac77305f65a38482522d136827b9282e3d30b145ef6fe
['e2273c4af244420384cf2173aff7f22e']
This seems like a case where you'd want to actually have two different actions handling the cases if it's that much of a concern, but you can hack around this by using the defaults hash -- http://guides.rubyonrails.org/routing.html#defining-defaults -- to specify a parameter that tells you which one you're following to get to the same case. What I mean by two different actions is having an :action => update_from_a in the route and an appropriate method in the controller in addition to the normal :update method. Some of this advice may be rails 3-specific.
d70f5a01dff17d2849a0cd3af407d415539e150abede55ef71c19af97209bf43
['e22ef513dafb40b393cb66677a4e6dfd']
Facing issue with getting control handle of the WPF window, Is any solution for this? am not sure about the below procedure is the right one [DllImport("user32.dll", EntryPoint = "GetWindow")] public static extern IntPtr GetWindow(IntPtr hWnd, uint uCmd); //windowObj is the object of WPF window which contains the scroll bar IntPtr windowHandle = new WindowInteropHelper(windowObj).Handle; if (windowHandle != IntPtr.Zero) { //GW_CHILD=5 IntPtr hScroll = GetWindow(windowHandle, GW_CHILD); if (hScroll != IntPtr.Zero) // always getting 0 { } } windowObj is the object of a WPF window which contain the scroll bar control
56911689370433d52271d6029e65e6d130ccb77f680a49dfd13b7e17e00adfd8
['e22ef513dafb40b393cb66677a4e6dfd']
Facing issues with XML validation. My XML data look like this <Sections> <Section Id="DateAndTimeSection" Enable="True" > <Column Id="Date" Format="YYYYMMDD" /> <Column Id="Time" Format="HHMMSS" /> </Section> <Section Id="ComponentIdSection" Enable="True" > <Column Id="ComponentId" Title="COUNTER" Enable="True" /> </Section> </Sections> I need to verify the XML document based on the "Id" attribute of the "Section" element. If the Id value of the section is DateAndTimeSection then it should support Column's only with the Id's Date and Time. If any Columns other than the above are present ie. with Id value other than Date or Time it should be notified as an invalid XML. Example: Valid XML <Section Id="DateAndTimeSection" Enable="True" > <Column Id="Date" Format="YYYYMMDD" /> <Column Id="Time" Format="HHMMSS" /> </Section> Invalid XML <Section Id="DateAndTimeSection" Enable="True" > <Column Id="Date" Format="YYYYMMDD" /> <Column Id="Example" Format="YYYY" /> </Section> I tried with the XML Schema and Schematron based validation.
f6835ee44e503b559e2f2fcdbb7267a4a6bc3b1e686c5ac5a420ced71653719a
['e22fbe9f25ef4e468e8bcde30bbbe513']
I am working in a mongoDB + node (with express and mongoose) API. I have a document with more or less this structure: // npcs { "_id" : ObjectId("5ea6c0f88e8ecfd3cdc39eae"), "flavor" : { "gender" : "...", "description" : "...", "imageUrl" : "...", "class" : "...", "campaign" : [ { "campaignId" : "5eac9dfe8e8ecfd3cdc41aa0", "unlocked" : true } ] }, }, // ... And a second document in a separate table that is as follows: // user { "_id" : ObjectId("5e987f8e4b88382a98c84042"), "username" : "KuluGary", "campaigns" : [ "5eac9dfe8e8ecfd3cdc41aa0", "5eac9e458e8ecfd3cdc41ac1", "5eac9e978e8ecfd3cdc41adb", "5eac9eae8e8ecfd3cdc41ae3" ] } What I want to do is make a query in which I obtain all the NPCs that are a part of a campaign the user is part of, and are unlocked. The second part is fairly easy, just thought of once I retrieve the NPCs to filter those with unclocked false, but I'm having a hard time visualizing the query since I'm fairly unfamiliar with mongoDBs syntax and usage. Any help would be greatly appreciated.
c64cdbf32bd15b9b2e05d316256b77f264f613982c07d224bf760b514df98d9b
['e22fbe9f25ef4e468e8bcde30bbbe513']
I have the following code in a ReactJS app: this.state = { type1: 0, type2: 0, type3: 0 } const setCount = (num, type) => { let newNum = this.state[type]; newNum = newNum + num * (this.state[type] >= 5 ? 2 : 1); } But now I'm working in a functional component and using hooks to manage state, so my code looks like this: const [type1, setType1] = useState(0); const [type2, setType2] = useState(0); const [type3, setType3] = useState(0); const setCount = (num, type) => { // Need help here } Is there any way to replicate the function in the old code to be used as simply with hooks? I'm not experienced in react with hooks, and I really don't want to make a case by case check based on "if type === 'type1'..."
999b73c7b634f841cfe3cf857a7ccfc5e209655edeb275423e7cc57681de7e28
['e23aff1008cf4aa9905523acd5e0fd76']
I think you are misunderstanding my question(s). For the plane case, I am asking for (a) a set of angles and (b) whether or not the (fixed) plane intersects any rotated ball. You seem to think that I'm asking for the distance from a given ball to a given plane. That is indeed an elementary problem.
216860158881e033b38f0f626daa80451e6778b486422f048e28fa5f069f9975
['e23aff1008cf4aa9905523acd5e0fd76']
I think I figured out a solution. Let $\mathbf{v}$ be any eigenvector of the rotation matrix $R$. Let $\mathbf{w}$ be any vector independent of $\mathbf{v}$. Let $\theta$ and $-\theta$ be the arguments of the complex eigenvalues of $R$. The angle of rotation is the argument above with the same sign as $(\mathbf{w} \times R\mathbf{w}) \cdot \mathbf{v}$.
a4d850668b4d2d2c5d7e047ccb50599c812a7b9196573e366fd4e5a2a7207990
['e248e098cb2d4178b050a39f19ba599a']
Finally I found the solution, The issue was in shouldOverrideUrlLoading Please find below correct shouldOverrideUrlLoading function: @SuppressWarnings("deprecation") @Override public boolean shouldOverrideUrlLoading(WebView view, String url) { if (!Global.IsInternetConnected(MainActivity.this)) { Toast.makeText(getApplicationContext(), "No internet connection!", Toast.LENGTH_SHORT).show(); return true; } else return super.shouldOverrideUrlLoading(view, url); } @TargetApi(Build.VERSION_CODES.N) @Override public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) { if (!Global.IsInternetConnected(MainActivity.this)) { Toast.makeText(getApplicationContext(), "No internet connection!", Toast.LENGTH_SHORT).show(); return true; } else return super.shouldOverrideUrlLoading(view, request); }
adbde30fabdecba76ca8027c037086f1551ace428a4b28b5c94ced286a3e34fc
['e248e098cb2d4178b050a39f19ba599a']
Is it possible to add styles to an image which inside an iframe on the page using CSS only? The following css is not working:- <style> iframe img { zoom: 0.8; } </style> I tried the following scripts:- <style> .zoomingAds { zoom: 0.8; } </style> <script type="text/javascript"> $(document).ready(function () { var i, frames; frames = document.getElementsByTagName("iframe"); for (i = 0; i < frames.length; ++i) { var images = frames[i].contentWindow.document.getElementsByTagName("img"); frames[i].className += "zoomingAds"; } }); </script> But it's not working because I used Javascript and tried to access an iframe which get from google ads(another domain). The error is:- blocked a frame with origin "MyDomain" from accessing a frame with origin "htto://googlesyndication.com" protocols, domains and ports must match
6ecd0a73d0db45db172f7740c40fb041ae070cb52fcaffaf18d687d40d273c40
['e249ec7a96d6446799f941da343a18f2']
I don't know if I understand your question 100%, but here is my suggestion for you <div> <div className={`artjom-select-${!!reason}`} id="artjom-select-container"> <Select value={reason} showArrow={true} placeholder={"Please select reason here"} onChange={this.handleReasonChange} style={{ width: 300 }} getPopupContainer={() => document.getElementById("artjom-select-container")} > {reasonData.map(d => <Option key={d.value}>{t(d.text)}</Option>)} </Select> </div> <OtherReasonInput onChange={this.handleOtherInputChange} reason={reason} otherReason={otherReason}/> </div> .artjom-select-true div:last-child { position: relative !important; }
1f4fda42a726cd55557f3543b25cdab206aa131aafd52f68b00519c6e7836e98
['e249ec7a96d6446799f941da343a18f2']
Trying to modify your code as less as possible. I would sagest 3 changes 1 - Remove the searchQuery dependency from the first Effect useEffect(() => { async function callApi() { const response = await axios.get(`https://jsonplaceholder.typicode.com/users`); const devices = response.data; setDevices(devices); // const response = await axios.get(`${config.serverAPI}/devices`); // const devices = response?.data?.status === 'success' && response?.data?.devices; // console.log("Devices", devices); await localStorage.setItem("devices", JSON.stringify(devices)); setLoading(false); } callApi(); }, []); // eslint-disable-line react-hooks/exhaustive-deps 2 - Add filterdDevices state and also an Effect const [filterdDevices, setFilteredDevices] = useState([]); useEffect(() => { const filtered = devices.filter(device => device.name.toLowerCase().includes(searchQuery) ); setFilteredDevices(filtered); }, [searchQuery, devices]); 3 - Simplify onChange on Select component <Search placeholder="Search for devices" value={searchQuery} onChange={e => { const currSearchValue = e.target.value; setSearchQuery(currSearchValue); }} />
f1e56e29cbe0c470243c41a17c7fbd63ab506aa04c20baff1b882e70b06cbcd4
['e251943076ef438a83aba35f18104167']
In java if u pass a variable as an argument, it always passes the referrence/memory location, thus if u change the value inside a method, the original value will also be changed. Thats why the linked list is changing. Now for the string, name.toUpperCase() will return a new string containing the uppercase version of the source string, i.e. it will not change the original string.. to change the orifinal string, use the following name = name.toUpperCase();
3e66887cdcb7181b387b2a3804443143156c7a526c01db2355d20f44fbdad945
['e251943076ef438a83aba35f18104167']
On page load, input id="act1" will get the value from session. After that, even if the value in session attribute changes, it wont change the value in input id="act1". Solution : I am assuming you are using some js to change the value in session variable. You can manually set the new value into hidden input and then trigger the change function. $('#hidden_input').val('new_value').trigger('change');
b50b041b13b3ba89863567ebd3a22eb44f33cbc0aa134947e280a86892a9b27e
['e256ee71c1304f92a95a7e2e09d5dcb6']
I am using bootstrap with jquery and I am trying to figure out how to have this textarea line up on the right side of the screen instead of the left. Will someone please assist me in how to move it to the right side of the screen. <div class="col-xs-7"> <div class="row"> <div id="overdueSection" class="col-xs-6"> <label class="centered" for="overdueWindow">OVERDUE BATCH</label> <textarea type="text" name="overdueWindow" id="overdueWindow" class="form-control" rows="7"></textarea> </div> </div> </div> http://jsfiddle.net/pvyk3hps/
28e86c696c89e3d85cad5643624a82f254f06309ec42eb2e897b32fed641002b
['e256ee71c1304f92a95a7e2e09d5dcb6']
I am creating a single page application. I am using ajax to set coldfusion session variables. Am I unable to call more than one ajax call with jQuery? http://jsfiddle.net/1zka4soy/15/ If you click on the print labels button and enter a number you will see the ajax call and what it sets on the alert. The New button is set up exactly the same but for some reason does not run. Is this an ajax rule that only lets you run it one time? For some reason on the NEW button $('#addDealer').on('submit', function (e) { is not triggering? PrintLabel $(document).ready(function () { // What happens when a user hits the "Accept" button on the dealer form $(".label_accept").click(function () { $('#LabelMaker').modal('hide'); }); $('#labelForm').on('submit', function (e) { e.preventDefault(); //alert($(this).serialize()); $.ajax({ // the location of the CFC to run url: "proxy/LabelSession.cfm", // send a GET HTTP operation type: "post", // tell jQuery we're getting JSON back dataType: "json", // send the data to the CFC data: $('#labelForm').serialize(), // this gets the data returned on success success: function (data) { console.log(data); if (data !== "") { var link = "labels/DealerLabels.cfm"; window.open(link,'labelPDF'); } }, // this runs if an error error: function (xhr, textStatus, errorThrown) { // show error console.log(errorThrown); } }); }); }); New Button $(document).ready(function () { // What happens when a user hits the "Accept" button on the dealer form $(".dealer_accept").click(function(){ $('#NewDealer').modal('hide'); }); $('#addDealer').on('submit', function (e) { alert("working"); e.preventDefault(); alert($(this).serialize()); $.ajax({ // the location of the CFC to run url: "proxy/NewDealerSession.cfm", // send a GET HTTP operation type: "post", // tell jQuery we're getting JSON back dataType: "json", // send the data to the CFC data: $('#addDealer').serialize(), // this gets the data returned on success success: function (data) { console.log(data); }, // this runs if an error error: function (xhr, textStatus, errorThrown) { // show error console.log(errorThrown); } }); }); });
43013f8fa276e0316578b6294a52777fe80b8a2646ef2235a57f746e578f1cf8
['e25b3dd602a64cc382a070abc5791d7a']
I want to hide my MainActiviy Toolbar in my fragment, i'm using: getActivity().findViewById(R.id.appToolbar).setVisibility(View.GONE); and: ((AppCompatActivity) getActivity()).getSupportActionBar().hide(); and is not working. My fragment has his own Toolbar, and is already been showed, but my Activity Toolbar is being showed too. What am i doing wrong? I just want to show my fragment ToolBar
555b5d2bd543b5a39ba762c42f87096d330105e0217c2337d7f9aa3710926358
['e25b3dd602a64cc382a070abc5791d7a']
I'm using 3 ToggleButtons (A,B,C) to filter the content of my array (with an AND condition) and show the result in a listview. For example if A is true and B,C false... the listview will only show me the items in my array that only contains A. if A,B is true and C is false. The listview will show the items in my array with A AND B. I'm doing this with onCheckedChangeListener something like: @Override public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { List<BrandPlanners> filteredList = new ArrayList<>(); if (isChecked){ if (buttonView == A) { if (B.isChecked()){ if (C.isChecked()){ //show listview with A,B and C elements } else { // show listview with A AND B elements } } else { if (C.isChecked()){ // Show listview with A and C elements } else { // Show listview with A elements } } } if (buttonView == B) { if (A.isChecked()){ if (C.isChecked()){ // show listview with 3 elements } else { // show listview whth A and B elements } } else { if (C.isChecked()){ // show listview with C and B elements } else { // show listview with B elements } } } if (buttonView == C) { if (A.isChecked()){ if (B.isChecked()){ // show 3 elements } else { // show C and A elements } } else { if (B.isChecked()){ // show C and B elements } else { // show C elements } } } } else { //if isChecked() is false //create all the if conditions again } } I think this is not a good practice, the question is: How can i do this in a better way? this is actually working but i am not happy with the code.
9bd8f3b80b5b8cb944a0b7bb045eb943bc430946e4b194b9e086c08d0f86cbb5
['e25d4e698dbe405c877d82028e8520d6']
According to the documentation: TensorFlow uses the tf.Session class to represent a connection between the client program---typically a Python program, although a similar interface is available in other languages---and the C++ runtime. It means that when you do values = tf.constant([0, 1, 2, 0, 2], dtype=tf.float32) you are just inserting a node to your tensorflow Graph! Since Python is the high level API for a low level C++ runtime, you actually need a Session to evaluate your Python code in this low level runtime. That is why every time you need to calculate or evaluate a Tensorflow variable/method/constant/etc you need to run it in a Session with tf.Session().run(yournode) I hope it helped
98366f00d7da8f86e48daea2809a1feff1255af3332556a44db0db56d6aec9c1
['e25d4e698dbe405c877d82028e8520d6']
For this problem I wouldn't use SkLearn. Reather with a simple nested loops it is possible to solve it. Assuming that you just want to find the Dictionary that has the most number of items equal to your Query Dictionary (Dic1) divided by the number of items in the Query (the similarity) the simplest answer that I can think of is: nDic1 = len(Dic1)*1. for item in Dic2: match = 0 iDic = Dic2[item] for i in iDic: if i in Dic1: if iDic[i] == Dic1[i]: match +=1 print("{}: {}%".format(item, match*100/nDic1)) The printed result in this case is: Diabetes: 20.0% Hipotireioidismo: 20.0% Hipertireioidismo: 20.0%
847bd0d1179df9a6305965c971470218d13694605e48560449d4d24cd722e391
['e2662d5868644fde8449112f67aee199']
In this scenario Tomcat wouldn't do anything but serve static content. The words application is pure static client code (no servlets, nothing...). So you can use a simple browser to access the index.html on disk. If you insist on using tomcat for development: There's no need to redeploy. The only thing you need to do is configure tomcat to serve the static content that the build generates. If you named your application "helloworld" this would be: /helloworld/client-web/target/helloworld-web-1.0-SNAPSHOT-bck2brwsr/public_html Make your code changes, build, reload the page in browser and the browser will see the updates
ec1e05a38eed926385c8de910c8713d28f45606e1e587ecf6bd1fda77a3ee3b7
['e2662d5868644fde8449112f67aee199']
The problem is in VirtualFlow. In layoutChildren() there is this section: if (lastCellCount != cellCount) { // The cell count has changed. We want to keep the viewport // stable if possible. If position was 0 or 1, we want to keep // the position in the same place. If the new cell count is >= // the currentIndex, then we will adjust the position to be 1. // Otherwise, our goal is to leave the index of the cell at the // top consistent, with the same translation etc. if (position == 0 || position == 1) { // Update the item count // setItemCount(cellCount); } else if (currentIndex >= cellCount) { setPosition(1.0f); // setItemCount(cellCount); } else if (firstCell != null) { double firstCellOffset = getCellPosition(firstCell); int firstCellIndex = getCellIndex(firstCell); // setItemCount(cellCount); adjustPositionToIndex(firstCellIndex); double viewportTopToCellTop = -computeOffsetForCell(firstCellIndex); adjustByPixelAmount(viewportTopToCellTop - firstCellOffset); } The problem arises if position is 1.0 (== scrolled to bottom), because in that case there is no recalculation. A workaround would be to override the TreeViewSkin to provide your own VirtualFlow and fix the behavior there. The code below is meant to illustrate the problem, it's not a real solution, just a starting point if you really want to fix it: import com.sun.javafx.scene.control.skin.TreeViewSkin; import com.sun.javafx.scene.control.skin.VirtualFlow; import javafx.application.Application; import javafx.scene.Scene; import javafx.scene.control.IndexedCell; import javafx.scene.control.Skin; import javafx.scene.control.TreeItem; import javafx.scene.control.TreeView; import javafx.scene.layout.StackPane; import javafx.stage.Stage; public class TreeViewScrollBehaviour extends Application { @Override public void start(Stage primaryStage) { TreeView treeView = new TreeView() { @Override protected Skin createDefaultSkin() { return new TTreeViewSkin(this); //To change body of generated methods, choose Tools | Templates. } }; TreeItem<String> treeItem = new TreeItem<String>("Root"); for (int i = 0; i < 20; i++) { TreeItem<String> treeItem1 = new TreeItem<>("second layer " + i); treeItem.getChildren().add(treeItem1); for (int j = 0; j < 20; j++) { treeItem1.getChildren().add(new TreeItem<>("Third Layer " + j)); } } treeView.setRoot(treeItem); StackPane root = new StackPane(); root.getChildren().addAll(treeView); Scene scene = new Scene(root, 300, 250); primaryStage.setTitle("Hello World!"); primaryStage.setScene(scene); primaryStage.show(); } /** * @param args the command line arguments */ public static void main(String[] args) { launch(args); } class TTreeViewSkin<T extends IndexedCell> extends TreeViewSkin<T> { public TTreeViewSkin(TreeView treeView) { super(treeView); } @Override protected VirtualFlow createVirtualFlow() { return new TVirtualFlow<T>(); //To change body of generated methods, choose Tools | Templates. } } class TVirtualFlow<T extends IndexedCell> extends VirtualFlow<T> { @Override public double getPosition() { double position = super.getPosition(); if (position == 1.0d) { return <PHONE_NUMBER>; } return super.getPosition(); //To change body of generated methods, choose Tools | Templates. } @Override public void setPosition(double newPosition) { if (newPosition == 1.0d) { newPosition = <PHONE_NUMBER>; } super.setPosition(newPosition); //To change body of generated methods, choose Tools | Templates. } } }
530265ddb1eb0fb72dda58045896d0995171c45808091334ded6daae11d379d6
['e26e46ee70744edcaf015c47390cbbf2']
Форма, в которой Вы задали вопрос крайне раздражает форумчан, которые могут Вам помочь (меня в том числе). Во-первых, есть смысл разбить исходный Ваш вопрос на четыре вопроса; Во-вторых прочесть это https://ru.stackoverflow.com/help/how-to-ask и это https://ru.stackoverflow.com/help/on-topic (особенно по части учебных заданий). Для каждого из четырех отдельных вопросов уберите лишние таблицы. Избегайте прикладывать текст задания в виде картинки. Должна быть четко видна Ваша попытка решения задачи и ход Ваших рассуждений. За Вас ничего делать не будут, а лишь подскажут куда нужно смотреть.
93ae186dfc6ea1de7c371def0f5589a7b83a0ac8314050635c42819102f4ca7f
['e26e46ee70744edcaf015c47390cbbf2']
@Владимир я пишу ответ на колене с планшета в метро. Если Вам что-то не понятно, то я дополню ответ, но Вам придется подождать, пока я не окажусь рядом с нормальным компьютером. Советы по поводу параметров в командной строке, которые Вам дали в другом ответе - абсолютно правильные, но это я тоже распишу позже.
028627c3ed0fa4b07d38858f89249922c273bb2d31942f3beee23d31fe75757f
['e2758abc1bbe4db0917f03a6e5b31ec8']
Thanks <PERSON> !! I just had to login and give this answer a thumbs up. Solved my problem. Better answer than any I looked up from last few days :) Here's my piece of code of how I solved it Using AppCompatActivity as ActionBarActivity seems to be deprecated. public class SelectActivity extends AppCompatActivity /*ListActivity*/ implements OnClickListener { ListView listView; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.select_clothes); listView = (ListView) findViewById(R.id.listView); mList = getListData(); MyAdapter listAdapter = new MyAdapter(this, R.layout.row, mList); listView.setAdapter(listAdapter); }
baa6b48c35d0df4c869c714857a4a78633a2a4c57fb8e386f83fdbcb600636b1
['e2758abc1bbe4db0917f03a6e5b31ec8']
To make the application remember the last selected spinner values, you can use below code: Below code reads the spinner value and sets the spinner position accordingly. public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); int spinnerPosition; Spinner spinner1 = (Spinner) findViewById(R.id.spinner1); ArrayAdapter<CharSequence> adapter1 = ArrayAdapter.createFromResource( this, R.array.ccy_array, android.R.layout.simple_spinner_dropdown_item); adapter1.setDropDownViewResource(android.R.layout.simple_list_item_activated_1); // Apply the adapter to the spinner spinner1.setAdapter(adapter1); // changes to remember last spinner position spinnerPosition = 0; String strpos1 = prfs.getString("SPINNER1_VALUE", ""); if (strpos1 != null || !strpos1.equals(null) || !strpos1.equals("")) { strpos1 = prfs.getString("SPINNER1_VALUE", ""); spinnerPosition = adapter1.getPosition(strpos1); spinner1.setSelection(spinnerPosition); spinnerPosition = 0; } And put below code where you know latest spinner values are present, or somewhere else as required. This piece of code basically writes the spinner value in SharedPreferences. Spinner spinner1 = (Spinner) findViewById(R.id.spinner1); String spinlong1 = spinner1.getSelectedItem().toString(); SharedPreferences prfs = getSharedPreferences("WHATEVER", Context.MODE_PRIVATE); SharedPreferences.Editor editor = prfs.edit(); editor.putString("SPINNER1_VALUE", spinlong1); editor.commit();
973b2740b7a0ffac98bd8acaee35c22b33073328d13505959d2b3a68836da778
['e27816333f954139b038ec26f229c56f']
I'm having a problem with my home page in Joomla! 1.7. Everything was fine layout-wise first. I had a three-column set-up, images to the left, main content in the middle, and testimonials to the right. I then added a News Flash menu module to the left position. Subsequently, the footer section shot up to the top of the page and all the rest of the content moved and nested itself to the left. Does anyone have any ideas as to what could have prompted that?
21de038cab22fc150ecde691254e270fd073b1a125af072cb109dbed81ee1c6a
['e27816333f954139b038ec26f229c56f']
I have the following nav element in regular html. I would like to convert it to a dynamic loop in wordpress. I have already created the pages in Wordpress. I just want to register the nave menu. The problem is, I have more than one ul tag, so i'm not quite sure how to proceed. Here is the following code: <nav id="footerNav"> <ul> <li><a href="#">Home</a></li> <li><a href="#">Who we Are</a></li> <li><a href="#">What we Believe</a></li> </ul> <ul> <li><a href="#">Leadership</a></li> <li><a href="#">What to Expect</a></li> <li><a href="#">Sermons</a></li> </ul> <ul> <li><a href="#">Bible Study</a></li> <li><a href="#">News</a></li> <li><a href="#">Announcements</a></li> </ul> <ul> <li><a href="#">Directions</a></li> <li><a href="#">Links</a></li> <li><a href="#">Contact Us</a></li> </ul> </nav> Can someone tell what php function I would need to write to create the links dynamically in wordpress?
9df64ea7cdc4a1e5db02791de0f99f722d1040a1298198c85d1d8f6315468824
['e27e3d5d2bec46078c532a36cfc5f7a5']
@rs.29 Since you seem so knowledgeable about her death, did you bother to read up about this girl's _life_? **The only decent response to her story is mournful silence.** Maybe you should put your energy in contemplating how society failed this girl time and time again. In stead of spreading hurtful theories that have been debunked [over](https://www.bbc.com/news/world-europe-48541233) and [over](https://www.washingtonpost.com/opinions/2019/06/12/her-story-isnt-about-euthanasia-its-about-failing-mental-health-systems/).
77b8ea8fa1cdfeb24cd2e7055bf3b3d544bd46d421ca2e0cf7b0b4fcca13d1b1
['e27e3d5d2bec46078c532a36cfc5f7a5']
Will try, thanks. I've just found another problem: With Page Viewer, the links I have in my content open inside the same web-part. I'd like the browser to just go to the linked page. Is it possible? I would like my content to appear as an integral part of the page rather than an embedded external page.
504ee28c1c39fb8393cf738dfb94f3a564ddf8cc59ac9dc1d48182db19d2ceaa
['e294295de0254eb7b0f5c0be69646122']
Near a bifurcation point, a dynamical system will undergo what is called critical slowing down -- A loss in resilience to perturbation from equilibrium. See here for more on this phenomenon. A hallmark of this slowing down is an increase in the variance and lag-1 autocorrelation of a stochastically forced system. As the system approaches a bifurcation point due to slow change in a control parameter, an increase in these statistics is also observed. A quick argument for this can be made for scalar equations: Assume there is repeated disturbance in the state variable after each time period $\Delta t$. Between disturbances, the return to equilibrium is approximately exponential, with recovery speed $\lambda$. This can be described as an autoregressive progress : $$y_{n+1} = \exp(-\lambda \Delta t) y_n + \sigma\epsilon \>.$$ Here, $y_n$ is the state variables deviation from equilirbium, $\epsilon \sim \mathcal{N}(0,1)$, and $\sigma$ is the standard deviation. When written in this way, we see that the autocorrelation, $\alpha$ is equal to $\exp(-\lambda \Delta t$). Assuming that $\lambda$ and $\Delta t$ are independant of $y_n$, then we can observe that the system undergoes critical slowing down, then the recovery speed $-\lambda \rightarrow 0^-$, hence the autocorrelation tends to 1 from below. My question is: how can I extend this argument to systems of differential equations?
cdf337ca337affabf7113e16e29fe46a1bd94e2ba224984844b9f09a7a672455
['e294295de0254eb7b0f5c0be69646122']
Hi I am stuck in this problem for long time. I expect output "ok" for this makefile. But I get syntax error on calling make: ifeq (0, 0) /bin/sh: 1: Syntax error: word unexpected (expecting ")") make: *** [default] Error 2 Code: CHK = 0 default: ifeq ($(CHK), 0) echo "ok" else echo "not ok" endif
78fe2f4c268330c5db9da2569f21762f071e2c5dd60f164fdeb8ef94ddacf7c0
['e29885c70c174c2a8d3f9974a4c1e5c8']
Given an isomorphic class, let's say a GraphNode, which should emit signals and receive signals in slots which have as parameters objects of the class itself, how to properly declare this with the new style signals and slots mechanism? One workaround for signals I've found was to declare it after the class definition has been declared: class GraphNode(QGraphicsItem): def __init__(self, title, x, y, width, height, parent=None): super(GraphNode, self).__init__(parent) GraphNode.onCollisionDetected = pyqtSignal(GraphNode, list) but this doesn't look nice (at least to me). How to declare signals slots in such isomorphic classes with the new style of declaration in PyQt4 and Python3, preferably inside the class, not afterwards?
cd3d34240aac102864f28045491dd651d78ca9d75a15656a285771c875f16e7d
['e29885c70c174c2a8d3f9974a4c1e5c8']
After drawing the following UC Diagram, I right click on an use case and send it to the backlog It appears as a new activity in the product backlog, like this: So I move it to the board and create a task and an epic underneath: Then I go on creating the User Stories for the new topic called "Plugin Deployment": Everything works great so far, I can even edit the conversation and confirmation items: The problem As soon as I activate the tab "scenario", the current story, which so far I thought I associated with the "Plugin Deployment" use case, appears under a new model "General User Stories": What can I do to organize the stories inside my model in the proper way? What does Visual Paradigm 14.1 Professional Edition expect from me? Any ways to circumvent this problem? I don't want to end up with hundreds of user stories there.
2913485d0e85fa9ffbfb7721c940da17f5bdefa1f35745cfce5a83fa11b9812a
['e2a048519e334de38cefcfb24995cdb0']
I am writing a desktop app in vb.net with visual studio 2019. I access a postgreSQL database with the NPGSQL provider. To be able to react to changes in the database, I have set up a trigger according to these articles: How to fire NOTIFICATION event in front end when table data gets changed https://www.graymatterdeveloper.com/2019/12/02/listening-events-postgresql/ The function in PostgreSQL looks like this: CREATE FUNCTION public.NotifyOnDataChange() RETURNS trigger LANGUAGE 'plpgsql' AS $BODY$ DECLARE data JSON; notification JSON; BEGIN -- if we delete, then pass the old data -- if we insert or update, pass the new data IF (TG_OP = 'DELETE') THEN data = row_to_json(OLD); ELSE data = row_to_json(NEW); END IF; -- create json payload -- note that here can be done projection notification = json_build_object( 'table',TG_TABLE_NAME, 'action', TG_OP, -- can have value of INSERT, UPDATE, DELETE 'data', data); -- note that channel name MUST be lowercase, otherwise pg_notify() won't work PERFORM pg_notify('datachange', notification<IP_ADDRESS>TEXT); RETURN NEW; END $BODY$; The trigger looks like this: CREATE TRIGGER OnDataChange AFTER INSERT OR DELETE OR UPDATE ON um_permission FOR EACH ROW EXECUTE PROCEDURE public.NotifyOnDataChange(); And this is the vb.net code: Private Sub Load Dim tConnectionString As String = String.Format("Password={0}; Username={1}; Database={2}; Host={3}; Port={4}", "pswd", "name", "db", "localhost", 5432) myConn.ConnectionString = tConnectionString myConn.Open() Dim tCom As NpgsqlCommand = myConn.CreateCommand tCom.CommandText = "LISTEN datachange;" tCom.ExecuteNonQuery() AddHandler gDatabaseEngine.TivanDatabase.Notification, AddressOf Database_Notification tCom.CommandText = "update um_permission set key='view' where id=1" tCom.ExecuteNonQuery() End Sub Private Sub Database_Notification(_sender As Object, _e As NotificationEventArgs, _table As String, _action As String) 'Do something End Sub This all works great. The command ExecuteNonQuery triggers the event. But my expectation is that every change to the table will trigger the event. However, if I make a change in pgAdmin or in another instance of my program, the event is not fired. Is this due to a bug in my code or is this the usual behaviour? Is there a solution to this?
d64266eb652f5248bf2ce9d85741046fa525903c9b3fa04b6e4c0f0b51336021
['e2a048519e334de38cefcfb24995cdb0']
Is it possible to have a UserControl with an Event (Event GoUp) that calls a Methode in an second Usercontrol (Sub Upgoing), and all this in WPF/XAML? <controls:Joystick/> <!--with Event GoUp--> <controls:TV/> <!--Sub Upgoing that should be called when Event GoUp is fired--> I know how to solve this in Code Behind or ViewModel, but it is possible in XAML??
ccb5f5bbb61723489457a9c539c3f134b1ba0bfe873d514090fbce9be58b15b6
['e2a43d5364cb44a6b4defeeb87220c04']
1) I'd very surprised if the filename weren't indexed. It's used throughout the API, and I assume that it is indexed. 2) Yes, you can, but there is no real notion of directories implied. Listing files/dirs is a bit more complicated. In other words it's just a label. 3) Indexes use hashes, or fixed length strings, so a long key is just as easy to index as a long one.
4a6132ba9d4ab0c5d0a3e22922762fe4741262a1e52a3e80c866e4a55eae393b
['e2a43d5364cb44a6b4defeeb87220c04']
There are plenty of uses for StringIO, for instance it can be used in place of a mutable string. However since your goal is to write to file, you should skip it and just go straight to file: with open('file/path', 'w') as fh: fh.write('Hello World!') print open('file/path').read() # if you need to actually print it out.
45d6f3d1113eec61bb601bb298b073a2322bc6dec8ad8791ab1380586194dc85
['e2b0239b9ec5485cadaa89373bd54928']
I'll trying to setup Hyperledger sample on Windows 10 using the 1.1 documentation. I've installed all the prerequisites. but we I run this command: curl -sSL https://raw.githubusercontent.com/hyperledger/fabric/master/scripts/bootstrap.sh | bash -s 1.1.0 from within the fabric-sample folder, I get this error: ===> Downloading platform specific fabric binaries % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 1049 0 1049 0 0 1049 0 --:--:-- --:--:-- --:--:-- 1722 gzip: stdin: not in gzip format tar: Child returned status 1 tar: Error is not recoverable: exiting now ===> Downloading platform specific fabric-ca-client binary % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 1076 0 1076 0 0 0 0 --:--:-- 1:11:35 --:--:-- 1465 gzip: stdin: not in gzip format tar: Child returned status 1 tar: Error is not recoverable: exiting now ------> 1.1.0 fabric-ca-client binary is not available to download (Avaialble from 1.1.0-rc1) <---- curl verison: curl-7.59.0
57d0e7a79b6d4146fa710e8411449bc212428fb9b20707d61e1e6705ff74c364
['e2b0239b9ec5485cadaa89373bd54928']
I'm using IdentityServer4 for authentication/Authorization, which is a standalone application In the client application (ASP.NET MVC), if a user clicks login, they are redirected to IDS4, After a successful login, they are redirected back to the client application. Currently, during the redirects, the page is blank, like nothing is happening. Does anyone know if there is a way to show a progress indicator/spinner when redirecting between IDS4 and the client?
bf807ca2250bef3ffe67a94fdd22b247566ad9b30b4a4974f9803f99bbec6605
['e2c04ae89744418e8541f7b8342b82a3']
I'm working with sensitive data, so I created a fake data frame that can serve as an example. This is what we're working with. n percent 4 36% 5 51% 6 61% 7 71% 8 84% 9 96% 10 100% Pretty simple. I want to change the percent column so that the values have parentheses around them. So essentially, I want the data frame to look like this: n Percent 4 (36%) 5 (51%) 6 (61%) I realize that this will make it a string, but that's not a problem for my ultimate purposes. I wrote a function that returns the column as a vector with parentheses. addparentheses <- function(x){paste("(", x, ")")} addparentheses (sample_data$percent) [1] "( 36% )" "( 51% )" "( 61% )" "( 71% )" "( 84% )" "( 96% )" "( 100% )" How can I write something like this so that it actually changes the data frame and doesn't just return a vector? Any ideas and insights are much appreciated. Thanks!!
b40aee68c245484fa589c0e8775449746fd71dbd30ef511ce861349c8281da66
['e2c04ae89744418e8541f7b8342b82a3']
I'm not very experienced in R and I've been having an issue with geom_col(position = "identity") that I cannot figure out. Here is some obfuscated data that still shows my issue and the code for my graph. #Dataframe print(colorsshapes, n = 30) # A tibble: 30 x 4 # Groups: year, shape [15] year shape color total <int> <chr> <chr> <int> 1 2015 circle Red 101 2 2015 circle Blue 6960 3 2015 star Red 232 4 2015 star Blue 9436 5 2015 square Red 218 6 2015 square Blue 9417 7 2016 circle Red 146 8 2016 circle Blue 7041 9 2016 star Red 415 10 2016 star Blue 9702 11 2016 square Red 381 12 2016 square Blue 9653 13 2017 circle Red 167 14 2017 circle Blue 6890 15 2017 star Red 780 16 2017 star Blue 10277 17 2017 square Red 754 18 2017 square Blue 10231 19 2018 circle Red 306 20 2018 circle Blue 7067 21 2018 star Red 1066 22 2018 star Blue 10255 23 2018 square Red 1058 24 2018 square Blue 10233 25 2019 circle Red 457 26 2019 circle Blue 6304 27 2019 star Red 1886 28 2019 star Blue 10082 29 2019 square Red 1870 30 2019 square Blue 10057 #Graph basic_hist <- colorsshapes %>% ggplot(aes(x = shape, y = total, fill = color)) + geom_col(position = "identity", color = "black") + scale_x_discrete(name = "Shape", breaks = c("star", "circle", "square"), labels = c("Star", "Circle", "Square")) + scale_y_continuous(name = "Total", limits = c(0,10500)) + scale_fill_manual (name = "Color", breaks = c("Red", "Blue"), labels = c("Red", "Blue"), values = c("indianred1", "darkslategray3")) + facet_wrap(~year, nrow = 1) + geom_text (aes(x = shape, y = total, label = total), stat = "identity", position = position_nudge(y = 200), show.legend = FALSE) + theme(axis.title = element_text(face = "bold", size = 12), axis.text.x = element_text(angle = 345, size = 12, hjust = 0, vjust = 1), axis.title.x = element_text(margin = margin(t = 10, r = 2, b = 1, l = 2)), legend.title = element_text(face = "bold", size = 12), legend.text = element_text(size = 10), panel.spacing = unit(0.5, "cm"), strip.text = element_text(size = 12, face = "bold")) R plots the taller bar first, making the smaller bar unseen. I'd rather not adjust the alpha levels because the legend won't perfectly match the color of the lighter bars. My supervisor also would prefer contrasting colors, which makes adjusting the alpha a little less aesthetically pleasing. I've tried converting the fill variable to a factor and manually setting the labels. No luck. I've tried reordering the levels in the scale_fill_manual() call. No luck. I've tried variations of arrange() and sort() in the graph code. No luck. Any ideas? Much appreciated!
1ae6384296dca09cf6383c7047ac3d29d0c5f86a4b908896905448795d3d896a
['e2c9275022304addb422292d54becedf']
So, I just buy introduction book for sas. But it only contain tons of examples with little/no explanation. I tried to find some tutorial online, but I can't find the explanation for this formatting. I just wonder what's the different between these two: INPUT Name $16. Age 3. +1 height 5.1 I wonder, what does "." mean. What the different between: INPUT Name $16 and INPUT Name $ 1-16 what is the symbol "+1" mean? what does "5.1" mean? how's that different from "5."? thx
2f761924005582fa135fa3fa289999f0b64803c3a7c3e7143a87d1c5a7212f5a
['e2c9275022304addb422292d54becedf']
currently, I'm facing a problem with my code and my understanding of pointer. here's the code struct command { int type; int *input; int *output; union{ struct command *command[2]; char **word; }u; }; to my understanding, the instance struct command *command[2] is an array of pointer to array of command. So I allocate the array with these: cur_command->u.command[0] = malloc(sizeof(struct command[2])); So it give me a 2d array of command. However my teacher told me that struct command *command[2] is a pointer to an array command size 2. So cur_command->u.command[0] give the first command element instead of a pointer to a command array size two. My question is, how can I allocate the memory to develop this kind of behavior. thx
abce02869580204e49399cdec5b715dd8131e6d9641c8b8a907136461624ac07
['e2cb555af558435080d916ab1365e68f']
I have a selectizeInput and some action links to make it easier to select certain subgroups. I'd like to have one action link which deselects all values (to make it easier to choose just one item for example -- deselect them all and then the user picks one). The code: updateSelectizeInput(session, "selectizeList", selected = NULL) doesn't work, which is by design as the help for updateSelectizeInput (http://shiny.rstudio.com/reference/shiny/latest/updateSelectInput.html) states: Any arguments with NULL values will be ignored; they will not result in any changes to the input object on the client. Given that this is a feature, how can I unselect all values?
5481f15c3f9fc2a764454169dc755a3aafc4e60edf0b95a103901c75e9aacd47
['e2cb555af558435080d916ab1365e68f']
I'm trying to programmatically create a table in d3 with quarters across the top and values along the left. Given a vector of quarters ["q1", "q2", "q3", "q4"], I would like the table: | q1 | q2 | q3 | q4 | v1 | | | | | v2 | | | | | What I am getting when running the code below is: | q2 | q3 | q4 | v1 | | | | v2 | | | | Note the first column is missing. I am using the following code: var qtrs = ["q1", "q2", "q3", "q4"]; var info = d3.select("body"), thead = info.append("thead"), tbody = info.append("tbody"); thead.append("tr").append("th").text("") thead.select("tr") .selectAll("th") .data(qtrs) .enter() .insert("th") .text(function (d) { return (d); }); tbody.append("tr").insert("td").text("Value 1") tbody.append("tr").insert("td").text("Value 2") tbody.selectAll("tr").selectAll("td").data(qtrs).enter() .append("td").text("0.0"); Which is also available here: http://jsfiddle.net/TpCJk/ The part I am struggling with is how to manually select/add a single element (ie the first column) to the table while using data(qtrs) to automatically generate the rest of the columns. What seems to be happening is that the selectAll is also selecting the (manually created) empty cell and overwriting it. I've tried adding the first column later (putting thead.select("tr").insert("th").text("..."); after creating th however it always seems to land at the end of the table, not the start. Note that the qtrs array here is an example, in my full application it will depend on the data passed to it (ie could be longer or shorter). The "Value 1" and "Value 2" lines are fixed. Any help much appreciated!
8518b2122b74a5a04bc3137a17425ba057dbc65c25183b5129b89edb32980e00
['e2cf79132e8345e49f3d17b31617a4e3']
Cant make any easier than that: package com.danielmarreco; import org.w3c.dom.Document; import org.w3c.dom.Node; import org.w3c.dom.NodeList; import org.w3c.dom.Element; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import java.io.InputStream; import java.net.URL; public class Main { public static void main(String[] args) { try { InputStream is = new URL("http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml").openStream(); DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); DocumentBuilder db = dbf.newDocumentBuilder(); Document doc = db.parse(is); NodeList nodeList = doc.getElementsByTagName("Cube"); for (int i = 0; i < nodeList.getLength(); i ++) { Node node = nodeList.item(i); if (node.getNodeType() == Node.ELEMENT_NODE) { Element element = (Element) node; if(element.getAttribute("currency").equals("BRL")) System.out.println("1 EUR = " + element.getAttribute("rate") + " BRL"); } } } catch (Exception e) { e.printStackTrace(); } } }
b6854edd7b036af3527dc2d89120d43a2217b92eba61cab16ea0c9466b726c40
['e2cf79132e8345e49f3d17b31617a4e3']
This simple reducer will return an array of arrays, each one containing all the duplicate elements in the original array. function groupDuplicates(array, compareF) { return array.reduce((acc, item) => { const existingGroup = acc.find(g => (compareF(g[0], item))); if (existingGroup) { existingGroup.push(item); } else { acc.push([item]) } return acc; }, []); } Where compareF is your custom comparator, and should returns true if it's parameters are considered to be equal. NOTE: In this implementation, non duplicated items will remain as the only element in their array. You may want to filter these out later, like so: const duplicatesOnly = groupDuplicates(myArray, myComparator).filter(i => (i.length > 1));
78026aab802c2fea95e801140f3fe74cc329a749ab5fcf7233afd64557f40e98
['e2d1de843f3046a5bd3e7a9dfaa5074e']
Two solutions are possible using recursion, which do not use looping or comprehensions - which implement the iteration protocol internally. Method 1: lst = list() def foo(index): if index < 0 or index >= len(xs): return if f(xs[index]) > 0: lst.append(xs[index]) # print xs[index] or do something else with the value foo(index + 1) # call foo with index = 0 Method 2: lst = list() def foo(xs): if len(xs) <= 0: return if f(xs[0]) > 0: lst.append(xs[0]) foo(xs[1:]) # call foo with xs Both these methods create a new list consisting of the desired values. The second method uses list slicing, which I am not sure whether internally implements iteration protocol or not.
710a2cf225908951269793e0e230993867cdc52fed7f7a7f1149ff1b1d5e66ad
['e2d1de843f3046a5bd3e7a9dfaa5074e']
In python 3.x in-built functions like map() return an iterable which can be 'iterated' upon using a simple for loop. For printing your answer as a list you need to wrap your function in a list() call or use a list comprehension. >>>list(map(int, l1)) >>>[element for element in map(int, l1)]
fc01763f837ec57126ade1f80aea3907e93ad00a9d21f816158f292df36fd3eb
['e2e350ca93cd4729a532a49c25576d01']
I am new to coding in general and currently making R shiny app for my app. It's purpose is to upload csv file Have multiple checkboxes. If it is checked, the data will go through the corresponding script. Export the new data I have watched the tutorial but I am currently having some difficulty with reactivity. I tried browsing other questions too but I found it difficult to pick what I need from their examples due to my unfamiliarity with coding. I currently finished import and export functioning properly and written up scripts for the body. However, I am not sure how to incorporate this "body" into server side. This is one of "body", written without consideration for Shiny: file1 <- file1[ grep("REVERSE", file1[,c(1)], fixed = FALSE, invert = TRUE),] Ui is somewhere along of ... fileInput('file1' .... checkboxInput(inputId = "rmDecoy", label = "Remove Decoy Entry", value = TRUE ), .... mainPanel( tableOutput('contents') while this is server side I have written so far, with only export function: server <- function(input, output) { getData <- reactive({ inFile <- input$file1 if (is.null(input$file1)) return(NULL) read.csv(inFile$datapath, header=input$header, sep=input$sep, quote=input$quote) }) output$contents <- renderTable( getData() ) output$downloadData <- downloadHandler( filename = function() { paste("data-", Sys.Date(), ".csv", sep="") }, content = function(file) { write.csv(getData(), file) }) } It sort of worked when I did output$rmDecoy but when I put it together with download data function, it ceased to function. Hence, my questions are My understanding is that you are not trying to directly change the input. Rather, you are rendering new table, change that, and exporting it. Am I understanding principles of R shiny? How would you incorporate the script above into server? Thank you for your help.
197366cfb269b83c65073e1a778fa909eeecd3e2f8a4384154ecd0217f80fea3
['e2e350ca93cd4729a532a49c25576d01']
This is less of asking for code solution, but more of requesting an explanation of the unexpected code behavior. When I use kable_styling on console, the table is displayed as expected: white background, black font. However, when I run it within Rmd, the resulting table is white background and white font, that can only be seen if you highlight it. I fixed this by simply adding table.attr = "style = \"color: black;\"", but can someone chime in why this strange behavior occur? Thank you.
893a69b7388315c7fc0a14516cfdf5575c38c4a5c4bb2dc2951171bab82b7c1d
['e2f26fec026744ca98aec623998afbcc']
The asset pack would include the database, possibly apps, domains, social accounts etc. I don’t yet know the details of the contracts the customers have but I would look to make good on any agreements they have with our comparable product, and comp’ them any subscription (ie. free of charge for life). For me, the important thing is that they are looked after & don’t lose out and happy advocates of value to us in and of itself.
fb042ac90c94b747803d3cdd2e4b041f89e01d481efd9c1267138e79df1e45c2
['e2f26fec026744ca98aec623998afbcc']
The following identity holds for all $a$ and $x$ using the principal branch: $$ \log x^a = a\log x + 2\pi i \left\lfloor \pi-\Im (a\log x) \over 2\pi \right\rfloor $$ e.g. for $a=2$, $x=-1$: LHS = $\log (-1)^2 = \log 1 = 0$ RHS = $2\log(-1)+ 2\pi i \left\lfloor \pi-\Im (2\log (-1)) \over 2\pi \right\rfloor$ =$2\pi i+ 2\pi i \left\lfloor \pi-\Im (2\pi i) \over 2\pi \right\rfloor = 2\pi i - 2\pi i = 0$ Everything is single valued and there is no problem. How can I perform the same calculation using multivalued logarithms? In other words, I want to use the (multivalued) identity: $$\log x^a = a\log x$$ for $a=2$, $x=-1$. I pick the same branch for both LHS and RHS, let's pick the principal branch (so that we can reuse the values calculated above), and then I add the $2\pi i n$ term for each logarithm and get: LHS = $\log (-1)^2 + 2\pi i n = 2\pi i n$ RHS = $2\log(-1) + 2\pi i \left\lfloor \pi-\Im (2\log (-1)) \over 2\pi \right\rfloor + 2\cdot 2\pi i m = 4\pi i m$ And we can see that LHS is not equal to RHS, otherwise $m$ would have to be half-integer. Where did I make the mistake? How can I make LHS equal to RHS using the multivalued approach?
c61de2b5df868494f25417855181eaac3abf9f4f260e47959b1ca292df470b6c
['e2fde9c428c54d9d8e5b8397c00af8c6']
After spending a day in a research, I finally found a solition of my problem. First of all I had to modify my entityManagerFactory() and transactionManager() beans: @Bean public LocalContainerEntityManagerFactoryBean entityManagerFactory() { LocalContainerEntityManagerFactoryBean factory = new LocalContainerEntityManagerFactoryBean(); factory.setJpaVendorAdapter(new HibernateJpaVendorAdapter()); factory.setPackagesToScan("foo.bar.web.domain"); factory.setDataSource(dataSource()); factory.setJpaPropertyMap(new HashMap<String, Object>() {{ put("hibernate.dialect", dialect); put("hibernate.hbm2ddl.auto", hbm2ddl); }}); factory.afterPropertiesSet(); return factory; } @Bean public PlatformTransactionManager transactionManager() { JpaTransactionManager transactionManager = new JpaTransactionManager(); transactionManager.setEntityManagerFactory(entityManagerFactory().getObject()); return transactionManager; } Also I totally removed my WebInitializerclass and removed @EnableWebMvc annotation from MvcConfig. In Spring-Boot it's not possible to have class extended from WebMvcConfigurerAdapter in classpath because if Spring-Boot find it, all automatic configuration related to SpringMVC will be skipped. Here is the final version of my MvcConfig class: @Configuration @ComponentScan("foo.bar.web.controller") public class MvcConfig { @Bean public MultipartResolver multipartResolver() { return new CommonsMultipartResolver(); } } I used the version of Spring-Boot application class which shown in doc: @SpringBootApplication(exclude = MultipartAutoConfiguration.class) public class Application extends SpringBootServletInitializer { public static void main(String[] args) throws Exception { SpringApplication.run(Application.class, args); } @Override protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { return application.sources(Application.class); } } Note, that in my case I had to exclude MultipartAutoConfiguration from auto configuration because I've already have this feature configured in MvcConfig. Bun it is also possible to leave it autoconfigured, but in this case I had to tune allowed file size in application.properties config file or add a MultipartConfigElement bean to my classpath.
033d2c7019706b94f76db38b75f4e24136288a3821c96651a568a01a73b2c434
['e2fde9c428c54d9d8e5b8397c00af8c6']
I found solution of my question in using org.apache.spark.sql.hive.HiveContext instead org.apache.spark.sql.SQLContext. Now following code works as expected: lazy val sc = ... // create Spak Context lazy val hc = new HiveContext(sc) val results = hc.sql("SELECT record_name as name FROM test_table WHERE day < current_date") results.take(10) .map(r => s"name: ${r.getAs("name")}") .foreach(println)
c9425d84b0157af9445c578f66bed61b081967fd85f0a177f656854530dd467e
['e31a877c34c1487f9fdff7cfd65ac46d']
Suppose $a\overline{a}\rightarrow\gamma$ is possible for a particle $a$ with a definite nonzero mass, $p_a^2=m^2>0$ ("mostly-minus" metric, $c=1$). Conservation of momentum implies $p_\gamma=p_a+p_{\overline{a}}\implies p_\gamma^2=m_\gamma^2=0=p_a^2+p_{\overline{a}}^2+2p_a p_{\overline{a}}=2m^2+2 p_a \cdot p_\overline{a}$ However, the scalar product on RHS is bounded from below: We have (boldface quantities are three-vectors) $p_a \cdot p_\overline{a}=E_a E_\overline{a} - \mathbf{p_a}\cdot\mathbf{p_\overline{a}}=\sqrt{m^2+\mathbf{p_a}^2}\sqrt{m^2+\mathbf{p_\overline{a}}^2}-\mathbf{p_a}\cdot\mathbf{p_\overline{a}}$ but since $m^2>0$ by assumption $\geq\sqrt{\mathbf{p_a}^2}\sqrt{\mathbf{p_\overline{a}}^2}-\mathbf{p_a}\cdot\mathbf{p_\overline{a}}=\|\mathbf{p_a}\|\|\mathbf{p_\overline{a}}\|(1-\cos(\angle(\mathbf{p_a},\mathbf{p_\overline{a}}))\geq\|\mathbf{p_a}\|\|\mathbf{p_\overline{a}}\|(1-1)=0$. Hence, $0\geq2m^2>0$, which is a contradiction.
64c827e44bd920a174a3b80e448d80d4d74d0057c505e03ca59355635d1bb720
['e31a877c34c1487f9fdff7cfd65ac46d']
So basically I have a large set of features corresponding to a metric - like many ML problems. What I want to know is: can we correlate the variance of metric with the variation in each feature. ex: I have features x, y, z that produce an output say 10. When I vary x, no matter how much I vary it, the output stays relatively close to 10. However, when I vary y the output is heavily influenced. Is there a good technique to be able to assign a value correlating x and/or y to the metric? I'm mostly looking for direction here.. i.e. techniques or relevant papers. In my experience I haven't really come across this problem. I don't have a good solution in my toolbelt. Thanks!
74846e4bcb5ae8c0d3f140c732b7c7d3cf153fa3d4183775ee0aabd9be15dd67
['e33abd7a0309468d9b256c1e241d9624']
I'm trying to find all files and folders in a certain folder and all sub-folders and replace all special characters. All spaces should be replaced with dots and everything else should just be deleted. I've tried a few different ways but when I use "mv" it doesn't seem to preserve the directory structure and when I use "rename" along with "find" it doesn't want to go recursively. The closest I've gotten is this: for f in **/; do mv "$f" `echo $f | tr " " . | tr -dc '[:alnum:].'`; done But I think the loop is broken somewhere as it adds filenames together and places the result in the parent directory.
145615ed018e1d86f385f9c6c37c417d8ebf26e1c1e9e13987a64a70911e3037
['e33abd7a0309468d9b256c1e241d9624']
I'm working on a project where I need to search through hundreds of word documents for a list of strings that are in the title and add the contents of those documents to a new word file. It's not just text but charts and drawings too. I have the following but it keeps corrupting the word doc. I was thinking about trying to convert to another format like xml and add that to a word doc but wasn't sure if that would work. $list = Get-Content O:\Users\me\Downloads\list.txt Foreach ($obj in $list) { $nxt = Get-ChildItem -Path O:\Users\me\Downloads -Recurse -Filter "*$obj*" Add-Content -Path O:\Users\me\Downloads\PowerShell.docx -Value $nxt}
dedb97795b4cff3e7f561da2d622966babfbd70398a085fb1a00b7aab67e9cc0
['e33cd1b8e3514b739422c9470e1a1c61']
Stateflow charts are often used within Simulink, and reside inside an S-function (a block inside Simulink with time dependent inputs/outputs). Each S-function will then be an instantiation of the statechart. Normally these form a simulink model, with blocks connected by lines. Although I think it is also possible to do this dynamically, this would be far outside of the comfort region of the tools intended usage. I've decoupled simulink (and stateflow blocks) from simulink models by using libraries. I can instantiate many of them (graphically) and update them separately from the models in which they
d1c84cdca3d52e674ec0058b64d4eccaa00bd1ec365d1fc2a7ec2efa8c0fd425
['e33cd1b8e3514b739422c9470e1a1c61']
How many times is logging_level referenced? The process is called refactoring. If the change is trivial, a good regular expression can be used in your favorite editor. But often the code has many variations on the same theme. In this case, all of them can be found through logging_level. You can phase them out by hiding the value of logging_level for code (so you'd get a compiler warning, but it'd still work). Or use an editor like source-insight, which can show you all references in one go. Some examples of variations (which would be hard to find with a script): if ( logging_level >= LEVEL_FINE ) printf("Value at %p is %d\n", p, i); if ( logging_level >= LEVEL_FINE ) { calculated_value = i*2/3; printf("Value at %p is %f\n", p, calculated_value); } (note the brackets and the calculated variables). For each file with the old construction, you can do a search replace: search for : if \(\s*logging_level\s*>=\s*(LEVEL_[a-zA-Z]+) replace with : do_log2(\1,) It is possible to include the printf, but only if your editor supports multi-line patterns.
d6b395395b44d1d6afe91fb3300bd86fecbe8cb47f173e1d17c1f7766dacd1a4
['e34c698338e943baa24b47d969ebef07']
Okay -- I got past this one. Like some other problems (nativescript fails to run with an exit code of 0), and an android build problem related to conflicts with duplicate static class names, the problem can be solved if I do a full fresh git clone of my repository into a new directory and building from there. Obviously, there is some issue with a generated file somewhere along the line, but I haven't done a full diff analysis or anything to figure out what. Anyway -- if anyone else has similar issues, try starting from a completely new state like this. Maybe in some glorious future, these mystery problems with using NativeScript will be thing of distant memory, but for now, a series of voodoo workarounds to get through the day appear to be the norm from time to time.
f1a741c4f44bf054f46dbf334e7dee799acfe3bf0c2eb4d7ee0a96ebc4e19dc6
['e34c698338e943baa24b47d969ebef07']
I am using NativeScript 6.4.1 and am up to date, with iOS platform version 6.4.2 I have been building and deploying to my IOS device regularly. But today I find I can't. It simply hangs trying to install the app (It does manage to force the previous version of the app to uninstall, so now I don't even have the old version on my phone). Yes, I have the provisioning all set properly. If I change any of that, I get an error, as expected. Here, with everything in place, I get no error, just a hang: Project successfully built. The build result is located at: /Users/sohmert/tbd/sniff/platforms/ios/build/Debug-iphoneos/sniff.ipa Installing on device 000080XX-000XXXXX3A92XXX... I can still run it on the iOS emulator. But I need to get it on my device again for some real-world testing. About the only thing I can think of that has changed in the past few days for me is that I did do a series of updates that included an update to Xcode. Xcode currently reports as version 11.4. Could that be the problem? If so what do I do?
a3479f068e1863d73934194bb7d7eac07c2a7881efcea9428e4e2676e0d83a2b
['e3534ccea3e040b9b66944f7ce57df01']
Hi guys I have created a stipe payment method a it works fine but I want to upgrade to the stripe v3 but I don't how tp convert my old method to the new one I look at the doc be they are not so clear here is my old code I am using Altorouter and illuminate for database and blade template engine Vue for front end and axious for HTTP My route $router->map('POST', '/cart/payment', 'App\Controllers\CartController@Payment', 'Payment'); my cart.blade.php file <button @click.prevent='checkout' class="btn btn-outline-success">Checkout - <i class="fa fa-credit-card" aria-hidden="true"></i></button> <span id="proporities" class="hide" data-customer-email='{{ user()->email data-stripe-api='{{ \App\Classes\Session<IP_ADDRESS>get('stripe_key') }}'> </span> after this button get click I take the information to cart.js here is the cart.js code var stripe = StripeCheckout.configure({ key: $('#proporities').data('stripe-api'), locale: 'auto', token: function(token) { var data = $.param({ stripeToken: token.id, stripeEmail: token.email }); axios.post('/cart/payment', data).then(function(response) { $('.notifty').css('display', 'block').delay(2000).slideUp(300).html(response.data.success); app.showcart(10); }).catch(function(error) { console.log(error) }); } }); var app = new Vue({ el: '#cart', data: { amount: 0 }, methods: { checkout: function() { stripe.open({ name: 'Cartzilla Store Inc.', description: 'Your Shopping Cart', zipCode: true, amount: app.amount, email: $('#proporities').data('customer-email') }); } in the cart.js axious take to information to PHP controller which I have defined in the top route here is the controller code public function payment() { $array = []; if (Request<IP_ADDRESS>has('post')) { $request = Request<IP_ADDRESS>get('post'); $email = $request->stripeEmail; $token = $request->stripeToken; try { $customer = Customer<IP_ADDRESS>create([ 'email' => $email, 'source' => $token ]); $amount = convertMoney(Session<IP_ADDRESS>get('carttotal')); $charge = Charge<IP_ADDRESS>create([ 'customer' => $customer->id, 'amount' => $amount, 'description' => user()->fullname . 'Cart Purchase', 'currency' => 'usd' ]); $orderId = strtoupper(uniqid()); foreach ($_SESSION['user_cart'] as $items) { $productId = $items['product_id']; $quantity = $items['quantity']; $product = Product<IP_ADDRESS>where('id', $productId)->first(); if (!$product) { continue; } $totalPrice = $product->price * $quantity; $totalPrice = number_format($totalPrice, 2); Order<IP_ADDRESS>create([ 'user_id' => user()->id, 'product_id' => $productId, 'unit_price' => $product->price, 'status' => 'pending', 'total_price' => $amount, 'order_no' => $orderId, 'quantity' => $quantity ]); $product->quantity = $product->quantity - $quantity; $product->save(); array_push($array, [ 'name' => $product->name, 'price' => $product->price, 'quantity' => $quantity, 'total' => $totalPrice, ]); Payment<IP_ADDRESS>create([ 'user_id' => user()->id, 'amount' => $charge->amount, 'status' => $charge->status, 'order_no' => $orderId ]); } Session<IP_ADDRESS>remove('user_cart'); echo json_encode(['success' => 'Thank You we Have Recevied Your Payment And Now Processing Your Order']); } catch (\Throwable $th) { //throw $th; } } } apart from this, I have to model to for order table and payment table and here are the model Order.php <?php namespace App\Models; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\SoftDeletes; class Order extends Model { use SoftDeletes; public $timestamp = true; public $fillable = ['user_id', 'product_id', 'unit_price', 'qunatity', 'total_price', 'status', 'order_no']; public $date = ['deleted_at']; } and Payment .php <?php namespace App\Models; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\SoftDeletes; class Payment extends Model { use SoftDeletes; public $timestamp = true; public $fillable = ['user_id', 'amount', 'status', 'order_no']; public $date = ['deleted_at']; }
e5f3ee3c110d6217bd9974cd1a5e7c20c910b035c961798196557181d685f892
['e3534ccea3e040b9b66944f7ce57df01']
I want to add a new font in TinyMCE editor which are display in font dropdown and apply to edit text. I have used a direct link I am new to PHP I have done some online research but most people post the insert the font in TinyMCE folder but I do not have the folder I used the direct link
9b5114bf2aed7bb9797efc3850eb9a5422fecf1a59b25237ece656abcfce14c6
['e35b48f90f4a478faa5a391f97db0b3d']
Why aren't those <PERSON> interpretations models? What I don't get is the second element in the tuple - what is that relation? Why is it a set of sets and how do you compute it? Also - if U={c} is the Herbrand universe. Does not it mean that I can only use c as x and get R(c) and not R(c) and thus the Herbrand model does not satisfy the statement? If so, isn't it known that if an "exists" statement (statements with only "exists" quantifers) is not satisfied for Herbrand, it means that it does not apply to any other model because Herbrand is the smallest model?
0336f10639055d9d281def2af7026a826fe1664dd48233f5ccd6a55fa53a18d7
['e35b48f90f4a478faa5a391f97db0b3d']
Let $\left(V,||\cdot||\right)$ be norm space. Let $A\subseteq V$. We define the Convex of A to be: $$Conv(A)= \{\sum^n_{j=1} \alpha_j v_j : N\geq 1, \alpha_1,...,\alpha_N\ge 0,\sum^n_{j=1}\alpha_j =1, and v_1,...,v_N \in A \} $$ The smallest convex set which contains A. I need to prove that if A is finite then Conv(A) is compact. My try: There's non-countable amount of elements in conv(A). Let $c_n$ be a sequence in Conv(A) $c_1,c_2,c_3,...$ $$c_1=\alpha_{11}v_1,\alpha_{12}v_2,...,\alpha_{1N}v_N$$ $$c_2=\alpha_{21}v_1,\alpha_{22}v_2,...,\alpha_{2N}v_N$$ $$c_3=\alpha_{31}v_1,\alpha_{32}v_2,...,\alpha_{3N}v_N$$ $$\vdots$$ Note that for each line $\alpha_j \in [0,1]$. We denote the "column sequence" of coefficients $alpha_{11},\alpha_{21}...$ with $C_{n}(1)$. and the "column sequence" of coefficients $\alpha_{12},\alpha_{22}...$ with $C_n(2)$ and so on for each column. As we can see from Conv(A) definition we have that for every $k\in\mathbb{N}$ and $1\le n \le N$ - $\alpha_{kn}\in [0,1]$ , we know that $[0,1]$ is compact and hence every sequence in $[0,1]$ has a a convergent subsquence. So there exists strictly increasing sequence in $\mathbb{N}$ , $n_k$ such that $C_{n_{k}}(1)$ converging to some $x_1 \in [0,1]$, Now we look at $C_{n_{k}}(2)$ we know it has convergent sub sequence to some $x_2$ in $[0,1]$ we do that again and again N times and then we have a subsequence in Conv(A) that converges to an element in Conv(A). I'm struggling with making it formal. Thanks in advance.
57caa708c10f7336ec6c2107a8a60db5911774b977a8731c8cf5974d93137c03
['e3964c25dc414e3aa63d3c6fa1d45d6a']
Chinese have decided to ripoff a PIC product I make. Switching to ARM for other reasons anyhow, mainly that Microchip is a joke, either STM32 or NXP LPC, exact chip is open still. There are sites that claim to have vulnerabilities for various Cortex chips. As I understand it, there could be a decapping process where the die is exposed and messed with There could be a JTAG/SWD hack with a special process or over/under voltage exploit, I don't know this exists for ARM, but I know it's possible on other chip (F U PIC) There is also a non-removable bootloader on almost all consumer ARM Cortex parts. I think STM32 is a USB and serial bootloader. NXP or Freescale or someone have a full Mass Storage Class bootloader. Since the code is kept hidden, there could be an undisclosed exploit there too. Is there anything I can do to keep my code secure? Almost no one in my industry would have any idea what to do even if I handed them the C code. It's Chinese knock-offs / clones I need to worry about since they are using our name, logos, cloned hardware, my code, and undercutting official dealers. The plan I have currently is to require online authentication. So that if I see a chip that isn't on my masterlist, I burn it with bad firmware. If I see a duplicated chip I verify the original and burn the clones. If the chip is valid, I like it to the user's info and move along. The legit user should see nothing but an interface for their product. With the above idea, some one ripping us off would still get the ROM so I still have the encryption keys in the wind. While the module wouldn't really work without using it online as the interface, it's still annoying and a potential issue. One consideration is the Chinese haven't been willing or really likely able to replicate the code without 1:1 ripping it. So I sort of think it's a leap to assume they'd rip my code, then go to reverse engineering, because that just doesn't seem like the same class of criminal that's cloning our stuff. I think they attacked us because it's such simple PCB and the code was easy to get. They likely aren't going to also reverse all the online work to make an offline interface for it, I don't think anyhow. Thoughts on anything else I could do?
205b43955eafa7e2032a04fc1023c3abbb7ecee7f3cb0e8d7ea6531f12c245b3
['e3964c25dc414e3aa63d3c6fa1d45d6a']
Consider the measure space $(\mathbb N, \mathcal P(\mathbb N), \tau)$, where $\tau$ is the counting measure. I've decided the system $\mathcal N_\tau$ of $\tau$-nullsets as the empty set. I must show that for any function $f \in \mathcal L^{1}(\tau)$ the identity $$\int_{\mathbb N} f(n) \tau(dn) = \sum^{\infty}_{n=1} f(n)$$ holds, where the infinite sum converge absolutely. Here $\mathcal L^{1}(\tau)$ denote the set of <PERSON> integrable functions, such that both the positive and negative parts are integrable with value less than $\infty$. I've tried using a main theorem of dominated convergence by <PERSON> but without luck. Can someone help me out ? Also if $f \in \mathcal L(\tau)$ then the limit $$\lim_{N \rightarrow \infty} \sum_{n=1}^N f(n)$$ exist in $[-\infty, \infty]$, and we have $$ \int_{\mathbb N} f(n) \tau(dn) = \lim_{N \rightarrow \infty} \sum_{n=1}^N f(n)$$ Here $\mathcal L(\tau)$ denote the set <PERSON> integrable functions, such that either the positive part or the negative part is integrable with value less than $\infty$.
37cebec2f50db75fa941947efba0e557615faff283f93e9058353c327aaea9fb
['e397407660b643ff8afd7b00b3052331']
Если нужно асинхронно дождаться метод, то нужно ставить await, которые в свою очередь требует модификатор async. И так возникает цепочка из методов с модификатором async, что как-то бросается в глаза и кажется, что что-то тут не то. Вопрос в том: "Пирамида" из async модификаторов- это нормально или может когда-нибудь потребоваться синхронно дождаться результата через wait?
5c931f09419f40efdf71336a64ec25135de6a27f777c2d9ae0a774a8d597c827
['e397407660b643ff8afd7b00b3052331']
Not sure if Samsung added that feature in your rom, but this thing are provided as features from manufacturers. If your device lacks this feature, wait till new update. Or you can install new rom for your device which have this feature. But it is risky as rooting and flashing new software involves.
33ae307ccfe555d14f6e429f9ad10d2f87240ed5a988f281eb61c158390a8d71
['e3b65d3701ef4616ae65381254dc2053']
Well it is not my principle, the fact that i and -i can simply be swapped sounds like common sense in an entire expression WLOG. I know it can be proved rigourously for the specific applications I mentioned. Im also not asking if it can be generalized to any isomorphism. I was just asking if this principle has any name associated with it?
264faa9a97dc392131dc3ebf66395d4e5ed5c41c4f213c47d59338ca1cc171c9
['e3b65d3701ef4616ae65381254dc2053']
I'm looking for name of a theorem or principle in complex numbers which says something like the following, "Any algebraic expression can be replaced with its value in conjugate if every variable or constant is also replaced by its conjugate.". Proof is essentially because i and -i are arbitrarily chosen, and you can swap them without any loss of generality. Corollaries: $(\bar{z^n}) = (\bar{z})^n$ Conjugate root theorem. If $(a + bi)$ is a root of a real polynomial, then $(a-bi)$ is also a root. Because if you replace everything with its conjugate expression doesn't change. Sample Applications: If $a$ is non-zero real number then $a^i$ has modulo 1. Proof: \begin{align} y &= a^i \\ \bar{y} &= a^{-i} \\ \|y\|^2 &= y \bar{y} \\ &= a^{i-i} \\ &= a^0 \\ &= 1 \end{align} $i^i$ is a real number, Proof: \begin{align} y &= i^i \\ \bar{y} &= {(-i)}^{-i} \\&= \left(\frac{1}{i}\right)^{-i}\\&=i^i \\&=y \end{align} I can go on with several examples, but I assume the point is clear. I am looking for the name of the principle, and a more precise statement of the same.
1e9aa2baf2ce7e334b075b8a8b7f52b3fa0d13f70bd981168055b90749681de9
['e3d644771e4947f8a52e9ee9bf2f0a01']
Use Dataframe's as() method to remove ambiguity when referencing similar names. df.as("a").join(df.as("b"), $"a.mgr" === $"b.ID").show +---+-------+----+---------+-----+---+-----+---+-------+----+---------+-----+---+------+ | ID|country|dept| doj|ename|mgr| sal| ID|country|dept| doj|ename|mgr| sal| +---+-------+----+---------+-----+---+-----+---+-------+----+---------+-----+---+------+ |101| US| 11|1/12/2017|Peter|201|24.24|201| IN| 232|4/22/2016| John|111|1300.0| |301| KR| 22|5/22/2015| Sam|201| null|201| IN| 232|4/22/2016| John|111|1300.0| +---+-------+----+---------+-----+---+-----+---+-------+----+---------+-----+---+------+
c5ef2d8f467c1e3adf7e5a56e7593e8373f352d56310431d8bc707fb80ae7129
['e3d644771e4947f8a52e9ee9bf2f0a01']
If you're okay using pivot, this is quite straightforward. val df = Seq( (1, "First Name", "<PERSON>"), (1, "Last Name", "Shri"), (1, "Address", "Ayodhya"), (2, "First Name", "<PERSON>"), (2, "Last Name", "Shri"), (2, "Address", "Ayodhya"), (2, "Skill", "Archery"), (2, "Marital Status", "Married"), (2, "Age", "23"), (3, "First Name", "<PERSON>"), (3, "Last Name", "<PERSON>"), (3, "Address", "Ayodhya") ).toDF("userCode", "propertyName", "propertyValue") df.groupBy("userCode").pivot("propertyName").agg(first("propertyValue")).show +--------+-------+----+----------+---------+--------------+-------+ |userCode|Address| Age|First Name|Last Name|Marital Status| Skill| +--------+-------+----+----------+---------+--------------+-------+ | 1|Ayodhya|null| Ram| Shri| null| null| | 2|Ayodhya| 23| Laxman| Shri| Married|Archery| | 3|Ayodhya|null| Sita| Devi| null| null| +--------+-------+----+----------+---------+--------------+-------+
624ed34e6c6e755764ec2abc8a0413a7bef5490e8357836f4e07f7953f8210f6
['e3dde376cd8c46968ec8381160d958f9']
I'm trying to display data from my web using API. My API is working correctly. But some how i face this issue json.data is not a function. (In 'json.data()', 'json.data' is an instance of Array)]. Can I anyone help me on this? _loadInitialState = async () => { const token = await AsyncStorage.getItem('token'); const myArray = await AsyncStorage.getItem('language_type'); _onSetLanguage(myArray) var loadAll = this.props.navigation.getParam('loadAll'); if (loadAll == true) { this.setState({ isLoading: true }) } var have_access = this.props.navigation.getParam('have_access'); if (have_access != undefined) { this.setState({ have_access: have_access }) } if (staticData.get_centre_settings() != null) { this.setState({ have_access: true }) } let today = Moment(); this.setState({ today: Moment(today).format('YYYY-MM-DD'), }) // alert(FetchURL.get_baseURL() + "leave?centre_id=" + staticData.get_centre_settings().centre.centre_id) // alert(token) // return fetch(FetchURL.get_baseURL() + "leave?centre_id=" + staticData.get_centre_settings().centre.centre_id, { method: 'GET', headers: { 'Authorization': 'Bearer '+ token, } }) .then(response => response.json()) .then((json) => { // alert(json) if (json.error) { alert(json.error); } else { this.setState({ staffLeave: json.data(), isLoading: false }); } }) .catch((err) => { console.log(err) alert(err) // alert(strings.data_fail); }) this.setState({ view_access: true }) } I kept searching for this but couldn't find an answer that will make this clear. Thanks!
5ffdf9e37b0c15418efc5b27f64ef7d7acc40ff4b1b105db7724d96e141a9ae2
['e3dde376cd8c46968ec8381160d958f9']
I'm trying to understand the reason of this error message from postman when test API. When I am testing my REST API from postman, it gives me error ErrorException (E_NOTICE) Trying to get property 'staff' of non-object I try to find the problem but i can't find it. I kept searching for this but couldn't find an answer that will make this clear. Anyone can help me on this? Thanks! This my code snippet public function updatestatus($request, $leave, $is_api=0) { $status = $request->get('status'); $user = $is_api? JWTAuth<IP_ADDRESS>parseToken()->authenticate():Auth<IP_ADDRESS>user(); // $user = Auth<IP_ADDRESS>user(); $staff= $user->ref_user; $applying_staff = $leave->staff; $applying_user = $applying_staff->main_user; //Approved if($status==2 && $leave->status==1) { $leave->status =2; $leave->approved_by_staff_id = $staff->staff_id; $leave->approved_date = new Carbon('today'); $leave->save(); if($user->centre_id) Helper<IP_ADDRESS>ClearObjective(10,$user->centre_id); dispatch(new EmailJob($applying_user->email,new LeaveNotification(route('staff.leave.show',$leave->id), $leave->statusStr))) ->onConnection('database') ->onQueue('emails'); return response()->json(['Success'=>'Success']); //send email } // Rejected else if($status==3 && $leave->status==1) { $leave->status =3; $leave->status_rejected_reason = $request->get('reason',null); $leave->save(); if($user->centre_id) Helper<IP_ADDRESS>ClearObjective(10,$user->centre_id); $leave_cat = LeaveCategory<IP_ADDRESS>find($leave->leave_type); if($leave_cat->leave_status!=0) { $leave_ent = $applying_staff->leaves()->where('leave_type',$leave->leave_type)->first(); if($leave_ent) { $leave_ent->leave_remaining += $leave->leave_days; $leave_ent->save(); } } dispatch(new EmailJob($applying_user->email,new LeaveNotification(route('staff.leave.show',$leave->id), $leave->statusStr, $leave->status_rejected_reason))) ->onConnection('database') ->onQueue('emails'); //send email } //Cancelled else if(($status==4 && $leave->status==2) || ($status==4 && $leave->staff_id == $staff->staff_id)) { $leave->status =4; $leave->status_rejected_reason = $request->get('reason',null); $leave->save(); $leave_cat = LeaveCategory<IP_ADDRESS>find($leave->leave_type); if($leave_cat->leave_status!=0) { $leave_ent = $applying_staff->leaves()->where('leave_type',$leave->leave_type)->first(); if($leave_ent) { $leave_ent->leave_remaining += $leave->leave_days; $leave_ent->save(); } } dispatch(new EmailJob($applying_user->email,new LeaveNotification(route('staff.leave.show',$leave->id), $leave->statusStr,$leave->status_rejected_reason))) ->onConnection('database') ->onQueue('emails'); //send email } // return reponse()->toJson(compact('leave')); return $leave; } Calling API public function update(Request $request) { return $this->leaveApplicationRepository->updatestatus($request,1); }
430ac27810a64c7eaa41236e69416b49b66ace87a6309f8986c92d61f94ac660
['e3ef2a7a68be4e20a97c292d16b3d994']
I am attempting to request data from an endpoint however I am currently getting the following error. Any ideas how it can be resolved. REQUEST: Error: write EPROTO 140735243141888:error:140943F2:SSL routines:SSL3_READ_BYTES:sslv3 alert unexpected message:../deps/openssl/openssl/ssl/s3_pkt.c:1289:SSL alert number 10 var cert = '{location to my certificate}' var key = '{location to my key}' var fs = require('fs') , request = require('request'); function authCallback (error, response, body) { if (!error && response.statusCode == 200) { console.log(response.headers); } else { console.error("REQUEST: "+error) }; } var options = { url: 'https://some.endpoint.co.uk', agentOptions: { cert: fs.readFileSync(cert), key: fs.readFileSync(key), securityOptions: 'SSL_OP_NO_SSLv3' } } request.get(options, authCallback); Many Thanks
d9647c17fdcba1e3eebf223b5e577529949bbed34312fa86e0a5073c5547ecc0
['e3ef2a7a68be4e20a97c292d16b3d994']
I was hoping if someone could help. I am trying to write a test against a search feature, which when a user enters a few characters into the search box, you are provided with suggestions matching you entered criteria. In my example below I enter the words 'cel' into the search field and I get back 3 list items. The code does not error and the foreach loop returns all three items in the list however the 'suggestion.Click()' is not being executed and I don't know why. To give some context this is for a online greeting site. <li ng-click="goSearch('Autocomplete', 'keyword')" ng-bind-html="searchForMsg()" class="ng-binding">Search for <strong>"cel"</strong></li> <li ng-repeat="suggestion in (suggestions = (allFacetsAutoComplete.facets | typeahead:moonpigSearchBox.term))" ng-bind-html="highlight(suggestion.DisplayName)" ng-click="selectSuggestion(suggestion)" ng-bind="suggestion.DisplayName" class="ng-binding ng-scope"><strong>cel</strong>ebration</li> <li ng-repeat="suggestion in (suggestions = (allFacetsAutoComplete.facets | typeahead:moonpigSearchBox.term))" ng-bind-html="highlight(suggestion.DisplayName)" ng-click="selectSuggestion(suggestion)" ng-bind="suggestion.DisplayName" class="ng-binding ng-scope">jewish <strong>cel</strong>ebrations</li> [Then(@"I select the following list item '(.*)' from my search")] public static void PreSelectedListOptions(string value) { var suggestedList = Driver.Instance.FindElements(By.CssSelector(".list-reset li")); foreach(IWebElement suggestion in suggestedList) { if(value.Equals(suggestion)) { suggestion.Click(); } } } And I perform a partial search for 'cel' And I select the following list item 'ebration' from my search //Note: I have just copied a part of the scenario. Many thanks
1626d86886f17af060c3f42e57a3d71c5d91047a44c6c4622f5c408c799e1b7a
['e3f5fbd834c04b79a3b829913c26b65c']
I have a datagrid binded to a collection of custom objects. This datagrid allows the user to access a context menu when he right clicks a row. I do this through TextBlock styling: <Style x:Key="DatagridTextblockStyle" TargetType="{x:Type TextBlock}"> <Setter Property="ContextMenu"> <Setter.Value> <ContextMenu> <MenuItem Header="First action" /> </ContextMenu> </Setter.Value> </Setter> </Style> It also displays rows which might be disabled if the custom object's "IsActive" bool property is false. I do this through the DataGrid.RowStyle: <DataGrid ItemsSource="{Binding MyCustomObjects}"> <DataGrid.RowStyle> <Style TargetType="{x:Type DataGridRow}"> <Style.Triggers> <DataTrigger Binding="{Binding IsActive}" Value="True"> <Setter Property="IsEnabled" Value="False" /> </DataTrigger> </Style.Triggers> </Style> </DataGrid.RowStyle> </DataGrid> This works fine. The problem however is that when a row is disabled, the context menu is not available anymore. I can't find a way around that. Any ideas?
7be14b2e4e5b6423c799a0a68941e742177012ff0d5cbefedec6862156c9f050
['e3f5fbd834c04b79a3b829913c26b65c']
In my application, I create an excel file. To achieve this, I instanciate an Microsoft.Office.Interop.Excel.Application variable and set its Visible member to False. When I have done this, I see my EXCEL.EXE process in the task manager. The problem is I have to let this variable live throughout the application execution lifetime. So when I open an excel file outside of this application, it uses the Excel instance already existing and, because I set the Visible to false when creating it, I can't see my opened file. Is there any way I can create my Excel instance in my application whilst saying "don't let this instance being used outside the application, if someone wants to open an Excel file outside of it, it can't use this instance, it must create a new Excel instance" ? Thanks internal Application _application; _application = new Application() { Visible = false, DisplayAlerts = false, ScreenUpdating = false };
0af4aaa151c1d77f1c039f7506d3fafee1f0d9ac78331f97787d724f486812e8
['e3fe143632d545e1bb7b0daa1b62db16']
i am trying to implement the naive bayes algorithm in java. But i have a few confusions on the naive bayes model. What is the model of naive bayes? Is it a table ?how we can make prediction from the model? I can implement the algorithm in java code and make prediction.But i heard that's not the right way to do it. we should make prediction from the model ..but how ??If anyone have some idea about this,kindly please try to give an answer to this . And also, how can we split the training set and test set from the dataset ??? Thank you.
0ca786309367fa5e3ac72929b109ab50a320f007854dc033a82cf110a72f34ab
['e3fe143632d545e1bb7b0daa1b62db16']
I am trying to deploy a flow to a sandbox and I am getting the error Property 'storeOutputAutomatically' not valid in version 48.0 The sourceApiVersion specified in my sfdx-project.json file is 48.0. The <apiVersion> in our package.xml is 47.0. However, this flow has contained the <storeOutputAutomatically> tag for the last month, and has not failed validation for this sandbox. The sandbox has not been refreshed. We have not made changes to the package.xml version or the sourceApiVersion in the sfdx-project.json file in at least a month. Also, the documentation for the storeOutputAutomatically field on the FlowActionCall metadata type says the field is available in API version 48.0 and later: What could be causing this sudden validation failure?
6927ed9ff096b359e54db49c6f24645ab9b9cb8e0c771c11e1148f8a530189ba
['e4017dc7608f4d0eba26c80149000cef']
2017-01-02 14:53:21 WARNING OGG-00869 Oracle GoldenGate Delivery for Oracle, reptar.prm: No unique key is defined for table 'BANKUSERSLOGIN'. All viable columns will be used to represent the key, but may not guarantee uniqueness. KEYCOLS may be used to define the key. 2017-01-02 14:53:51 ERROR OGG-00665 Oracle GoldenGate Delivery for Oracle, reptar.prm: OCI Error getting OCI_ATTR_NAME for UDT SYS.XMLTYPE (status = 24328-ORA-24328: illegal attribute value), SQL. 2017-01-02 14:53:51 ERROR OGG-01668 Oracle GoldenGate Delivery for Oracle, reptar.prm: PROCESS ABENDING.
d3a5f53f1928be63f0a6b135574b519ac0c18a9f839eb96f4bbb52f8e8fae59d
['e4017dc7608f4d0eba26c80149000cef']
In Oracle Golden Gate, I'm unable to replicate production sequence to replicate database, since as sequence increased by 1 in production, the count of sequence in target increasing by 2. Let me elaborate, suppose I have sequence with currval 190, assume after initail load, target sequence also have currval 190. Now I booked a deal and sequence no get increased by 1 in production, currval is 191 but when i checked in target db, sequence currval showing 192. This creating issue. Need help in resolving this...
5c5a38c529d2297f2d6a9e016bc1d856f6aa79ed658c3e19c47760dc570ba759
['e4037125c7864a82964fcb0ce9bf697e']
I assume you want the Scrollspy to apply as soon as a section comes into the viewport. I suggest you to use the data-offset-tag and set it to the viewport height. Just add the following to you body-tag (which is the element you spy on): data-offset="$(window).height();" Your body opening tag then should look like this: <body data-spy="scroll" data-target="#navbar" data-offset="$(window).height();" style="zoom: 1;">
bfd86fb544bd9edccdc3669d445784e97fcc2e9390a5761f3bc6e1c8e9716e43
['e4037125c7864a82964fcb0ce9bf697e']
I'm displaying an element on scrolling down and hiding it when scrolling up again. Without using setTimeout, this works just as expected. However, using setTimeout causes the 'display' class to be added and removed in short intervals when scrolling down. How can I avoid this while keeping the delay? onscroll = function() { var scrollTop = document.documentElement.scrollTop || document.body.scrollTop; if (scrollTop > 110) { menuButton.classList.add('display'); } else { setTimeout(function() { menuButton.classList.remove('display'); }, 400); } }
6475d854869b1fce7b9b5862d4aab84df33a3417446f767b2f4f84cc0d186f95
['e410629be73e43c3a09a8620b6f93d1e']
As far as I know, there is no way to differentiate on the execution time of certain lines within the same file since you schedule tasks per file that should be run. But I might be able to make the exchange of data between the different files a bit easier. When you only have one data object to exchange between scripts: #script_OnceAweek.R x = 1:10 saveRDS(x, file = "file.csv") #script_Every30min.R k = readRDS("file.csv") y = k*5 If you have multiple data objects: #script_OnceAweek.R x = 1:10 y = 4:6 save(x, y, file = "file.csv") #script_Every30min.R load("file.csv") k = x y = k*5 The first solution will save to a .RDS file and the second will save to .Rdata file. The nice thing about this is that you can save all R data types and also load them as R data types. This means that you could even save objects like lists of data frames for instance. When you would use csv's for this, it would become very complicated.
7285d09641ecf33e6f10892096bf3b9ff160fe5fc6fd520d96d09440f1f80ae1
['e410629be73e43c3a09a8620b6f93d1e']
The problem is that your input variables are strings while rnorm takes numeric arguments. You can see how it works if you use 1 as input variables and cast this to numeric at the server side. Now if you change the value in the input box the error 'invalid arguments' will appear again. This is because you will have the same problem as before where you try to give a character as argument for rnorm. Run the example below to see it for yourself. library(shiny) ui <- fluidPage(titlePanel("NFL Combine players"), selectInput(inputId = "num", label = "Choose a Stat", choices = c("1", "Wt", "Vertical", "forty", "BenchReps", "Cone", "BroadJump", "Shuttle")), selectInput(inputId = "pos", label = "Player Positions", selected = 5, choices = c("1", "CB", "DB", "DE", "DT", "EDGE", "FB", "FS", "G", "ILB", "K", "LB", "LS", "NT", "OG", "OL", "OLB", "OT", "P", "QB", "RB", "S", "SS", "TE", "WR")), plotOutput("hist", click = "plot_click") ) server <- function(input, output) { output$hist = renderPlot({ hist(rnorm(as.numeric(input$num), as.numeric(input$pos))) }) } # Run the application shinyApp(ui = ui, server = server)
9e817e3aff200f559c3b83ac610159d2984621117e410012f7f3b8798a9a17f5
['e412226164a6400d8e5c3f9e505a5f8c']
When I compile my LaTeX Document locally with arara it works! But when I put it into Docker (Fedora) I only get this Emergeny-stop: This is XeTeX, Version 3.14159265-2.6-0.999991 (TeX Live 2019) (preloaded format=xelatex 2020.10.21) 22 OCT 2020 00:31 entering extended mode restricted \write18 enabled. %&-line parsing enabled. **thesis.tex ! Emergency stop. <*> thesis.tex End of file on the terminal! Here is how much of TeX's memory you used: 2 strings out of 494894 16 string characters out of 6177061 56151 words of memory out of 5000000 4029 multiletter control sequences out of 15000+600000 3640 words of font info for 14 fonts, out of 8000000 for 9000 14 hyphenation exceptions out of 8191 0i,0n,0p,1b,6s stack positions out of 5000i,500n,10000p,200000b,80000s No pages of output. ~ ~ texput.log: __ _ _ __ __ _ _ __ __ _ / _` | '__/ _` | '__/ _` | | (_| | | | (_| | | | (_| | \__,_|_| \__,_|_| \__,_| Processing 'thesis.tex' (size: 9 KB, last modified: 10/21/2020 21:07:49), please wait. (Clean) Cleaning feature ................................ SUCCESS (Clean) Cleaning feature ................................ SUCCESS (Clean) Cleaning feature ................................ SUCCESS (Clean) Cleaning feature ................................ SUCCESS (Clean) Cleaning feature ................................ SUCCESS (XeLaTeX) XeLaTeX engine ................................ FAILURE Total: 0.78 seconds I tried to install full TexLive, to get sure I've all packages installed, but it did not work. It looks like batch mode (no error msg) so I tried: % <PERSON>: <PERSON>: { interaction: errorstopmode } % !TEX TS-program = <PERSON> % <PERSON>: clean: {files: [thesis.pdfsync, thesis.bbl, thesis.aux, thesis.toc, thesis.pdf]} % <PERSON>: <PERSON>: { interaction: errorstopmode } % <PERSON>: nomencl % <PERSON>: <PERSON> % <PERSON>: <PERSON> % <PERSON>: <PERSON> % <PERSON>: xelatex: { interaction: errorstopmode } % arara: <PERSON>: { interaction: errorstopmode } % <PERSON><PHONE_NUMBER> OCT 2020 00:31 entering extended mode restricted \write18 enabled. %&-line parsing enabled. **thesis.tex ! Emergency stop. <*> thesis.tex End of file on the terminal! Here is how much of TeX's memory you used: 2 strings out of 494894 16 string characters out of 6177061 56151 words of memory out of 5000000 4029 multiletter control sequences out of 15000+600000 3640 words of font info for 14 fonts, out of 8000000 for 9000 14 hyphenation exceptions out of 8191 0i,0n,0p,1b,6s stack positions out of 5000i,500n,10000p,200000b,80000s No pages of output. ~ ~ texput.log: __ _ _ __ __ _ _ __ __ _ / _` | '__/ _` | '__/ _` | | (_| | | | (_| | | | (_| | \__,_|_| \__,_|_| \__,_| Processing 'thesis.tex' (size: 9 KB, last modified: 10/21/2020 21:07:49), please wait. (Clean) Cleaning feature ................................ SUCCESS (Clean) Cleaning feature ................................ SUCCESS (Clean) Cleaning feature ................................ SUCCESS (Clean) Cleaning feature ................................ SUCCESS (Clean) Cleaning feature ................................ SUCCESS (XeLaTeX) XeLaTeX engine ................................ FAILURE Total: 0.78 seconds I tried to install full TexLive, to get sure I've all packages installed, but it did not work. It looks like batch mode (no error msg) so I tried: % arara: xelatex: { interaction: errorstopmode } % !TEX TS-program = arara % arara: clean: {files: [thesis.pdfsync, thesis.bbl, thesis.aux, thesis.toc, thesis.pdf]} % arara: xelatex: { interaction: errorstopmode } % arara: nomencl % arara: biber % arara: biber % arara: biber % arara: xelatex: { interaction: errorstopmode } % arara: xelatex: { interaction: errorstopmode } % arara: clean: {files: [thesis.pdfsync, thesis.out, thesis.toc, thesis.lot, thesis.lof, thesis.bbl, thesis.nls, thesis.nlo, thesis.aux, thesis.idx, thesis.ilg, thesis.ind, thesis.bbl, thesis.bcf, thesis.ist, thesis.blg, thesis.run.xml, thesis.fdb_latexmk, thesis.fls]}
17ac9ee00682d6e22b0fec756bbc97e13f79bf182a4073318414f6050d824ed8
['e412226164a6400d8e5c3f9e505a5f8c']
I am using openvpn very happily, I have more than 50 vpn defined on a debian jessie machine. I have a question regarding the ability to map some route to some process. I would like to known which tun interface is mapped to which openvpn process. At this time my only solution is to scan the syslog searching for some string like /ovpn-([^\[]*).*(tun\d+)/, where I can mostly retrieve every things at boot time but it is not clean, and informations disappear as log get cleaned up. So is there a way to map the tun device to the openvpn process ? I can not find in /proc/{openvpn process}/*
4151fd7922899eeef1bf33aa22275df1f4f0b2013a486596a2ce70e4bcf6daa1
['e44ba18de4ea43d4a7f642f138b31687']
Recently I have taken up an interest in learning "bare-metal" development for ARM processors using native assembly. I bought a Raspberry Pi Zero which features an ARM11 processor, and am currently looking for a toolchain to assemble and link my code. It says on this page that only the A, R and M profiles are supported by the GNU Toolchain for Arm Processors, but I have come across this source which indicates that GCC is capable of compiling code for Arm architectures all the way back to ARMv4, and indeed supports the processor that I want to compile for (ARM1176JZF-S). Is there something I'm missing here? These are conflicting sources, are they not? And if the GNU Toolchain does not in fact support the ARM11 processor, what other options do I have?
34bb9a039f9392ae36ced32d76a0d41e64b696f5f9b821c0eb0f0eb9d0922ae3
['e44ba18de4ea43d4a7f642f138b31687']
I would try putting your code into the Arduino IDE and enabling verbose output in the File>Preferences menu, then uploading your code to the Arduino and looking at the output. If the upload is successful and the program works, you will be able to see the commands that were used to compile and upload your program to the Arduino.