Lemon

0

votes
0

answer
3

views

Can an assembly generated using CodeDomProvider be deallocated?

I want to code an app that allows the user to define GUI driven code snippets. In this context, I aim to send these snippet definitions to a service which will be able to compile and run it (code dom, code dom provider, ...) for several purposes. As these compiled assemblies will be generated many t...
lemon
1

votes
0

answer
20

views

Add exception to complicated regex

There is a very complex regular expression. But I have a problem with it. The # and ++ characters are removed if there are letters after them. Question: How to add an exception to current regex for (C++ and C# tokens)? I've used the next regex: import re text = 'Must-have skills: -.Net programming e...
lemon
1

votes
0

answer
6

views

How to create index based on nested array element in C# Mongodb strongly typed driver

This question is quite on the same principles as this one but I'd like to create an index using strongly typed approach on an object property when this object is nested in an array of the collection. I can use: new CreateIndexModel( Builders.IndexKeys.Ascending( a ) ) where a is an Expression which...
lemon
1

votes
2

answer
4.1k

views

Android java.lang.SecurityException occured

I am new in Android. And I am Working On Dialer Through Launch Application. And I hide my Application Icon From the Menu. I successfully open the Application from Dialer In jellybean And Kitkat Device but when i open Application in Lollipop and Marshmallow System getting me Exception like, E/GoogleP...
Lemon Android
1

votes
3

answer
758

views

Rounded corner <select> drop down

I am trying to curve select drop down box option. So far, I have achieved a styled effect within the drop down box itself (the box that drops down with the options) by applying certain styles to the select tag but I want to give border-radius in options. Here is the css I have used so far any sugges...
Lemon Kazi
1

votes
2

answer
87

views

Passing data from controller to another controller

I am working on sails JS application. Is there anyway to pass a data from another controller using sails JS? // controller 1 exports.module{ passing data to controller 2 } // controller2 exports.module{ get data from controller 1 } or better, is there anyway to create a global variable which can...
Lemon
1

votes
3

answer
67

views

Regex - No repeation of period and comma and hyphen

I am trying to create a regex for addresses. I currently have [a-zA-Z0-9-\\.\-\,\\-\s\n], but it matches the repeating period, repeating hyphen, and repeating comma. Is there any way I could limit the count of comma, hyphen, and period to 1? It should match '5432 Lorem St. Tokyo, Japan 1234-54' a...
Lemon
1

votes
2

answer
50

views

Site breaking down 2 seconds during load

Hi I have a wordpress websitse. When I try to visit that site it breaks down full layout for minimum 2 seconds. I can't understand why this is happening. I tried to use Javascript to footer plugin. Please suggest me what happened here. And what can I do in this situation.
Lemon Kazi
1

votes
1

answer
9.6k

views

how to pull message data from discord.js?

Discord.js is an API for Discord that allows the developers to make plugins for the program, discord. here's the link to the API code it's in js, https://github.com/hydrabolt/discord.js/ Discord is setup to be like a server where you connect and chat on channels, my problem is how do I pull the mess...
Electro lemon
1

votes
1

answer
124

views

Count click inside iframe javascript

I want to count click set condition and display message for 2 condition. If first time click it will display message 'clicked'. I clicked second time it will display 'paused clicked'. I am trying this code. It's detecting click inside iframe but not following condition. var action = 1; var monitor...
Lemon Kazi
1

votes
1

answer
319

views

.NET Detecting a Logon event in Windows 10

I've been getting a little stumped on this issue. I have a need to detect when a user logs on, when the Display is Locked, and when the user logs off. In the past I've used a VB.NET application which uses a COM reference to Sens ( System Event Notification Service ) which makes use of the Sens Event...
Lemon-d
1

votes
2

answer
498

views

Comment out appSettings on web.config using PowerShell

I would like to know if someone can perform commenting out this section on appSettings using PowerShell. Sample code below: (just an example, not really my code) I want to comment out this section: resulting like this: Hope you guys (especially PowerShell nerds out there) can help me. Thanks a lot!
1

votes
1

answer
182

views

An FFMpeg function on azure is not handling simultaneous calls (more than 5)

I created a c# httptrigger function on azure which uses FFMpeg to add subtitles to a video, and then just output the video locally (nothing fancy, all the files are in the local resources for the function, and the output is there as well). The process runs perfectly fine when I test it, I made a C#...
The Lemon
1

votes
1

answer
454

views

lambda function email not sending through nodeJS

After checking some tutorial I tried to implement a nodeJS function. And after compiling that code I didn't find any error and it's passing email sent message. But after checking my inbox I didn't find any email. Please suggest me where I did mistake. console.log('Version 0.1.3'); var aws = require(...
Lemon Kazi
1

votes
2

answer
280

views

How to choose optimal threshold for class probabilities?

My output of neural network is table of predicted class probabilities for multi-label classification: print(probabilities) | | 1 | 3 | ... | 8354 | 8356 | 8357 | |---|--------------|--------------|-----|--------------|--------------|--------------| | 0...
lemon
1

votes
1

answer
27

views

tkinker unbind doesn't seem to unbind

I have this code: def on_click(event=None): c.unbind('') c.config(background='red') print ('You clicked the square') time.sleep(delay) c.config(background='green') c.bind('', on_click) root.update() root = tk.Tk() c = tk.Canvas(root, width=200, height=200, background='green') c.pack() c.bind('', on_...
Lemon
1

votes
1

answer
76

views

Preprocess data for prediction in Google Cloud (Cloud Functions doesnt support Tensorflow)

I use Google Cloud Functions to send data for prediction to the Cloud ML Engine. Firstly, I need to preprocess the data before sending it to the Cloud ML Engine. For preprocessing I use 2 tokenizers (mwetokenizer from nltk and tf.keras.preprocessing.text.Tokenizer from tensorflow). When I load token...
lemon
1

votes
1

answer
83

views

[UWP][XAML] not displaying TextBox content

Before posting this issue I have searched and studied alot all answers given on StackOverflow but none did help me, so here I am ^^ My goal is to get the corresponsive of a Label in UWP using TextBox. In TextBox property I have set 'IsReadOnly='True'' but the 'box' was still visible even if its prop...
Lemon Pies
1

votes
1

answer
62

views

CMake set variable

In the following CMake code snippet, I am confused by the if elseif check. My understanding is that BL will always be 'Ei', so there is no need to check other values. Are there any scenarios where BL could be overwritten by something else? I am new to CMake so need some help here. set(BL 'Ei' CACHE...
Lemon
1

votes
1

answer
1k

views

C# The process can't access the file because it is being used by another process (File Dialog)

I have a rich text box that is being updated with log information. There is a button to save the log output to a file. When I use the code below to try to save the output to a file, I receive 'The process can't access the file because it is being used by another process' exception. I am not sure wh...
eat_a_lemon
1

votes
1

answer
48

views

How do I query on my has_many association's table's parameter?

Category String id; String name; boolean enabled; Product String id; String name; boolean enabled; int categoryId; I need to search for all of the enabled categories that actually have products and those products should have enabled set to true. I am not really that adept at SQL queries so co...
lemon
1

votes
1

answer
91

views

Having trouble using java.arraycopy. (ArrayIndexOutofBounds)

I am trying to read a csv file and copy it's data into an array. I can't seem to get it to work this way and I'm not sure why. String[] row = new String[0]; ArrayList csv = new ArrayList(); String parser = 'SPImages'; CSVReader reader = new CSVReader(new FileReader('C://data.csv')); String[] nextLin...
Aaron Lemon
1

votes
2

answer
1.6k

views

Stopping googlebot from following links in javascript

While looking over my google bot errors one of them was a 403 error from a directory link I never put anywhere. After searching around in that page for a bit I found that google followed a link it found in some javascript code, this code in particular: $.ajax({ type: 'post', url: '/data/pages/' + r,...
Lemon Drop
1

votes
1

answer
530

views

Intellij IDEA jpa console issue select from tables with specific columns

We have a project includes Eclipselink and MySQL. For example if we use simple query: SELECT a from ExampleTable a it is transformed to something like this: SELECT `id`, `code`, `high`, `key`, `name`, `regionalCode` FROM `ExampleTable` and if I am using JPA Console I am getting something like that:...
Lemon Tree
1

votes
1

answer
79

views

Bash script double quote

I have an issue with a bash script and need to ask for some help. The script is following: #!/bin/bash config_options='CFLAGS=\'-Wall -pipe\'' ./configure --prefix=$PWD/install $config_options If I use run this script, I got the error 'unrecognized option -pipe'. However, if I directly use the foll...
Lemon
1

votes
1

answer
2.4k

views

NSDateComponents in Swift is not returning Weekday

import UIKit let components = NSDateComponents() components.setValue(1, forComponent: NSCalendarUnit.CalendarUnitDay) components.setValue(1, forComponent: NSCalendarUnit.CalendarUnitMonth) components.setValue(2014, forComponent: NSCalendarUnit.CalendarUnitYear) println(components.weekday) // 9223372...
lemon
1

votes
1

answer
397

views

R shiny MathJax Alignment issue

I have a number of rows of equations in my shiny app which I want to align by their equal sign but can't seem to get the align function to work properly. The code I have is as follows. p('$$\\begin{align} \\ x^2 &= \\text{Chi-Squared} \\ sum &= \\text{summation} \\ o &= \\text{the observed values...
Fivedia Da Lemon
1

votes
2

answer
253

views

print time of javascript using loop

I stuck until here, I got infinite loop when I proceed. Below code is a half way, how to print from 1:00 AM to 12: AM. http://jsfiddle.net/sychhLya/ JS $(function () { for (i = 0; i < 12; i++) { var time = '' + i + ':00 AM'; $('.holder').append(time); } });
James Lemon
1

votes
3

answer
58

views

ng-repeat not showing anything

I expect to push new row for user to put in extra info but I'm stuck at generate the first row $scope.rows = { '1':1 }; } http://plnkr.co/edit/qNPYKwdRPNXRrqphEfdz?p=preview
James Lemon
1

votes
2

answer
407

views

How to update password field through CakePHP form

I am using below code. but it's not updating as hash value. Just saving as input value. Please help. $this->request->data['User']['password'] = md5($this->request->data['User']['password']); if ($this->User->updateAll(array('User.password' => $this->request->data['User']['password']),array('User.id'...
Lemon Kazi
1

votes
2

answer
1.4k

views

better way to calculate euclidean distance with R

I am trying to calculate euclidean distance for Iris dataset. Basically I want to calculate distance between each pair of objects. I have a code working as follows: for (i in 1:iris_column){ for (j in 1:iris_row) { m[i,j]
Lemon
1

votes
1

answer
97

views

check if a memory page is loaded into memory

Given a virtual address, I want to know if the memory page mapped into this virtual address has been loaded into memory or in disck. Is there anyway to do check that in user level program? I am using CentOS 7.
Lemon
1

votes
3

answer
291

views

minimum value in a row with some columns

Let's say I have some numbers as follows: ID K1 K2 K3 K4 K5 1 0.1 0.2 0.15 0.25 0.35 I want to get the minimum value from columns K1, K2, K4 and K5. I know how to get minimum value for all values in a row: apply(my.matrix, 1, FUN = function(x) {min(x[x > 0])}) But, I don't know how to exte...
Lemon
2

votes
1

answer
361

views

how many entries in my Translation Lookaside Buffer (TLB)

I want to know how many entries my TLB has. Based on that, I could find out the total amount of memory can be referred by my TLB. I am using CentOS 7 and Intel core i7 processor.
Lemon
17

votes
4

answer
839

views

Why does moving std::optional not reset state

I was rather surprised to learn that the move constructor (and assignment for that matter) of std::optional does not reset the optional moved from, as can be seen in [19.6.3.1/7] which states 'bool(rhs) is unchanged.' This can also be seen by the following code: #include #include #include #includ...
Lemon Drop
2

votes
2

answer
282

views

Why is Keras LSTM on CPU three times faster than GPU?

I use this notebook from Kaggle to run LSTM neural network. I had started training of neural network and I saw that it is too slow. It is almost three times slower than CPU training. CPU perfomance: 8 min per epoch; GPU perfomance: 26 min per epoch. After this I decided to find answer in this questi...
lemon
2

votes
1

answer
46

views

transform an attribute to 0 or 1

I have a dataframe which has an attribute called income as follows: ...... income ...... > 10 ...... 10 After the transformation, it will look like ...... income ...... 1 ...... 0 ...... 1 I want to transform this column to 1 if it's larger than 10, otherwise 0. What I am doing curr...
Lemon
2

votes
2

answer
67

views

while loop for condition_variable

In the following example, I don't understand the purpose of ready. What is difference with or without using ready in this example? #include // std::cout #include // std::thread #include // std::mutex, std::unique_lock #include // std::condition_variable std::m...
Lemon
2

votes
3

answer
105

views

How to get following output using PHP

My sample desired output should be 1 2 3 4 5 2 4 3 3 4 2 5 4 3 2 1 Here is my PHP code for($i=1;$i
Lemon Kazi
5

votes
2

answer
697

views

Stop fixed background image from scrolling at a certain height

As shown in the picture below, the sidebar goes below its wrapper. How do I stop the fixed background image from scrolling if it goes below the wrapper? I don't want it to touch the footer. Here are my codes : $(function () { //Sidebar navigation var scrollNavTop = $('.scroll').offset().top; $(windo...
Courageous Lemon

View additional