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
50a774b3c720158ecde8d85f104f6bca613cb737dea25635fd7a05d03c05d6cf
['1a52d4b90d3f4c34af717c96afd85a66']
Хочу имитировать клик и вставку ссылки в форму input с помощью javascript. (Есть сайты, которые при вставке ссылки на видео показывают подробную информацию, а через код просто вставляет, подробная информация не выскакивает) Пробовал делать так c библиотекой jQuery: $("input").val("111"); jQuery("body *").blur(); jQuery("body *").focus(); и т.п. фокусировки, но не реагирует. Что еще можно добавить, чтобы все было также, как если бы делали через мышку?
c41dfd22108cb8c7687b3b262b33d0bb384348f08d04dc36be16042be9872c14
['1a52d4b90d3f4c34af717c96afd85a66']
С помощью google extensions хочу передать данные с одной вкладки в другую (с сайта1 в сайт2, но домены разные). localStorage не помогает, т.к. домены разные. Пробовал chrome.tabs.query и chrome.tabs.create. В какую сторону копаться? p.s. для примера хочу передать значение title с одного сайта на другую
e658de1dbe48e991db744ad065f50ec295b893f875d9f4cd03c34bb8eb9e04f5
['1a562582156a49df818b240824e7608f']
According to the Geolocation API Specification there isn't any function for this. Even the option to save it in the browser preferences isn't pushed to your code. If it's realy important and you realy have to beeing aware of this, you have to write a browser addon for every common browser and ask the user to install it. But i wouldn't doubt of it.
005abb406b506d968cea6fe2d0adb488d3b2c76d5940e919f86263924c742224
['1a562582156a49df818b240824e7608f']
You have to specify the protocol to use, in your case the file:// file transfer protocol var marker = new google.maps.Marker({ position: location, map: map, icon: 'http://c:/green.jpg' }); Note: You have to store the image on your webserver to make it accessible to everyone. That way only user's with an image "grren.jpg" on there C partition will see the icon.
2fb8863eb43ebcecafd7af28a0cc004ac82e92c00012f8188476a8f29197675c
['1a650ae8c2aa49de8641a85cecb8f4a0']
I'm pretty new on aws ec2, I'm trying to get a free ssl with Let's Encrypt. I've watched a video in youtube to learn it, but I have a problem, my terminal says sudo: add-apt-repository: command not found, always when I type the command add-apt-repository ppa:certbot/certbot I'm using Amazon Linux AMI 2018.03.0 (HVM), is it the problem? If it is the problem, how can I fix it? Which command I need to use to install?
c46593207f8921af95c2ab7cd45a21f13cc90a7f1cf464212e228e402b3c6221
['1a650ae8c2aa49de8641a85cecb8f4a0']
I have a chat online, I want to show the time that the user sent the message, I know I need JS for that, I've tried to do it, but it doesn't works, I call this function timeNow() everytime the user send a message, but time time that shows is the time that the user logged into the chat, I think it is not a real time hour, I was thinking, maybe I need to use Ajax or SetInterval function to do it? Can someone help me? Date.prototype.timeNow = function () { return ((this.getHours() < 10)?"0":"") + this.getHours() +":"+ ((this.getMinutes() < 10)?"0":"") + this.getMinutes(); }
bc219b86aff95ee159a147e6d80f9dd2208fa8d2a5c13f1331ca8e315cf3deb6
['1a77d78e9ac54b75bc88a4b3c0cfa613']
what is the difference between the symmetric and anti-symmetric patterns? Also, not sure if you couldn't see in my original post or if you just typed it wrong (negatives in the subscript are hard to see, not sure how to change it...), but $x_{-i}=-x_i$ so x sub -i (not i) equals -x sub i, and the same for the y's. Does this make the pattern symmetric or is it still anti-symmetric?
3fcc195e699ad9e7e75f4db3534cf33eac59eafd22f3b8fe5157b19f82ca0ec6
['1a77d78e9ac54b75bc88a4b3c0cfa613']
My probability textbook has the following exercise: We roll two fair dice. Let $X_1$ be the smallest of the two outcomes and $X_2$ be the largest of the two. What is the joint mass function of $(X_1, X_2)$? The book also has an answer guide that says the probability of getting $x_1=x_2$ (the two dice roll the same number) is 1/36 since "there is only one possible roll for this- $(x_1,x_1)$", but aren't there six ways to roll two of the same number? Why would the probability be 1/36 and not 6/36=1/6?
cc9154344050e979ddcb40e26659cf78edb21cd43f6f16ad138aabaa4c8edbc9
['1a79e8f7b34d476f8afafb0309116f56']
I'm invoking a model method from a runner: rails runner -e development "Sala.new.recipient_list2" Model method: def recipient_list2 email_list = Sala.all(email) email_list.each do |recipient| puts "#{recipient}" end end And I'm getting the following output: #<Sala:0xb05665c> #<Sala:0xb055770> #<Sala:0xb05566c> #<Sala:0xb055568> #<Sala:0xb055464> #<Sala:0xb055360> #<Sala:0xb05525c> #<Sala:0xb055158> #<Sala:0xb055054> #<Sala:0xb054f50> #<Sala:0xb054e4c> #<Sala:0xb054d48> #<Sala:0xb054c44> #<Sala:0xb054b40> #<Sala:0xb054a3c> If I call a modified version of the method that looks like this from a controller: def recipient_list email_list = Sala.all(email) end Controller call: @list = to_be_notified.recipient_list and display @list in a view, I do get a list of emails. Why isn't it working from the runner ? Thanks !
13c7fe794e4d20015875c4675c3fc30c772fd16ff29f927ba726109fa2de3f26
['1a79e8f7b34d476f8afafb0309116f56']
For the chart I've created, the xkey label corresponds to two values : month and year, so I would like to use both those values for the xkey attribute. But it seems that unlike the ykeys attribute there is no way to pass a list of values to xkey (both month and year). So if I just use the month, there's no way to identify the year: xkey: ['month'] and if I use the year, no way to identify the month: xkey: ['year'] Has anyone found a way around this so I can use both without having to concatenate the values outside the chart ? Thanks !
3a373ec3de7cc98947524f79f54f42a1770f8a57d5a3a0eaa7cc5295adc6f62c
['1a7a5a5dbda349d0a807a7e725460e04']
I am writing a framework that wraps functionalities of Box, for that I am using the box-ios-sdk. But all of their authentication methods uses their own flow. I have to input the appID and appSecret and then start the process to get an access token that is managed internally by the sdk. The deal is that I already have my own OAuth2 Flow implemented, I already have the accessToken and the refresh token for the boxAPI. So how to use (or initialize somehow) the box-ios-sdk with the tokens that I already have? Example: [[BOXOAuth2Session alloc] initWithAccesstoken:(NSString *) refreshToken:(NSString *) expireDate:(NSDate *)]; or [[BoxClient alloc] initWithAccesstoken:(NSString *) refreshToken:(NSString *) expireDate:(NSDate *)]; I`ve been digging into the documentation and the source code, but still have not found any viable way to do it.
c3cabdfc9e3e0cd92457db5237613d87b63727f963d78fc650bfd22fac850b90
['1a7a5a5dbda349d0a807a7e725460e04']
I could answer in more details how to do exactly what you want to. But as far as it is described you want to change only the spriteTexture of your hero ( to give a change skin effect). On the hero sprite node ( and any other SKSpriteNode is possible to change only the TEXTURE, to do so you must do something like: [self setTexture:[SKTexture textureWithImageNamed:@"heroNewSkin.png"]]; This should change the texture ( appearance) of your hero on the fly. Remember that the image should be imported into your Xcode project. And the image should be the same size as the previous one, if not you should change the size property of you hero SKSpriteNode. To know more about it a good reference sprite-kit tutorials source is - https://www.raywenderlich.com
b687c298c837f754ac2e5812a0039b07397e992b7a7df807c73fe9c83b3abec5
['1a7bad32777b4a50afb77e1b7400bfc8']
Today I'm working on a project, which allows you to create E-Mail appointments as a simply file '.ics,.ifb,.iCal,.iFBf'. At first, I thought that the syntax between the file formats are different. Then I found RFC2445 (v1) from 1998 and RFC 5545 (v2). There are various iCalendar versions described. Now to my real question: What are the differences between the versions? I do not want to read a documentary with 300-page about it and compare it to find the differences. Maybe someone of you know the differences.
e321243c740d6f5881c2b6cddaf6728a121d529953d509a89865ad49bf5a9164
['1a7bad32777b4a50afb77e1b7400bfc8']
I got a task to define various SharePoint farm topologies. But I haven't any experience about SharePoint and anything else like that. I found some information about the system requirement and the supported topologies, but I´m not sure if they are really supported. It's hard to find helpful information. So my question. I define a three tier topologie. SharePoint 2016 Server MSSQL 2016 Server Workflow Manager Server Is it supported to share the Database Server with the SharePoint and the Workflow Manager Server?
a5b9141e888693628fd155dfd147dd6bb4738ea0058973279fcd40c99b8d2158
['1a85c29726db404d9d7055af8c543fe7']
First stack exchange post ever, take it with a grain of salt. Music is useless! Right? As has been pointed out in several other comments, music is math so as a unified 'this music means that maneuver' it's easily cracked. That doesn't mean it can't be used. With where we are at in todays world with AI, and from the sounds of your more advanced AI, I don't see why your series of battle conductor computers wouldn't be able to work with soldiers directly. Your enemy AI doesn't understand emotion Instead of a single battle hymn playing, each soldier could have their own musical feed. Just like in real world military training where reactions to events are ground into you to the point they become natural, do the same thing but teach each soldier to react to their emotion directly. Teach combat maneuvers, but tie them to emotions. Since each person responds to music differently, this would essentially create a custom encryption for each solder's direction. As an example, some people jump at loud noises while others freeze or maybe even take a step back. In training find out each soldiers reaction, and use that gut instinct in battle. One person hears a random cannon go off, and they drop to the ground taking cover just when they were fired on. Another stops moving so they stop making noise for half a second just as they could have been detected by sound nearby. This can be applied to noise levels as well as types of music for each individual. Metal tends to be background noise to me and makes me tired if its too loud too long. String based classical gets my heart pumping while symphonic metal draws my attention. I get irritable at rap. TL;DR Soldiers trained to respond to emotion, and trained to focus on their emotions in battle could be individually directed, giving the idea of music for tactics a path to success.
a3031eb52df413faef40a42347acc6b4ea98c6994072e477381a66edd7c48791
['1a85c29726db404d9d7055af8c543fe7']
I agree that it is unreasonable and unsustainable. However, I disagree with the sentiment that only a fraction of your net worth should be in individual stocks. It is possible to be well diversified with individual stocks--through careful selection or index skimming for example--and some brokers have tools to analyze your portfolio. Know your limits @Pac2015 and know that aggressive investing can result in aggressive losses as well as gains. Those analysis you quote are often wrong. Diversify, then try to hit some home runs with a small slice of your total portfolio.
5b4d46644af4e0f9f25115608cfe4f7f3ec4d9c8bc30f0c111e1cf04468bed30
['1a927be20fbf4734af9df022252459c7']
I want to pull XML data from one website. However, I have to first establish a connection to another before being authorized to read such data. I understand this question is very vague, and I'll try to answer any question I can. I have to pull XML data from a site (lets call it site2). However, in order to view this data, I have to first visit site1 that has a user id in the link. I'm not sure at all how this works, but it works when I simply visit site1 first, then visit site2 in a browser. However, I don't know how to implement this in PHP, possibly due to my lack of understanding of what's going on. I included some commented out lines because those are things i've tried, but ended up in nothing being printed to the screen. As is, I pull the very little data I can access without first visiting site1. libxml_use_internal_errors(true); #header('Content-Type: text/html'); #header("Location: site1"); $url = "site1.php?user_id=guest1"; $response = file_get_contents($url); $url = "site2.php"; $response = file_get_contents($url); print ($response); $data = simplexml_load_string($response); //print_r($data); echo '<br>'; Expected result: About 100 lines of XML data Actual result: Only one.
45d44e3c6399c0b24874ecf149f7918b52b96585046bd787843ec13d59e80e7c
['1a927be20fbf4734af9df022252459c7']
I'm trying to read in a PDF source file, and append each individual byte to an array of 8-bit integers. This is the slowest function in my program, and I was wondering if there was a more efficient method to do so, or if my process is completely wrong and I should go about it another way. Thanks in advance! pagesize = 4096 arr = [] doc = "" with open(filename, 'rb') as f: while doc != b'': doc = f.read(pagesize) for b in doc: arr.append(b)
476a0acecaf4292770ee24c5189c52d2793897c93117dfe133cf9dba17012118
['1aa065fe6166429b978be4ea90a72aab']
Currently I have the following rust function: fn out_cubic(t: f32, begin: f32, change: f32, duration: f32) -> f32 { return change * (f32::powf((t / duration) - 1.0, 3.0) + 1.0) + begin; } I'm trying to make both begin and change parameters generic types. As far I understand, I could use Rust's bounds to say to the compiler that change and begin should implement the add and multiply operation: use std<IP_ADDRESS><IP_ADDRESS>powf((t / duration) - 1.0, 3.0) + 1.0) + begin; } I'm trying to make both begin and change parameters generic types. As far I understand, I could use Rust's bounds to say to the compiler that change and begin should implement the add and multiply operation: use std::ops::{Add, Mul}; fn out_cubic<T: Add + Mul>(t: f32, begin: T, change: T, duration: f32) -> T { return change * (<IP_ADDRESS>powf((t / duration) - 1.0, 3.0) + 1.0) + begin; } But the above code show the following errors: error[E0308]: mismatched types --> src/easing.rs:44:21 | 43 | fn out_cubic<T: Add + Mul>(t: f32, begin: T, change: T, duration: f32) -> T { | - this type parameter 44 | return change * (<IP_ADDRESS>powf((t / duration) - 1.0, 3.0) + 1.0) + begin; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected type parameter `T`, found `f32` | = note: expected type parameter `T` found type `f32` error[E0369]: cannot add `T` to `<T as Mul>::Output` --> src/easing.rs:44:66 | 44 | return change * (<IP_ADDRESS>powf((t / duration) - 1.0, 3.0) + 1.0) + begin; | ----------------------------------------------------- ^ ----- T | | | <T as Mul>::Output Which makes sense, the compiler does not have any way to know that the type T should be able to add and multiply with a f32 type. My question is, is it possible to create a function that implements both add and multiply operations with T and f32 types? Something like this: fn out_cubic<T: Add<T> + Add<f32> + Mul<T> + Mul<f32>>(t: f32, begin: T, change: T, duration: f32) -> T { return change * (<IP_ADDRESS><IP_ADDRESS>{Add, Mul}; fn out_cubic<T: Add + Mul>(t: f32, begin: T, change: T, duration: f32) -> T { return change * (f32::powf((t / duration) - 1.0, 3.0) + 1.0) + begin; } But the above code show the following errors: error[E0308]: mismatched types --> src/easing.rs:44:21 | 43 | fn out_cubic<T: Add + Mul>(t: f32, begin: T, change: T, duration: f32) -> T { | - this type parameter 44 | return change * (f32::powf((t / duration) - 1.0, 3.0) + 1.0) + begin; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected type parameter `T`, found `f32` | = note: expected type parameter `T` found type `f32` error[E0369]: cannot add `T` to `<T as Mul><IP_ADDRESS>Output` --> src/easing.rs:44:66 | 44 | return change * (f32::powf((t / duration) - 1.0, 3.0) + 1.0) + begin; | ----------------------------------------------------- ^ ----- T | | | <T as Mul><IP_ADDRESS>Output Which makes sense, the compiler does not have any way to know that the type T should be able to add and multiply with a f32 type. My question is, is it possible to create a function that implements both add and multiply operations with T and f32 types? Something like this: fn out_cubic<T: Add<T> + Add<f32> + Mul<T> + Mul<f32>>(t: f32, begin: T, change: T, duration: f32) -> T { return change * (f32::powf((t / duration) - 1.0, 3.0) + 1.0) + begin; }
63a3746fc7913740145965c3f1b4833a0f34ef1e4113864b58f87d3f84ba1907
['1aa065fe6166429b978be4ea90a72aab']
Ok, I think got the error. I was awaiting the non-blocking operation outside the ThreadPoolExecutor and in the __exit__ dunder a shutdown function is being called with the wait=True parameter, so basically the executor was blocking my code. Fixed code: async def main(): loop = asyncio.get_event_loop() print(f"started at {time.strftime('%X')}") pool = ThreadPoolExecutor() task1 = asyncio.ensure_future(loop.run_in_executor(pool, normal_operations)) task2 = asyncio.ensure_future(async_operation()) await task1 await task2 print(f"finished at {time.strftime('%X')}") pool.shutdown(wait=True) With the expected output: started at 16:20:48 start non blocking start blocking ended blocking ended non blocking finished at 16:20:50
65739d649f33ab54eb9fcfad21da514ff18415586f372ec1fb87b4d3fe92c7b2
['1ab24c500c0d40ec9f189624d5b3ea95']
I created this for Arduino to understand the algorithm (of course it's not written in the most efficient way) String calculateModbusAsciiLRC(String input) { //Refer this document http://www.simplymodbus.ca/ASCII.htm if((input.length()%2)!=0) { return "ERROR COMMAND SHOULD HAVE EVEN NUMBER OF CHARACTERS"; } // Make sure to omit the semicolon in input string and input String has even number of characters byte byteArray[input.length()+1]; input.getBytes(byteArray, sizeof(byteArray)); byte LRC = 0; for (int i = 0; i <sizeof(byteArray)/2; i++) { // Gettting the sum of all registers uint x=0; if(47<byteArray[i*2] && byteArray[i*2] <58) {x=byteArray[i*2] -48;} else { x=byteArray[i*2] -55; } uint y=0; if(47<byteArray[i*2+1] && byteArray[i*2+1] <58) {y=byteArray[i*2+1] -48;} else { y=byteArray[i*2+1] -55; } LRC += x*16 + y; } LRC = ~LRC + 1; // Getting twos Complement String checkSum = String(LRC, HEX); checkSum.toUpperCase(); // Converting to upper case eg: bc to BC - Optional somedevices are case insensitve return checkSum; }
71a703924d7257825d6bd85db255d1db9979066031753137ff69239cab3047b5
['1ab24c500c0d40ec9f189624d5b3ea95']
If you can have an async method, you can do something like to pause the function at a certain location. Once pause is set false it will continue executing the rest of the code in the method. Since this is an async method and delay is async too UI execution wouldn't be affected. * Please note that asyn is supported only in .net 4.5 and higher. bool pause = true; void async foo() { //some code while (pause) { await Task.Delay(100); } //some code }
857bf0b41c4bee4932e5624e373b611fad1b2647c05f3e75e4231672b97728e6
['1abcc0b1f4a34dcba348b1859383e0fb']
So i moved some .files and it resolved the problem. I moved most of them back, and it still works perfectly. I will keep the other user account just in case something goes south again but I think the problem is solved. Thank you very much everybody! I am rather new to this platfor, is there any way to say that the problem is solved?
c5c61b91791536b42347684c54ffd4aa722c995f91242f63b58e8300bc272f9c
['1abcc0b1f4a34dcba348b1859383e0fb']
After installing cuda and new nvidia drivers on Ubuntu 18.04, I am now stuck on the infamous login loop. Before asking for help, I carefully browsed the internet but I am now running out of ideas! I will tell you what I tried and the output. -Checking permission of Xauthority/ICE authority : this file does not even exist -Checking permissions of /tmp : everything is fine. -Startx works and i get a rustic, but functional GUI. Now Xauthority exists and has the good permissions. -CHanging-reconfigurate display manager (GM3 or lightdm) : done (no change) -purging and reinstalling nvidia drivers : done. Nothing changed. -Create a new user and see if I can login : Done and I can log in! -After installing cuda, i added a line in the .bashrc file to add the cuda repository to the file. Since then i commented this line on the bashrc file but nothing changed. -Resetting the gnome/unity configuration of the main user account : done. It did not change anything. I did it with dconf reset -f /org/gnomes/ and with : rm -rf .gnome .gnome2 .gconf .gconfd .metacity I am now running out of ideas. I could reinstall everything on this new account but I would actually prefer to get my original login account back. If you have any suggestion, i would love to hear them. PS : I am rather a newbie when it comes to command lines and linux. I can run any command line, try to post some logs, but if you can be as precise as you can, I would be very grateful. Thanks in advance!
816f6a4d93f040abec7b97b3fc85531e658b345a1fb577179c87ea22b55a4629
['1ad6e0cfd89b47ed90e52055652c1877']
I'm trying to implement Bluetooth Low Energy . The fact is, I can find some devices around me, so the scanning seems working, but there are some devices which I can't find ... such as a motorola, which has Android API 19, so since BLE is enabled since API 18, shouldn't it work ? So my question is, are there some devices not compatible with BLE ? (I can found some devices but not all)
41312ee6e18658f81597104bc951e50de5b23613d5e8fe69831cded928da10d2
['1ad6e0cfd89b47ed90e52055652c1877']
I'm working on an application which should be quite the same as Bluehood, an application which is on the google market . So now I'm working on Bluetooth . The fact is, I want to transfer strings (JSON) between two devices . I've seen lots of posts on stackoverflow and some examples on the internet but it's not so clear for me . I know that I've to use createInsecureRfcommSocketToServiceRecord for sending informations and listenUsingInsecureRfcommWithServiceRecord for receiving them , but I'm searching some simple tutorial to explain how it works and how to transfer data between two devices . Thank in advance for your explanations...
01757580e09966ce6d08f6677ba5f8c204cfff4999c49a59bb6512f78e5ddedf
['1ae57d11bf254337a3db076ee30e6d36']
In addition, the publisher may use the set of parameters (indentations, linebreaks and line numbers, font size) to adjust the formatting of the code to match the width of a column. The publisher equally may decide that the pseudocode spans across two columns while the text of the publication is set in two columns (like as there are figures for single column [e.g., 8.85 cm], part-page width [e.g., 12 cm] or full-page width [e.g., 18 cm]).
29072098e6179d8de1bca137f05dce40b34ac5101b739f8eb4ec2570ac1173e5
['1ae57d11bf254337a3db076ee30e6d36']
Since real time hard and soft shadows are Unity 3D Pro only features I thought I will learn Cg programming and create my own shadow mapping shader. But after some digging I found that the shadow mapping technique uses depth textures, and in Unity depth values can be accessed through a Render Texture object, which is Unity Pro only again. So is it true, that I cannot create real time shadow shaders as a workaround to the limitations of the free version?
8255304a43f110ae92ab133338af8644d5d37b09206de6a2ba4e8a1ebf29ad1f
['1aea7a8659b44eb78df2ed0556fdc7d4']
Allowing any no of arguments from sys import argv def operation(name, number, *args): print(name , number) operation(*argv[1:]) Calling from command line: python myscript.py Om 27 first and second argv ("Om" and 27 will pass to the name and number respectively) additional argv(if any) will to *args tupple variable.
7dddd58adfdc8b39b87db4a015ac9902ed4c6584599ca41bf87a6f869c4c8e1d
['1aea7a8659b44eb78df2ed0556fdc7d4']
Q. Is it possible to send json data with GET request? I want to pass some filter parameters to read results from DB params = {'is_coming_soon': False, 'is_paid': True, 'limit': 100, 'skip': 0} headers = {'content-type': 'application/json'} response = requests.get(url=url, headers=headers, params=params) In server side I am receiving all values as string, how can I make request to get proper boolean values not string one.
121a1d476772908f6209dcd0c7c4dfd2e17f1ca9127439677c4655d4b195a077
['1afeaf2588b9462796f20e1b53b5b3b1']
I'm trying to filter my DataView DataSet using RowFilter. I would like to perform a like statement on an Integer column So something like this: myDataView.RowFilter ="ID LIKE %1%"; This works fine for string columns but I receive an error when trying this will integers. I receive the follow error: Cannot perform 'Like' operation on System.Int32 and System.Int32. Anyway of doing a LIKE statement on numbers? Thanks in advance.
70c09de1452f93efb0a6082517185f532cf9a78407f889cc8630f40b16b722bd
['1afeaf2588b9462796f20e1b53b5b3b1']
I'm trying to display records within my GridView and a few of the cells contain text with carriage returns. However when this text is displayed the carriage returns are gone. Is there an easy way to display carriage returns in a GridView Cell? I've tried using a TextBox within the cell which works but I then have the scollbars of the TextBox. I'm not too keen on this way either as the textbox may render differently in different browser. My code is displayed below, I've left my testing in there so you can see all the ways I've tried: <asp:GridView ID="gridResults" runat="server" AutoGenerateColumns="false" CellSpacing="-1" CssClass ="stretch separate" GridLines="None" EnableViewState="true"> <HeaderStyle CssClass="header pad" /> <RowStyle CssClass="row pad"/> <EmptyDataRowStyle CssClass="empty pad" /> <Columns> <asp:BoundField DataField="Notes" HeaderText="Notes" HtmlEncode="true"> <ItemStyle Width="100" /> </asp:BoundField> <asp:TemplateField HeaderText="Notes" > <ItemTemplate> <asp:Label ID="test" runat="server" Text='<%# Bind("Notes") %>' /> <asp:TextBox ID="textNotes" runat="server" CssClass="right" TextMode="MultiLine" Text='<%# Bind("Notes") %>' BorderStyle="None" /> </ItemTemplate> <ItemStyle Width="50" CssClass="right" /> </asp:TemplateField> </Columns> </asp:GridView> I'm using ASP.Net 4.0 and c# Thanks
7e0fe5f5d65925c7048091333eaf6ee38e7f0a2828a529d99a84c3f1a974d12c
['1b0e6d2676b746608a0011f317e7ea26']
This maybe gold for someone one day. After a few days searching, I came across this article that pointed towards a very simple solution. The function must be listed BEFORE any calls to it. FUNCTION myFunction(p_x IN NUMBER) RETURN VARCHAR2 BEGIN ... END; PROCEDURE render_item (p_item in apex_plugin.t_item, p_plugin in apex_plugin.t_plugin, p_param in apex_plugin.t_item_render_param, p_result in out nocopy apex_plugin.t_item_render_result) IS lv_test VARCHAR2(1); BEGIN ... lv_test := myFunction(); ... END;
17e2bea35a07dbcf22084d83c1a70f9aa39bb92fd03c20584727ab1cdc18e69d
['1b0e6d2676b746608a0011f317e7ea26']
I have an application that I've just updated to use v15.1 of the Ajax Contol Toolkit. I've also used the instructions on this page to configure bundling and everything looks good on my local machine. https://ajaxcontroltoolkit.codeplex.com/wikipage?title=How%20to%20use%20bundling%20and%20CDN If I inspect the source I can see a single script tag with src=/Scripts/AjaxControlToolkit/Bundle?v=. However, after I publish the website through Visual Studio and upload the site to my live server, bundling doesnt seem to work anymore. Instead I see all the individual resources such as I've had a look around the net and various forums but I can't see anyone else having a similar problem. Any help would be greatly appreciated. Everything works, I'm just a bit funny about these things.
bcb4ac808311da74ad1c9b80866396e94071c3f00acc59d308171121c5efea3b
['1b15721eefd54f3885a565e6bc38cdd4']
I found sm.tsa.arma_generate_sample function helps me to do it as below. arparams = np.array([1.4031,-0.4380,0.0433,-0.0243]) maparams = np.array([-0.9187]) ar = np.r_[1, -arparams] # add zero-lag and negate ma = np.r_[1, maparams] # add zero-lag <PERSON> = sm.tsa.arma_generate_sample(ar, ma, 3) <PERSON> The code above generated a single scenario for 3 days. By wrapping the logic and map it several times, I could observe the dynamics.
e7c126bb9a69ada19a1247fc26d30942a57be3f49ee3a4823d4b10df0620c42e
['1b15721eefd54f3885a565e6bc38cdd4']
Utilizing withStyles function from '@material-ui/styles' would be an option. An example shown in the URL below: import React from 'react'; import PropTypes from 'prop-types'; import { withStyles } from '@material-ui/styles'; import Button from '@material-ui/core/Button'; const styles = { root: { background: 'linear-gradient(45deg, #FE6B8B 30%, #FF8E53 90%)', border: 0, borderRadius: 3, boxShadow: '0 3px 5px 2px rgba(255, 105, 135, .3)', color: 'white', height: 48, padding: '0 30px', }, }; function HigherOrderComponent(props) { const { classes } = props; return <Button className={classes.root}>Higher-order component</Button>; } HigherOrderComponent.propTypes = { classes: PropTypes.object.isRequired, }; export default withStyles(styles)(HigherOrderComponent);
70875fb883931749e96dc33ed35bdfcc633a1b8bf6c69d90474bb6bc54924e12
['1b1cd9ef4a834585bfd77542c9601921']
Extend the class from BaseAdapter Override getCount() method and return here the total amount of images you need to show. In the getView load with Glide only ONE url (remove the for loop), the getView method will be called N times to show in the list the "total" amount of images you returned in the getCount method, the position parameter in the getView method will run from 0 to (total - 1). You should map 1 position to 1 url, maybe you will need to change the way you access the objects that contain the urls.
17119d02627cad7fc0ec963ac4853a9608be2d64e7a0a6f9fd7ebd31f247c41c
['1b1cd9ef4a834585bfd77542c9601921']
I will recomend you RadaeePDF. Its not open source but its "afordable" taking into consideration the time will save you looking and trying for open source projects. In my experience the performance given by this SDK is great, you may try it for free. http://www.radaeepdf.com/download/download-android
6c05e5a36ab20f92544edc3b146e8e8db13a19bb6e5184e324a109858bb0eaff
['1b2252c3cc8946aab3786aff96210148']
Try this, private static final int REQUEST = 112; if (Build.VERSION.SDK_INT >= 23) { String[] PERMISSIONS = {android.Manifest.permission.SEND_SMS}; if (!hasPermissions(mContext, PERMISSIONS)) { ActivityCompat.requestPermissions((Activity) mContext, PERMISSIONS, REQUEST ); } else { SendSMSMessage();//call send msg function } } else { SendSMSMessage();//call send msg function } get Permissions Result @Override public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) { super.onRequestPermissionsResult(requestCode, permissions, grantResults); switch (requestCode) { case REQUEST: { if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) { SendSMSMessage();//call send msg function } else { Toast.makeText(mContext, "The app was not allowed to send sms.", Toast.LENGTH_LONG).show(); } } } } check permissions for marshmallow private static boolean hasPermissions(Context context, String... permissions) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && context != null && permissions != null) { for (String permission : permissions) { if (ActivityCompat.checkSelfPermission(context, permission) != PackageManager.PERMISSION_GRANTED) { return false; } } } return true; } Manifest <uses-permission android:name="android.permission.SEND_SMS" />
839569d10ae0d815f1610e641270641c74959eec5a6cab189babd61f550f9d2d
['1b2252c3cc8946aab3786aff96210148']
Try this, NotificationManager notificationManager = (NotificationManager) context .getSystemService(Context.NOTIFICATION_SERVICE); Notification notification = new Notification(icon, message, when); Intent notificationIntent = new Intent(context, HomeActivity.class); notificationIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); PendingIntent intent = PendingIntent.getActivity(context, 0, notificationIntent, 0); notification.setLatestEventInfo(context, title, message, intent); notification.flags |= Notification.FLAG_AUTO_CANCEL; notificationManager.notify(0, notification);
29999fe5e5673b7119ef3830a23478fb7f2a239c578c96e71b61036720e27767
['1b2455f4bc894cc7bed648ff0ada0fe7']
I think there a missing rights to specific database or table of the SQL Server. I had the same problem a time ago with dts migration. User needed read rights to the MSDB or the sysdtspackag tables. I think your problem is similar "The list of schema names could not be retrieved" maybe your user has insufficient rights on some system tables.
36989c7abd1ae685325ab146bbcb7c588e297c9a90a3a1ff1e7be5383850b55a
['1b2455f4bc894cc7bed648ff0ada0fe7']
A really simple explanation when a Dead Lock happen (when ive got it wrong, sorry im no DBA :) ): Both Transaction run parallel Transaction 1 Select * From Table1 Select * From Table2 Transaction 2 Select * From Table2 Select * From Table1 T1 waits for Table2 and T2 waits for Table1 One optimization is to do the SQL Statements in the same Order. MSSQL Sever has an Option with nolock, but there you have the Dange of inconsitent data.
ca5a2cea41c67cee354eb3f41c531b53b386b54705cbdcab6777347296c27d72
['1b338dc9144441e596d1a650ea3c9969']
i'm sorry not to comment under your post due to lack of reputation. can you elaborate more on "Why I can print foo: 1 in JavaScript"? If I run this code var t = {foo: 1}; It will become the property for object "t". The same behaviour will be implement if you use this code var t = {foo: 1, bar: 2}; You can access it by "t.foo" and "t.bar" and it will return the value either "1" or "2". You can read the explanation of "object" here JavaScript Objects
6b2b23f0b2a5dd3496b7290b9c21cf28fb3a76a0ce392bbe65a287bd3f10faab
['1b338dc9144441e596d1a650ea3c9969']
I have made an SQL Server cursor code that nearly close to your expected result. The different here is on the 5th record that you expect "2015-08-30 23:59:59.999" but in SQL Server "2015-08-30 23:59:59.999" will be read as "2015-09-01 00:00:00.000". Hope this help DECLARE @temp TABLE( Id int identity(1,1) not null, WindowRange varchar(15) not null, StartDatetime datetime null, EndDatetime datetime null ) INSERT INTO @temp SELECT TOP 1 WindowRange, StartDatetime, EndDatetime FROM #SourceTable ORDER BY StartDateTime DECLARE @curStartDateTime DATETIME DECLARE @curEndDateTime DATETIME DECLARE @prevStartDateTime DATETIME DECLARE @prevEndDateTime DATETIME DECLARE @iteration INT SET @iteration = 0 DECLARE @timeRange CURSOR SET @timeRange = CURSOR FOR SELECT StartDatetime, EndDatetime FROM #SourceTable ORDER BY StartDateTime OPEN @timeRange FETCH NEXT FROM @timeRange INTO @curStartDateTime, @curEndDateTime WHILE @@FETCH_STATUS = 0 BEGIN IF @iteration <> 0 BEGIN IF CONVERT(VARCHAR(8), @curStartDateTime, 112) = CONVERT(VARCHAR(8), @prevEndDateTime, 112) BEGIN IF CONVERT(VARCHAR(23), @curStartDateTime, 121) <> CONVERT(VARCHAR(23), @prevEndDateTime, 121) BEGIN INSERT INTO @temp SELECT CONVERT(VARCHAR(5), @prevEndDateTime, 108) + ' - ' + CONVERT(VARCHAR(5), @curStartDateTime, 108) , @prevEndDateTime , @curStartDateTime END END ELSE BEGIN INSERT INTO @temp SELECT CONVERT(VARCHAR(5), @prevEndDateTime, 108) + ' - 23:59' , @prevEndDateTime , CONVERT(VARCHAR(8), @curStartDateTime, 112) + ' 23:59:59.999' INSERT INTO @temp SELECT '00:00 - ' + CONVERT(VARCHAR(5), @curStartDateTime, 108) , CONVERT(VARCHAR(8), DATEADD(day, 1, @prevEndDateTime), 112) + ' 00:00:00.000' , @curStartDateTime END INSERT INTO @temp SELECT CONVERT(VARCHAR(5), @curStartDateTime, 108) + ' - ' + CONVERT(VARCHAR(5), @curEndDateTime, 108) , @curStartDateTime , @curEndDateTime END SET @prevStartDateTime = @curStartDateTime SET @prevEndDateTime = @curEndDateTime SET @iteration = @iteration + 1 FETCH NEXT FROM @timeRange INTO @curStartDateTime, @curEndDateTime END CLOSE @timeRange DEALLOCATE @timeRange SELECT * FROM @temp ORDER BY StartDatetime DESC
3273da16ce817f505566d0a411dc1cbc47239ad176dd44080a442143f4ad98d4
['1b3c7ab12b784797ae163c5ba9770145']
The point is just that the band assisted chin should not be thought of as an "easier chin-up." It is a different exercise, it is a different skill that you are learning. (The non-linear nature of the band helping you out most at the bottom, where the shoulder mobility that most people lack is most important, making it easier to start with bad shoulder position!) That trainer believes the pull-down is a more appropriate accessory exercise than the band-assisted chin to develop the strength needed to proceed to learning the chin-up skill. One can agree with him somewhat on the basis that bad-form is likely more obvious on the pull down. One can certainly do "too-much-too-soon" on the assisted pull-up machine and learn the skill incorrectly with poor shoulder mechanics hiding missing strength. To someone who is is not a baseball enthusiast, what is the difference between the throw a second baseman uses to home plate and a pitch? Is it not just a harder version of the pitch with less accuracy? Of course if you've played baseball you know it's a totally different skill and you don't use one to improve the other. You use accessory exercises appropriate to that skill. (I am not saying I 100% agree with him, just trying to restate his point as I understand it!)
036036b10836f6a465e61f239c18b4bf151dc3787337e1202595d086346ed2ac
['1b3c7ab12b784797ae163c5ba9770145']
P.S. We are also running into the issue where browser based drop-downs to pre-fill addresses, phone numbers, and other saved information are interfering with our type-ahead and autocomplete drop-downs. At some point I hope there is an easy way to address this so that the browser's features and the features we create can be displayed in a useful way without loosing the functionality of either.
9b96d8ffc721e35451241bf0dfd9391093a3c4a7ce72fbc171e8f1f42132bd68
['1b3ee414adda40fe9fdfe9be5df613f0']
I just did this recently. Something like this should work for you. You need to ask the library playlist (named libraryPlaylist in this example) and not the application. NSArray *trackIDs = blah; // the ids you're searching for NSString *searchFilter = @"databaseID == %@"; NSMutableArray *filters = [NSMutableArray arrayWithCapacity:[trackIDs count]]; for (int i = 0; i < [trackIDs count]; i++) { [filters addObject:searchFilter]; } searchFilter = [filters componentsJoinedByString:@" OR "]; NSArray *trackResult = [[libraryPlaylist tracks] filteredArrayUsingPredicate:[NSPredicate predicateWithFormat:searchFilter argumentArray:trackIDs]]; And that works just fine if the trackIDs array only contains a single item, so there's no need to write special code for that case.
34534108c50c2b2474617038795214624cdd730862fb330a76b7daa0e68ad7b5
['1b3ee414adda40fe9fdfe9be5df613f0']
I have several strings that were encrypted using OpenSSL. For instance: $ echo "original string" | openssl aes-256-cbc -p -a -pass pass:secret salt=B898FE40EC8155FD key=4899E518743EB0584B0811AE559ED8AD9F0B5FA31B0B998FEB8453B8E3A7B36C iv =EFA6105F30F6C462B3D135725A6E1618 U2FsdGVkX1+4mP5A7IFV/VcgRs4ci/yupMErHjf5bkT5XrcowXK7z3VyyV1l2jvy I would like to decrypt these things using Python. I'm attempting to use PyCrypto. Here's an exmaple script using the above data: from base64 import b64decode, b64encode from hashlib import md5 from Crypto.Cipher import AES secret = 'secret' encoded = 'U2FsdGVkX1+4mP5A7IFV/VcgRs4ci/yupMErHjf5bkT5XrcowXK7z3VyyV1l2jvy' encrypted = b64decode(encoded) salt = encrypted[8:16] data = encrypted[16:] key = md5(secret + salt).hexdigest() iv = md5(key + secret + salt).hexdigest()[0:16] # which 16 bytes? dec = AES.new(key, AES.MODE_CBC, iv) clear = dec.decrypt(data) try: salt_hex = ''.join(["%X" % ord(c) for c in salt]) print 'salt: %s' % salt_hex print 'expected: %s' % 'B898FE40EC8155FD' print 'key: %s' % key.upper() print 'expected: %s' % '4899E518743EB0584B0811AE559ED8AD9F0B5FA31B0B998FEB8453B8E3A7B36C' print 'iv: %s' % iv print 'expected: %s' % 'EFA6105F30F6C462B3D135725A6E1618' print 'result: %s' % clear except UnicodeDecodeError: print 'decryption failed' Here's the output: salt:     B898FE40EC8155FD expected: B898FE40EC8155FD key:      4899E518743EB0584B0811AE559ED8AD expected: 4899E518743EB0584B0811AE559ED8AD9F0B5FA31B0B998FEB8453B8E3A7B36C iv:       17988376b72f4a81 expected: EFA6105F30F6C462B3D135725A6E1618 decryption failed You can see that the salt matches, and the key matches the first half of what OpenSSL shows, so I seem to be on the right track, but there are two main questions: Why are the values for key and iv from OpenSSL twice as long as PyCrypto (and presumably AES256) allows? How do I generate the correct values? The technique I'm using was taken from a blog, but if the IV is always supposed to match the block size (16 bytes), MD5 will never work. And even if I could figure out where the other half of the key comes from, PyCrypto would refuse it for being too long. I realize I'll need to remove the padding as well, but I left that out for brevity.
5bfafb52dc9ef0748ab7326867ffab4a019620803c893aabe281ad2706cae287
['1b3f37ead9a742638d3f844fc0178e7a']
I have a problem with custom data in a QCombo Box and here is a minimal example, just an empty project with a QComboBox named combobox in the ui. Here is the c'tor code: ui->setupUi(this); //Add the sort proxy QSortFilterProxyModel* proxy = new QSortFilterProxyModel(ui->comboBox); proxy->setSourceModel(ui->comboBox->model()); ui->comboBox->model()->setParent(proxy); ui->comboBox->setModel(proxy); //First strange thing is //Here the first addItem triggers the current index changed signal //In the second run, every addItem trigger the signal qDebug() << "Initializing"; for( size_t i=1; i<1e10; i*=10 ) ui->comboBox->addItem( "item", i ); qDebug() << "Sorting"; proxy->sort(0); proxy->sort(0); qDebug() << "Selecting"; ui->comboBox->setCurrentIndex(0); //Here everything is fine for( int i=0; i<ui->comboBox->count(); ++i ) qDebug() << ui->comboBox->itemData(i).value<size_t>(); //Clear the box and do the same again! ui->comboBox->clear(); //Now every addItem triggers the current changed event qDebug() << "Initializing"; for( size_t i=1; i<1e10; i*=10 ) ui->comboBox->addItem( "item", i ); qDebug() << "Sorting"; proxy->sort(0); qDebug() << "Selecting"; ui->comboBox->setCurrentIndex(0); //Here all itemData values are 0!!! for( int i=0; i<ui->comboBox->count(); ++i ) qDebug() << ui->comboBox->itemData(i).value<size_t>(); And here is the slot void MainWindow<IP_ADDRESS>on_comboBox_currentIndexChanged(int index) { qDebug() << "Current changed to " << index; qDebug() << "UserRole is " << ui->comboBox->itemData(index); } The second time add the items calls the current index changed event every time, the first time just on the first addItem. In the second run, after sort, all user data is 0. Any ideas?
4541bc8d9e0a9c4e3ff22efddebaed0364e56a3c8837db9ab55cbe786478b608
['1b3f37ead9a742638d3f844fc0178e7a']
I have a problem regarding hdf5 datasets with H5D_FILL_TIME_NEVER in the follwogin code. It creates an HDF5 File containing the Datasets Matrix1 and Matrix2, both with H5D_FILL_TIME_NEVER. If i remove the last block writing to Matrix2, the code runs in a few milliseconds. If the code is executed completely it seems to fill matrix1 as soon as i acces matrix2 which takes 16 seconds to execute. Is there a way to get reasonable performance here? My usecase is the following: I retrieve data vector-vise and have to add it as a column to Matrix1 and as a row to Matrix2. There is no way to write Matrix1 first and then write Matrix2, i have to write them at the same time. I am using HDF5 version 1.8.15 with Visual Studio 2012 auto file = H5<IP_ADDRESS>H5File( "E:\\test.h5", H5F_ACC_TRUNC ); file.flush( H5F_SCOPE_GLOBAL ); hsize_t rows = 1000; hsize_t cols = 1000000; { H5<IP_ADDRESS>DSetCreatPropList plist; plist.setFillTime( H5D_FILL_TIME_NEVER ); plist.setAllocTime( H5D_ALLOC_TIME_LATE ); hsize_t dims[2] = {rows, cols}; H5<IP_ADDRESS>DataSet set1 = file.createDataSet( "/Matrix1", H5<IP_ADDRESS>PredType<IP_ADDRESS>NATIVE_DOUBLE, H5<IP_ADDRESS>DataSpace( 2, dims ), plist ); set1.close(); plist.close(); } { H5<IP_ADDRESS>DSetCreatPropList plist; plist.setFillTime( H5D_FILL_TIME_NEVER ); plist.setAllocTime( H5D_ALLOC_TIME_LATE ); hsize_t dims[2] = {rows, cols}; H5<IP_ADDRESS>DataSet set1 = file.createDataSet( "/Matrix2", H5<IP_ADDRESS>PredType<IP_ADDRESS>NATIVE_DOUBLE, H5<IP_ADDRESS>DataSpace( 2, dims ), plist ); set1.close(); plist.close(); } { double value = 1; H5<IP_ADDRESS>DataSet set = file.openDataSet( "/Matrix1" ); hsize_t matdims[2]; matdims[0] = 1; matdims[1] = 1; H5<IP_ADDRESS>DataSpace memspace( 2, matdims ); H5<IP_ADDRESS>DataSpace dataspace = set.getSpace(); dataspace.selectNone(); const hsize_t count[2] = {1, 1}; const hsize_t start[2] = {0, 0}; const hsize_t block[2] = {1, 1}; dataspace.selectHyperslab( H5S_SELECT_SET, count, start, 0, block ); set.write( &value, H5<IP_ADDRESS>PredType<IP_ADDRESS>NATIVE_DOUBLE, memspace, dataspace ); set.close(); } { double value = 1; H5<IP_ADDRESS>DataSet set = file.openDataSet( "/Matrix2" ); hsize_t matdims[2]; matdims[0] = 1; matdims[1] = 1; H5<IP_ADDRESS>DataSpace memspace( 2, matdims ); H5<IP_ADDRESS>DataSpace dataspace = set.getSpace(); dataspace.selectNone(); const hsize_t count[2] = {1, 1}; const hsize_t start[2] = {0, 0}; const hsize_t block[2] = {1, 1}; dataspace.selectHyperslab( H5S_SELECT_SET, count, start, 0, block ); set.write( &value, H5<IP_ADDRESS>PredType<IP_ADDRESS>NATIVE_DOUBLE, memspace, dataspace ); set.close(); }
b6823d4d98a4f3ebe0cb0a4c4deb8035f459c6bcad89a232e44ea51c27c9eab0
['1b493518efeb4b90bf85335d991d01d7']
I'm working on a CMS-based website with multiple separate pages, and I'm loading site-wide functionality onto every page using an app.js file loaded after a vendor.js file using the usual code splitting strategy. app.js is the main entry file, and it uses dynamic imports to load page-specific scripts. Here's an example from my app.js: /** * "Register for a class" page */ if (document.body.classList.contains("page-id-4136")) { import(/* webpackChunkName: "register-for-a-class" */ './pages/register-for-a-class/main') } In this case, the 'pages/register-for-a-class/main.js' file page uses Vue as a dependency, but is the only page on the site so far to require it. I'd rather not bundle Vue into vendor.js when it's only being used on this page. I've tried to include Vue itself as a dynamic import by trying the following: // pages/register-for-a-class/main.js import(/* webpackChunkName: "vue" */ 'vue').then(({ default: Vue }) => { new Vue({ ... }) }) But that gives me an error in webpack bundling that says Module parse failed: 'import' and 'export' may only appear at the top level. So I also tried this: // app.js /** * "Register for a class" page */ if (document.body.classList.contains("page-id-4136")) { import(/* webpackChunkName: "vue" */ 'vue').then(({ default: Vue }) => { import(/* webpackChunkName: "register-for-a-class" */ './pages/register-for-a-class/main') }) } That just flat out doesn't change anything. No "vue.bundle.js" file is created, and, naturally, loading the page creates a Vue is not defined error. So here's what I'm really asking. What would be absolutely fantastic is if I could automatically have the pages/register-for-a-class/main.js just call a normal static import (e.g. import Vue from 'vue') and have webpack generate both the register-for-a-class.bundle.js file and a corresponding register-for-a-class-vendor.bundle.js and dynamically import that vendor bundle automatically. It that possible? Here is my current webpack.common.js file (I'm using webpack-merge): const path = require('path') const webpack = require('webpack') const MiniCssExtractPlugin = require('mini-css-extract-plugin') const VueLoaderPlugin = require('vue-loader/lib/plugin') const devMode = process.env.NODE_ENV === 'development' module.exports = { entry: { app: './assets/src/app.js' }, resolve: { alias: { '~': path.resolve(__dirname, 'assets/src') } }, module: { rules: [ { test: /\.vue$/, loader: 'vue-loader' }, { test: /\.scss$/, use: [ { loader: MiniCssExtractPlugin.loader }, 'css-loader', 'postcss-loader', 'sass-loader' ] }, { test: /\.css$/, use: [ 'vue-style-loader', 'css-loader' ] }, { test: /\.(woff2?|ttf|eot|svg)$/, use: ['url-loader'] } ] }, optimization: { runtimeChunk: 'single', splitChunks: { cacheGroups: { commons: { test: /[\\/]node_modules[\\/]/, name: 'vendor', chunks: 'all' } } } }, externals: { jquery: 'jQuery' }, plugins: [ new VueLoaderPlugin() ] }
09ece38c00a3cfdba84bc5768e14f5734ee6aede773d8ea543b46ac60705f786
['1b493518efeb4b90bf85335d991d01d7']
"And if you save the changes, then the On option has the selected="selected" on refresh"... you'll need to do that with cookies or session variables. To change the span when you change the select input: HTML: <span id="span">Off</span> <select id="example" name="example..... Javascript: document.getElementById("example").onchange = function() { document.getElementById("span").innerHTML = document.getElementById("example").value; } Basically that. Try this: http://jsfiddle.net/wmh6b/ Or, if you fancy jQuery, try this: http://jsfiddle.net/wmh6b/1/
81cada73beb43f2bc4386f82c28a24aa9716cd0470dabf569f8b8b4fcad2698b
['1b4cdfacf17e43aead29f0d10c4462f8']
I have 4 imageViews. When I append a color inside the for, array, the first image view background will change base on the content. My goal is to whenever I add a color, an image view background color will change. When I add the first color, the first image view will change, the second color , the second image view will change etc.. how could I achieve it ? Tought by creating a collection of image view it would have been possible to achieve it. import UIKit class ViewController: UIViewController { @IBOutlet weak var image1: UIImageView! @IBOutlet weak var image2: UIImageView! @IBOutlet weak var image3: UIImageView! @IBOutlet weak var image4: UIImageView! @IBOutlet var images: [UIImageView]! var colors = ["Green","Red"] var forms = [String]() override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view. } @IBAction func buttonPressed(_ sender: UIButton) { if let randomColor = colors.randomElement() { forms.append(randomColor) switch forms.last { case "Green": image1.backgroundColor = #colorLiteral(red: <PHONE_NUMBER>, green: <PHONE_NUMBER>, blue: 0.1019607857, alpha: 1) case "L": image1.backgroundColor = #colorLiteral(red: <PHONE_NUMBER>, green: 0.1098039225, blue: 0.05098039284, alpha: 1) default: print("Unknow") } } } }
03255c6ea748515d437da9adeb3a2fc9f265c5514348b7fd88d3e5dff9f6c6b1
['1b4cdfacf17e43aead29f0d10c4462f8']
I have an issue with an imageOutlet on a view controller (First picture), it seems that it's constraints issue. I thought I have not set up properly the constraint on the GoalsVC, but after multiple verifications I noticed I am using the same constraints as the second picture (assistVC) scene. I even deleted the goalsVC scene and copied the assistVC scene in order to make sure I have the same constraints and just hooked up the Goal swift file and each outlets again. Thought it maybe an issue with the View content Mode, but nope. However the result is still different between them. Any ideas or suggestions.
42088155bc7e7a6dc2420fbd91becd857891410fedb6c6a5390961b8adaa5388
['1b4dcfa0aa514082967f11b0f7b8ff4f']
When I click on the handle of the slider and drag it, it will be disabled but it will still slide. What's wrong with the disabled function? Here's my code: $(function() { var prevValue=100; $( "#slider" ).slider({ value:100, min: 0, max: 500, step: 50, disabled: false, slide: function( event, ui ) { $( "#slider" ).slider( "option", "disabled", true ); setTimeout(function(){ $( "#slider" ).slider( "option", "disabled", false ); },2000); if (prevValue>ui.value){ ui.value= prevValue-50; }else{ ui.value= prevValue+50; } prevValue=ui.value; $( "#zomlevel" ).val( "$" + ui.value ); $( "#slider" ).slider( "option", "value", prevValue ); $('#slider').trigger(e); } }); $( "#zomlevel" ).val($( "#slider" ).slider( "value" ) ); }); But when I click on the slider then release it will be disabled. How can I make it totally disabled on click and drag. Here's a jsfiddle: http://jsfiddle.net/endl3ss/jNwww/24/
4d4b92c768d8f459c67ff16dbfce88ecff3d7b33a30d08df8f18ebd157bd5ad4
['1b4dcfa0aa514082967f11b0f7b8ff4f']
I'm having problem saving data to the database since catch exception is always being called. try always get ignored. I don't really know what's happening. I've been working for this for hours and I can't get it to work. I'm using kohana 3.3 and kostache. So here's the controller. Controller APPATH/classes/controller/album.php public function action_create() { $view = Kostache_Layout<IP_ADDRESS>factory(); $layout = new View_Pages_Album_List(); $album = ORM<IP_ADDRESS>factory('Album_Information'); $album_name = $this->request->post('inputAlbum'); $artist = $this->request->post('inputArtist'); $album->Album_Name = $album_name; $album->Artist = $artist; try { $album->save(); HTTP<IP_ADDRESS>redirect('album'); } catch(ORM_Validation_Exception $e) { $layout->errors = $e->errors('models'); } } $this->response->body($view->render($layout)); } Templates APPATH/templates/pages/album/list.mustache <h3>Add A New Album</h3> <form action="album/create" method="post"> <label for="inputAlbum">Album Name:</label> <input id="inputAlbum" type="text" name="inputAlbum" /><br /> <label for"inputAlbum" class="error">{{#errors}}{{inputAlbum}}{{/errors}}</label> <label for="inputArtist">Album Artist:</label> <input id="inputArtist" type="text" name="inputArtist" /><br /> <label for="inputArtist" class="error">{{#errors}}{{inputArtist}}{{/errors}}</label> <input type="submit" name="submit" value="Add" /> </form> Model Rules APPATH/classes/model/album/information.php class Model_Album_Information extends ORM { protected $_primary_key = 'ID'; protected $_table_name = 'album_information'; public function rules() { return array( 'inputAlbum' => array( array('not_empty'), ), 'inputArtist' => array( array('not_empty'), ), ); } Messages APPATH/messages/models/album.php return array( 'inputAlbum' => array( 'not_empty' => ':You must provide Album Name', ), 'inputArtist' => array( 'not_empty' => ':You must provide Album Artist', ), ); The errors are showing when there's no input on the input field when i hit on the submit button, no problem with that, but even there's an input the errors are still being shown. So catch is always being called. When i remove try and catch I can easily save data to the database but there's no validation. Thank you and more power.
6da88ec191b091254f91a55e538839434a6b1fc98d307be4a85f44885b285393
['1b58eaaf05ef4cae812d5bc5a41a34be']
I'm looking for help determining what size of solar (PV) I should use to recharge my Li-po battery after discharged. Battery Characteristics :Capacity:1600mAh Nominal Voltage: 3.7V Charging Current:0.2CA=(320mA) Charging Voltage: 4.2V Charging time (std):6 to 7 hours Charging time(max): 2 to 3 hours. Solar (PV) I have looked at a couple solar cells like the Digikey solar SM101K09L. This is a MONOCRYST SOLAR CELL 198MW 6.22V can anyone help determine how long it would take to charge this battery with the solar cell I have mentioned above? Is there any other product you would recommend? Solar panel spec
369769c93dc517f2469ad5614531db9d32936c1079e5bb36ab6c2434fcee44c8
['1b58eaaf05ef4cae812d5bc5a41a34be']
I am having troubles getting the \href to work. Below is the MWE where I am trying to include in the caption of the table on one slide the hyperref to another slide. It looks clickable in the pdf version but does not execute the jump. Any ideas why this is happening? \documentclass [10pt]{beamer} \usetheme{Madrid} \usecolortheme{default} \usepackage{amsmath} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{ragged2e} \usepackage{ctable} \usepackage{setspace} \usepackage[flushleft]{threeparttable} \usepackage{color, colortbl} \newcommand{\blue}[1]{\textcolor{blue}{#1}} \renewcommand{\footnotesize}{\fontsize{6pt}{11pt}\selectfont} \definecolor{beaublue}{rgb}{0.74, 0.83, 0.9} \begin{document} % Short table \begin{frame} \frametitle{Sample Characteristics} \begin{center} \begin{table} [!tbh] \caption{Baseline Balance (\href{Baselinefull}{\blue{Full Table}})} \centering \tiny \scalebox{0.78}{% \centering \begin{tabular}{l c c c} \toprule & \textbf{Control} & \textbf{Treatment} & \textbf{t-test Difference}\\ & \textbf{(N=754)} & \textbf{(N=771)} & \textbf{(1)-(2)}\\ \addlinespace[1ex] \toprule Female & 0.82 & 0.81 & 0.00\\ & (0.01) & (0.01)\\ \midrule Age & 35.59 & 36.37 & -0.78\\ & (0.46) & (0.54)\\ \midrule Belongs to scheduled/backward & 0.47 & 0.45 & 0.02\\ caste or tribe & (0.02) & (0.02)\\ \midrule Married & 0.81 & 0.85 & -0.05**\\ & (0.01) & (0.01)\\ \midrule Hindu & 0.76 & 0.78 & -0.02\\ & (0.02) & (0.02)\\ \midrule Household members & 5.01 & 4.97 & 0.04\\ & (0.08) & (0.09)\\ \midrule Unemployed & 0.33 & 0.32 & 0.01\\ & (0.02) & (0.027)\\ \midrule No education & 0.22 & 0.22 & 0.00\\ & (0.02) & (0.02) \\ \midrule Past-month income & 17968.91 & 13262.10 & 4706.80\\ & (3941.90) & (1754.74)\\ \midrule Past-month savings & 7381.29 & 7933.16 & -551.87\\ & (1211.84) & (1168.38)\\ \midrule Past-month temptation spending (INR) & 128.06 & 126.14 & 1.92\\ & (23.11) & <PHONE_NUMBER>) \\ \bottomrule \addlinespace[01ex] F-test of joint significance (F-stat) & & & 0.765\\ \midrule \addlinespace[1ex] F-test, number of observations & & & 1525\\ \bottomrule \addlinespace[0.5ex] \end{tabular} } \end{table} \end{center} \end{frame} % Full Table \begin{frame} \label{Baselinefull} \frametitle{Baseline Balance Full Table} \begin{center} \begin{table} [!tbh] \caption{Baseline Balance Full Table} \centering \tiny \scalebox{0.5}{% \centering \begin{tabular}{l c c c} \toprule & \textbf{Control} & \textbf{Treatment} & \textbf{t-test Difference}\\ & \textbf{(N=754)} & \textbf{(N=771)} & \textbf{(1)-(2)}\\ \addlinespace[1ex] \toprule Female & 0.82 & 0.81 & 0.00\\ & (0.01) & (0.01)\\ \midrule Age & 35.59 & 36.37 & -0.78\\ & (0.46) & (0.54)\\ \midrule Belongs to scheduled/backward & 0.47 & 0.45 & 0.02\\ caste or tribe & (0.02) & (0.02)\\ \midrule Married & 0.81 & 0.85 & -0.05**\\ & (0.01) & (0.01)\\ \midrule Hindu & 0.76 & 0.78 & -0.02\\ & (0.02) & (0.02)\\ \midrule Household members & 5.01 & 4.97 & 0.04\\ & (0.08) & (0.09)\\ \midrule Unemployed & 0.33 & 0.32 & 0.01\\ & (0.02) & (0.027)\\ \midrule No education & 0.22 & 0.22 & 0.00\\ & (0.02) & (0.02) \\ \midrule Completed primary education & 0.20 & 0.21 & 0.00\\ & (0.02) & (0.01) \\ \midrule Completed secondary education & 0.36 & 0.39 & -0.03\\ & (0.02) & (0.02)\\ \midrule Completed tertiary education & 0.21 & 0.19 & 0.02\\ & (0.02) & (0.01)\\ \midrule Past-month income & 17968.91 & 13262.10 & 4706.80\\ & (3941.90) & (1754.74)\\ \midrule Past-month savings & 7381.29 & 7933.16 & -551.87\\ & (1211.84) & (1168.38)\\ \midrule Past-month temptation spending (INR) & 128.06 & 126.14 & 1.92\\ & (23.11) & <PHONE_NUMBER>) \\ \midrule Temptation index & 1.47 & 1.44 & 0.03\\ & (0.03) & (0.02)\\ \midrule Self-efficacy index & 6.12 & 6.15 & -0.03\\ & (0.09) & (0.09) \\ \midrule Female empowerment index & 0.02 & -0.02 & 0.04\\ & (0.04) & (0.04)\\ \midrule Outstanding debt & 8810.23 & 10651.75 & -1841.52\\ & (1994.31) & (2736.34)\\ \midrule Past-month household expenditures & 5088.60 & 5491.69 & -403.09\\ (for selected goods) & (398.14) & (435.67)\\ \midrule Resilience index & 0.27 & 0.28 & -0.01\\ & (0.02) & (0.02)\\ \bottomrule \addlinespace[01ex] F-test of joint significance (F-stat) & & & 0.765\\ \midrule \addlinespace[1ex] F-test, number of observations & & & 1525\\ \bottomrule \addlinespace[0.5ex] \end{tabular} } \end{table} \end{center} \end{frame} \end{document}
8d474a69abda6c0daf6e76987bdcede96b1bcb0954ad71c5d569f8a8c79ee536
['1b6baf25cb5a467ab400388197b29f30']
Using regex: import re data = "2019-08-02 18:18:<PHONE_NUMBER>" res = re.match(r'(?P<year>\d{4})-(?P<month>\d{2})-(?P<day>\d{2})\s(?P<hours>\d{2}):(?P<minutes>\d{2}):(?P<seconds>\d{2}).(?P<miliseconds>\d+)',data) out = f"EV{res.group('year')[2:]}{res.group('month')}{res.group('day')}_{res.group('hours')}{res.group('minutes')}{res.group('miliseconds')[:2]}" print(out) Output will be: EV190802_181802
c136e15a792827f7bfcad14dd480dadda41197d6940b47bf3e04245f7c28b973
['1b6baf25cb5a467ab400388197b29f30']
I have two tables: table1 has a column named paths1 that contains paths in the format of dir/file or /dir/file table2 has a column named paths2 that also contains paths in the format of dir/file or /dir/file Duplicate paths can be found in both tables (the unique constraint is on another column). I try to find if there are paths in table1.paths1 that don't exist in table2.paths2. My problem is the '/' that is sometimes exists before the path (like in the case /dir/file). To do it I use: SELECT count(*) FROM ( SELECT DISTINCT paths1 FROM table1 WHERE '/'||paths1 NOT IN ( SELECT DISTINCT paths2 FROM table2)); How can I make the '/' optional?
19c6c1f42194a261cb5fbba6755c29798dfab18913468ec7b772c89ac6df7930
['1b829c88b99a477e95a6888715e83d1c']
There are two entities which can relate to each other in a typed way. How must I denormalise and index these tables to search in Solr/Lucene for entity A by a specific entity B and relationship type? For example let's say there are entities organisation and person linked by the following table: ------------------------------------------- | link_type | person | organisation | -------------+-------------+--------------- | Founder | <PERSON> | SpaceX | |------------+-------------+--------------| | Chairman | <PERSON> | SolarCity | |------------+-------------+--------------| | Founder | <PERSON> | SolarCity | |------------+-------------+--------------| | Founder | <PERSON> | Tesla | ------------------------------------------- I'd like to be able to search for all organisations which <PERSON> has founded. The expected document result would be: [SpaceX, Tesla]
935a02684d00b3a1df001087fbcd9b4991aee20a5ab2372f87a34e6b60c1bcf9
['1b829c88b99a477e95a6888715e83d1c']
I started writing on a new project for PC which I eventually want to port to Android. A crucial part of it will be the GUI with a lot of 2D drawing going on. In the past, I've always used Swing for my projects. <PERSON>, I can't use Swing on Android (and I guess it wouldn't be smart performance-wise anyways). So is there any GUI API I can use which won't involve too much effort when porting my program to android? Any advice is appreciated!
60f7bc2fe07b6fcb562d27f0bf7e5f59d0f77c9d8327663647a411184ca3e3bf
['1b8b96c275544c159ae30dccd8effca9']
I was having the same problem recently, and could not figure out supervisor-stdout. Here is what I did: In bash you can use I/O redirection and Process Substitution to pipe stdout, stderr through another process. #!/usr/bin/env bash # setup fd-3 to point to the original stdout exec 3>&1 # setup fd-4 to point to the original stderr exec 4>&2 # get the prefix from SUPERVISOR_PROCESS_NAME environement variable printf -v PREFIX "%-10.10s" ${SUPERVISOR_PROCESS_NAME} # reassign stdout and stderr to a preprocessed and redirected to the original stdout/stderr (3 and 4) we have create eralier exec 1> >( perl -ne '$| = 1; print "'"${PREFIX}"' | $_"' >&3) exec 2> >( perl -ne '$| = 1; print "'"${PREFIX}"' | $_"' >&4) # from here on everthing that outputs to stdout/stderr will be go through the perl script echo "I will be prefixed" # don't forget to use exec Now you can setup supervisor to use stdout and stderr for logging: stdout_logfile=/dev/stdout stdout_logfile_maxbytes=0 stderr_logfile=/dev/stderr stderr_logfile_maxbytes=0 and as command use a bash script that setups the I/O redirection.
24be5fb8d5bc1e8b3afc5a800d4ff83979e95409f9765fdfbf1672606db12122
['1b8b96c275544c159ae30dccd8effca9']
Tenho uma aplicação executando com múltiplos logins usando um mesmo banco de dados para todos os acessos. Tenho tido um problema de requisição múltipla, dois usuários em locais distintos disparam a mesma requisição, porém preciso que executem o método um de cada vez. Existe algum recurso no Asp .Net Core que me ajude nisso? Disparo a requisição a partir da view usando ajax.
3d9e21f8bd4431a44ead597fdf66e9c8a06b0e0b27426d200fc2f8aacd7faa97
['1b8d5ff4bb774f409fccce2bbeb3251b']
I want to attribute more resources (Thread priority) on a specific IntegrationFlow process when there are several IntegrationFlow instances running in a same SpringBoot application using SpringIntegration. I have two instances of IntegrationFlow linked to two different source types. One is linked to a SFTP source an the other one is linked to a Datasource. When a SFTP message is consumed after several steps (unzip files containing XML files, check XML files validity against XSD schema, split XML files and persist data corresponding to a part of XML file), a second Workflow, running in parralel, consumes every persisted data from a datasource in order to push them into a Kafka topic. So I want to attribute more resources on the first IntegrationFlow. For every InegrationFlow the max fetch size is setted to one.
13be417e78b77ef4dc89017d5a51f5f7fdbfac190b9412f83eaf325f3d98bb5c
['1b8d5ff4bb774f409fccce2bbeb3251b']
The behavior has changed since SpringBoot 2.2.2. You have to go through the registration of the module /** * This class allows to specify configuration related to the Web MVC part. */ @Configuration public class WebConfiguration implements WebMvcConfigurer { private static final String JSON_DATA_PROPERTY = "data"; /** * Allows to configure a {@link JsonSerializer} for pagination. * * @return an instance of {@link Module}. */ private Module preparePageModule() { return new SimpleModule().addSerializer(Page.class, new JsonSerializer<>() { @Override public void serialize(@SuppressWarnings("rawtypes") final Page page, final JsonGenerator jsonGenerator, final SerializerProvider serializers) throws IOException { jsonGenerator.writeStartObject(); jsonGenerator.writeObjectField(JSON_DATA_PROPERTY, page.getContent()); jsonGenerator.writeObjectFieldStart("paging"); jsonGenerator.writeNumberField("page", page.getNumber() + 1); jsonGenerator.writeNumberField("totalPages", page.getTotalPages()); jsonGenerator.writeNumberField("totalElements", page.getTotalElements()); jsonGenerator.writeNumberField("perPage", page.getSize()); jsonGenerator.writeEndObject(); jsonGenerator.writeEndObject(); } }); } /** * Allows to configure the <PERSON> object mapper. * * @param objectMapper * an instance of {@link ObjectMapper}. */ @Autowired public void configureJacksonObjectMapper(final ObjectMapper objectMapper) { ... objectMapper.registerModule(preparePageModule()); } ... } `
a714af965d19fe9f915d94729ea970f52676eb0c346ae4a5d8a7ef5244b1d35b
['1b946f16b17943b4a6e5f4fa7c20ab0e']
Alright - I'm implementing a UIToolbar consisting of a Done button onto a UIKeyboardTypeDecimalPad for a text field. Problem is, the method that will resign the responder on the text field is not being called. I have put in NSLogs to see what is being called and what isn't, and the setup is called (i.e. UIToolbar initialization, button adding, adding the toolbar to the text field, etc.), but the method isn't ever called when the "Done" button is pressed. In fact, the button doesn't even look "clickable". - (void) viewDidLoad { UIToolbar *toolbar = [[UIToolbar alloc] init]; UIBarButtonItem *doneButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:self action:@selector(donePicker:)]; UIBarButtonItem *spaceItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil]; [toolbar setItems:@[doneButton, spaceItem]]; self.textField.inputAccessoryView = toolbar; } -(void)donePicker:(id)sender { [self.textField resignFirstResponder]; } I've attempted to use both [self.textField resignFirstResponder] as well as [self.view endEditing:YES], both bearing no fruit here. Any ideas, folks?
1eac7aac38fe3eb025354837e53b403a9329957f42e09abfabbd9425806b2cdf
['1b946f16b17943b4a6e5f4fa7c20ab0e']
I'm new to databases and I wrote this practice program to test Berkeley BDB. I'm getting trouble opening the environment - the error appears in my console and says: testEnv\_db.001: No such file or directory Error opening database environment DbEnv<IP_ADDRESS>open: No such file or directory The code of the console program is based strongly off the examples in the Berkeley DB Transactions guide, and here's the text of the program up to the error, under int main(). String^ key_allkeys = "_ALLKEYS"; String^ key_valcount = "_COUNT"; // 1. Print some information to the screen, prompt user to enter path for key-value pair location: Console<IP_ADDRESS>WriteLine("Oracle Berkeley DB Example Database Creator"); Console<IP_ADDRESS>WriteLine(); Console<IP_ADDRESS>WriteLine("Enter the path to the text file of key-value pairs:"); String^ kv_path = Console<IP_ADDRESS>ReadLine(); // 2. Declare initial variables: String^ totalkeys; int totalval; // 3. Open the database: u_int32_t env_flags = DB_CREATE | DB_INIT_LOCK | DB_INIT_LOG | DB_INIT_MPOOL | DB_INIT_TXN; std<IP_ADDRESS>string envHome("testEnv"); u_int32_t db_flags = DB_CREATE | DB_AUTO_COMMIT; Db *dbp = NULL; const char *file_name = "mydb.db"; DbEnv myEnv(0); try { myEnv.open(envHome.c_str(), env_flags, 0); dbp = new Db(&myEnv, 0); dbp->open(NULL, file_name, NULL, DB_BTREE, db_flags, 0); } catch(DbException &e) { std<IP_ADDRESS>cerr << "Error opening database environment: " << std<IP_ADDRESS>endl; std<IP_ADDRESS>cerr << e.what() << std<IP_ADDRESS>endl; exc_block(); // Block return (EXIT_FAILURE); } It should be fairly obvious that the program is failing right around the try/catch blocks. I've read the manual (literally RTFM) and I couldn't figure it out - the DB_CREATE flag is specified for both the environment and database, so there shouldn't be an issue here. Any ideas?
2e62446336c0dec33b83bbc50d638d21564deb65086132efe913b94f6e52add3
['1b9d303560b14d6296d4244a5989dcec']
I'm not so sure if what you are describing is a workflow system in its true sense, perhaps a Chain of Responsibility is more of what you are talking about? Following what you described as a sequence of execution, here is a simplified example of how I would implement the chain: Transformer.java public interface Transformer<IN, OUT> { OUT transformToDomain(IN dto); IN transformToDTO(OUT domainObject); } Validator.java public interface Validator<T> { boolean isValid(T object); } Service.java public interface Service { void save(Object object); } And the implementation that binds everything: ProcessChain.java public class ProcessChain { private Transformer transformer; private Service service; private Validator validator; Object process(Object dto) throws MyValidationException { Object domainObject = transformer.transformToDomain(dto); boolean isValid = validator.isValid(domainObject); if(!isValid){ throw new MyValidationException("Validation message here"); } service.save(domainObject); return transformer.transformToDTO(domainObject); } } I haven't specified any Spring related things here because your question seems to be a design question rather than a technology questions. Hope this helps
42d5263d415afbdfcd241fea7d81af65b94190aa7d67519b5ae9773034e1f214
['1b9d303560b14d6296d4244a5989dcec']
There's very little context to work from here but from what I can see, these errors suggest that the Lombok library is not in you compile-time class path(as resolved by Eclipse). If you are using Maven as your build tool, try and do a build from the terminal (outside Eclipse). If that builds well, then maybe Eclipse has not refreshed your Maven dependencies. You would have to verify that by looking into the Maven Dependecies library (Eclipse library that is) to see if your Lombok dependency is showing there. Also check if Eclipse has Annotation Processing is enabled, go to Properties -> Java Compiler -> Annotation Processing It's a shot in the dark so I hope it helps
9b8ce28559bca4252928fd3b1616a7a9e98148ec91340079fceaa1d46693e073
['1b9dd8e003304222b59edaec064c7e17']
I'm trying to develop microservices on cumulocity. I'm following this https://cumulocity.com/guides/microservice-sdk/java/. I'm able to create the application having this response "availability": "MARKET", "id": "23", "key": "TESTMICRO-microservice-key", "manifest": { "imports": [], "noAppSwitcher": true }, "name": "TESTMICRO", "owner": { "self": "my_tenant/tenant/tenants/management", "tenant": { "id": "management" } }, "requiredRoles": [ "ROLE_INVENTORY_READ" ], "roles": [ "ROLE_CUSTOM_MICROSERVICE" ], "self": "my_tenant/application/applications/23", "type": "MICROSERVICE" } Nevertheless when I try the GET URL/application/applications/23/bootstrapUser it returns me 404 Error. Anyone that can help me?
54449fc0146d8f9be6980a515740870013b27349b0c871fe5fe4e6537541a8c3
['1b9dd8e003304222b59edaec064c7e17']
I'm trying to subscribe to the Event Channel in a Java Application. I'm trying to instantiate a new Subscriber following the example found here. How the java client in cumulocity listens to events? I'm interested in particular at the events happening on a device so what I'm doing is subscribe to the channel "/events/123" where 123 is the device id. public static void main( String[] args ) { String uRl = "urlOfMyCumulocityIstance"; CumulocityCredentials rC = new CumulocityCredentials("username","password"); PlatformParameters parameters = new PlatformParameters(uRl,rC,new ClientConfiguration()); CepCustomNotificationsSubscriber t = new CepCustomNotificationsSubscriber(parameters); System.out.println(t.toString() + " - " + t.CEP_CUSTOM_NOTIFICATIONS_URL.toString()); // It prints an integer number corresponding to the subscriber t. t.subscribe("/events/123", new SubscriptionListener<String, Object>() { public void onError(Subscription arg0, Throwable arg1) { // TODO Auto-generated method stub System.out.println(arg1.getMessage()); } public void onNotification(Subscription arg0, Object arg1) { // TODO Auto-generated method stub System.out.println(arg1); } }); } Nevertheless I'm not getting any of the events sent to the device. To sum up, what I'd like to do is what in Apama you do by typing monitor.subscribe(Event.CHANNEL) on all Event(source=123) as e { // do something } Any idea about it? Thank in advance
f7ca627925d9d986f4705b360cee2be3296b866a2c267739770aaeae49595eba
['1bb7b86e48774f99ba0f73444ff61c06']
The scope of a callback function is not global.Callback functions will have individual scope as that of a function.The variables declared in the callback functions can't be accessed from outside of the callback function. In javascript, scope will be defined at lexical time, so the variables in callback function will be assigned to scope before the ajax query is completed.Values to the variables will only be assigned during execution after the ajax query is completed. When a function is called multiple times same memory location of variables is used each time in javascript, same applies here too.But the execution of the callback function will be synchronous and not parallel.And the order of callback function execution will be the order in which jquery returns.So no collision will occurs.
38505c5608aa35df70a6391987f01dfd0a788bf9da7cb5e4326063b5ce9ead26
['1bb7b86e48774f99ba0f73444ff61c06']
There is nothing to do with sync or async here. Here what is happening is that, you are trying to push 'numbers' array to 'sn' array. Statement is "sn.push(numbers);" So here we are pushing the Object reference of numbers array to 'sn', means you are not making a copy of numbers array and pushing to 'sn'. You are just pushing the Memory reference of 'numbers' array. So during first iteration, 'sn' will have exact value as you calculates. But during the second iteration 'sn' will have two arrays. But those two values are same and points to the same memory location of 'number'. So here what you should do is create a clone of 'numbers' array during each iteration. if (sn.includes(numbers)) { check = false }; var cloneArray = numbers.slice(0); sn.push(cloneArray);
8c232b7779932be30e5cff4401d7312076d5c57180e70b368e29663cbfc24082
['1bbcb49fe2ae4f2bb486c81980045c47']
Not a full answer, but it might get you closer to it. That number you are passing in is called minSplits. It has an effect on the minimum number of partitions, that is all. def textFile(path: String, minSplits: Int = defaultMinSplits): RDD[String] Number of splits should be governed by getSplits method (docs) And this SO post should answer question 5
7307e09db6658b4b7f4ef50f99dace82d965693cc5705d5a4470c6f5cb152ca0
['1bbcb49fe2ae4f2bb486c81980045c47']
If you open up Ruby doc on Hashes, then find your methods and open a their source code you can see that have the same source code. So to answer a question in proper manner: I would dare to call them aliases (same but differently called/named), but I find them useful to improve the readability of my code.
d100f0f570384fa7cc73c5607d36a583c3db8819bc54633a022e53becc936cfe
['1bc0a455e78741c0848071d7305972fe']
You're using the same vlookup with the same value and the same criteria but expecting different results. I believe your specific problem is with "$A2". This should be dynamic. The next row should be $A3, then $A4, and so on. You can achieve this by treating your vlookup as a string. Break it after the $A to use your variable then rejoin the string. For example: "...RROR(VLookup($A" & j & ", Tabl...."
f9921b91a45e08138a029fd4ca21d1f0ee33da2479644e0345b87ed4d7469bb1
['1bc0a455e78741c0848071d7305972fe']
was just passing through and picked up on some similarities you have with a project I'm working on, i noticed you said you were trying to match objects... this might help, or it might not. depends on the object property you want to match. to easily and quickly find and retrieve matches, i load arrays with criteria and set filters. copy special visible to grab the filtered results then split with getfromclipboard to load an array. combobox's are great when i need a different level of matching, specifically, when i need to match a users request from a pool of possibilities. frequently the results i pulled from the the clipboard will populate a combo list or i may send it to a dictionary as an item or populate keys. dictionaries are a deceptively simple way to find unique values or create arrays with relationships to other data. added benefit, they can hold just about anything as an item and the key is similar except it cannot be an array and it must be unique from the other keys. hope you find something helpful, best of luck!
8ab23e05a0dfc8733bd8ef921c312be4dfde8aeb4480ed257d849a152dba304e
['1bc5e96d02ea43b096eb05d2e89d9e4c']
tengo la siguiente duda, hice un modelo entidad-relación a partir de la siguiente tabla: Resultandome el siguiente modelo con Power Designer: Pero al realizar la siguiente consulta: SELECT r.rol_nombre, cli.cliente_nick, d.departamento_nombre FROM <PERSON>, cliente cli, sesion s, <PERSON>, departamento d WHERE r.rol_id=cli.rol_id and cli.cliente_id = s.cliente_id and s.ciudadela_id = ciu.ciudadela_id and ciu.ciudadela_id = d.ciudadela_id and r.rol_nombre = 'servicios' Obtengo como resultado: Pero solo debería mostrar la facultad de "Ingeniería", pues según la tabla, "<PERSON>" solo esta en esa facultad, Por favor pueden darme recomendaciones o decirme que esta mal con mi modelo o mi consulta... Agradezco de antemano su ayuda ...
c4a95a7d6e9bacef83888d83989480a4ce2b63fe0d8b8566b394777ddcd484f1
['1bc5e96d02ea43b096eb05d2e89d9e4c']
How to properly compile the latest Intel igb driver (4.1.2) with checkinstall ? When I am trying to do this I got following error: *checkinstall -D root@debian:~/igb-4.1.2/src# ========================= Installation results =========================== -bash: =========================: command not found root@debian:~/igb-4.1.2/src# make -C /lib/modules/3.2.0-4-amd64/build SUBDIRS=/root/igb-4.1.2/src modules ERROR: Kernel configuration is invalid. include/generated/autoconf.h or include/config/auto.conf are missing. Run 'make oldconfig && make prepare' on kernel src to fix it. CC [M] /root/igb-4.1.2/src/igb_main.o In file included from <command-line>:0:0: /usr/src/linux-headers-3.2.0-4-common/include/linux/kconfig.h:4:32: fatal error: generated/autoconf.h: No such file or directory compilation terminated. make[4]: *** [/root/igb-4.1.2/src/igb_main.o] Error 1 make[3]: *** [_module_/root/igb-4.1.2/src] Error 2 make[2]: *** [sub-make] Error 2 make[1]: *** [all] Error 2 make[1]: Leaving directory `/usr/src/linux-headers-3.2.0-4-amd64' make: *** [default] Error 2 **** Installation failed. Aborting package creation. Cleaning up...OK* What's that ?? "Make install" working fine, but I need it in .deb package. Somebody could help me resolve this problem ? My specs: uname -r 3.2.0-4-amd64 lsb_release -a Distributor ID: Debian Description: Debian GNU/Linux 7.0 (wheezy) Release: 7.0 Codename: wheezy
e40fdc9793a8e318a4f258c0c4966e7e73324f9120dbe99bef3c17b6914bd599
['1bce5ed3453741d5b2850bd1f4cff9c2']
first group your data by date and after try it public class Billingdata { public int Price { get; set; } public DateTime Start { get; set; } public DateTime End { get; set; } } public class GroupingData { public int Start { get; set; } public int End { get; set; } } var timerangelist = new List<GroupingData> { new GroupingData{ Start = 10, End=13 }, new GroupingData{ Start = 13, End=16 }, new GroupingData{ Start = 16, End=19 }, new GroupingData{ Start = 19, End=22 }, }; var result = new List<Billingdata>(); var billings = new List<Billingdata> { new Billingdata{Price = 10, Start = new DateTime(2020,08,02,10,00,00), End = new DateTime(2020,08,02,11,00,00) }, new Billingdata{Price = 10, Start = new DateTime(2020,08,02,11,00,00), End = new DateTime(2020,08,02,12,00,00) }, new Billingdata{Price = 10, Start = new DateTime(2020,08,02,12,00,00), End = new DateTime(2020,08,02,13,00,00) }, new Billingdata{Price = 10, Start = new DateTime(2020,08,02,13,00,00), End = new DateTime(2020,08,02,14,00,00) }, new Billingdata{Price = 10, Start = new DateTime(2020,08,02,14,00,00), End = new DateTime(2020,08,02,15,00,00) }, new Billingdata{Price = 10, Start = new DateTime(2020,08,02,15,00,00), End = new DateTime(2020,08,02,16,00,00) }, new Billingdata{Price = 10, Start = new DateTime(2020,08,02,16,00,00), End = new DateTime(2020,08,02,17,00,00) } }; foreach (var item in timerangelist) { var data = billings.Where(w => item.End >= w.End.Hour && w.Start.Hour >= item.Start).ToList(); var p = data.Sum(s => s.Price); var ss = data.FirstOrDefault(f => f.Start.Hour == item.Start)?.Start; var e = data.FirstOrDefault(f => f.End.Hour == item.End)?.End; if (ss == null || e == null) { continue; } result.Add( new Billingdata { Price = p, Start = (DateTime)ss, End = (DateTime)e, } ); } enter code here
49c07d410d654ebba96ae406e39d215e55da346632f5bd1ea6a28728884c46c6
['1bce5ed3453741d5b2850bd1f4cff9c2']
d1 = {'Spain':['Madrid','Barcelona'],'France':['Paris','Nice'],'Germany':['Dortmund','Berlin']} d2 = {'Madrid':[1,2], 'Barcelona':[2],'Paris':[3,4],'Nice':[4],'Dortmund':[5],'Berlin':[6]} d3 = {} for k, v in d1.items(): data = {} for item in v: if item in d2: # to escape from an KeyError from d2 dictionary data[item] = d2[item] d3[k] = data
6f3acef06434b1c44f1c928fabc20c179821a5e1851ec95bc0c59b4a718eea89
['1bf323e66e5841f4bc7737c01f095feb']
I've been developing a web app using Node.js, Express, MongoDB, Mongoose and Socket.io for some time now. Version one has just been released and is working great. For version two however, I want to completely redesign the UI and use a front-end framework such as AngularJS. I've been looking at the (MEAN stack) and it looks really promising. Before goin into too much details, I will try to explain the purpose and working of the app so hopefully you will understand my question later on. My app is a streaming service and has 4 simple models: user, room, song, playlist. These are modeled through Schema's in Mongoose and are stored in the MongoDB database. When a user visits the app, it serves all the HTML through Node.js and Express (and Jade as templating engine). If the user then registers, Socket.io lets the server know a user register, that is then saved to the database and the user is joined in the lobby room. In this room, users can chat, listen to music, etc. This is what I've been using Socket.io for, the communication between users themselves and my server (the server sometimes serves html too through Socket.io). Basically all the messages between Socket.io and the server are really small (chat messages, room objects, song objects, etc). I'm quite happy with this approach, however, on the client side, the code is not really separated. There are currently two JS files serving the logic. One handles the Socket.io events and manipulates the dom. The other one is a common JS file that does a bit of everything. These two files are now about 5000 lines each. This worries me and I want to find a solution for this in v2. So I've been looking at AngularJS in the MEAN stack and how to incorporate it in my app. My question is, will this solve my client side problems and can would you recommend taking the effort to do so. Also, how well will Socket.io work with AngularJS? Having both of them might be an overkill for what I'm doing. Do you know of any possible other framework that might be easier to integrate with my current environment? I know it's a bit of a subjective question but if you have any tips or do or don'ts, thanks for sharing! I really appreciate your feedback and if you need more information, I'd be happy to share it with you! <PERSON>
9da91f1a22bcf31525aa6f0677c5b7406752c5b9e5e107c14260786df6a77778
['1bf323e66e5841f4bc7737c01f095feb']
See this http://jsfiddle.net/kukiwon/fFzWh/. You forgot to add a return statement. function Example(test){ test={}; test.firstTry='One'; test.secondTry='Two'; return test; } var x=new Example("I don't know where to go from here, I want to access test.firstTry and test.secondTry"); alert(x.firstTry); alert(x.secondTry);
b4dde0eb12b71513282f6cd54a9025f14b31fa17fad797dbb6e5dc7c8231a1fe
['1c231d05efdd406c8dbd667c46ba71f9']
I've found my own answer. It was a good searching. I have search every file in the core folder of codeIgniter and I have made a new constant that's APPPATH_OWN and by every function of view, controller models and so on I have made a function to first check OWN pathfile than the normal one. In the folder core I have finally edited the following files. Router.php Common.php Config.php CodeIgniter.php Loader.php In the folder databases I have changed the DB.php folder. I had hoped that there was an easier solution.
3fb354dce85872ad56b7d586e1a080a6ab1f77416837085351caf79a076e4240
['1c231d05efdd406c8dbd667c46ba71f9']
Or you need to make a session or you must also parse the first value in the second page. First page is OK 2en page in the form must be. <form method="get[value]" name="go" action="location.php" > <select name="country"> <option value=" "> select </option> <option value="Afganistan">Afghanistan</option> <option value="Albania">Albania</option> </select> <input type="hidden" name="valuep1" value="<?=$value?>"> <input type="submit" value="go" /> Your code does have more error. But if you want to get all information in page 3 you must do in page 3 $value = mysql_real_escape_string($_GET['valuep1']); $countryu = mysql_real_escape_string($_GET['country']); A name in a form is the name how you can get the value. On page one your value to get it is value. That is confusing you better can call it search. And if you then do $_GET['search'] then you will get the value. First thing to do is to better understand how a form works and use better names so that you can't confusing yourself. More info here http://www.w3schools.com/php/php_forms.asp
532bedc319e2187b6a085b1e66622da8ef7a07a6ecc8d088a0085d9b91e465a8
['1c23850b4f684aa4b20727964c97fd00']
I've been wondering if there is such a thing as an optimal compiler error/warning configuration to "force" your code to be less bug prone. I know many people tweak those configurations for their needs. But, there has to be a "complete" set of preferences like the one for VIM editor in Linux. Does anyone know a good set of preferences or where to find one?
c29bdae197b74a8685739d9640b5bbbf89103bcddb933789b66c37c0b4fccfc4
['1c23850b4f684aa4b20727964c97fd00']
Just wanted to point out the in case of MySQL ordering is applied before limiting the results. But this is not true for other DB. For example Oracle first limits results and applies ordering on said results. It makes sense when you think about it from a performance point of view. In MySQL you are actually ordering the entire DB(> 1000 records) to get 2
f3988b2af147efbf62a4199abb1b2899e5d168595a2fc8c9697404700672605e
['1c2accd31cdc479aa3b55400b8ecb988']
May be this can solve your problem $(document).ready(function() { $('#input3,#input4,#input5').hide(); $('#input1,#input2,#input3,#input4,#input5').keyup(function(e) { var el = $(this); var code = e.keyCode || e.which; if (code == '9') { // Ignore Tab key return; } if (el.val() != '') { el.next().next().show(); } else { if (el.attr('id') != 'input1') { // do not hide input 1 el.hide(); } el.next().next().hide(); } }); }); <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> <form> <input id="input1" name="input1" type="text" value="some text"> <br /> <!-- show --> <input id="input2" name="input2" type="text" value=""> <br /> <!-- hide --> <input id="input3" name="input3" type="text" value=""> <br /> <!-- hide --> <input id="input4" name="input4" type="text" value=""> <br /> <!-- hide --> <input id="input5" name="input5" type="text" value=""> </form>
04f236ed03821d59d8197beb92e2ff02834f3fad96dc499ce37dfbe03686de4a
['1c2accd31cdc479aa3b55400b8ecb988']
May be i'm too late but this can help some one else Possible reasons for SQLSTATE[HY000] [2006] The most common of them is (point 4 from the link) : max_allowed_packet = 1M Try to increase to 4M, 8M or 16M (to do that you need access to mysql config file) One advice don't show mysql server settings (host, login and so on)
3bd214e6ff13e002f28e880dc0091b589cb4bbfd63e5b263f38dd702bb42840f
['1c34d8fad58b47e588127b107eddcdf7']
I'm configuring my resteasy app and need to turn of auto scanning (two jaxrs applications are in the classpath and it breaks at loading) For that reason I have configured my web.xml as follow: <context-param> <param-name>resteasy.scan</param-name> <param-value>false</param-value> </context-param> <context-param> <param-name>resteasy.resources</param-name> <param-value> io.swagger.jaxrs.listing.ApiListingResource, com.mycompany.resource.ClientResource, com.mycompany.resource.AccountResource, ... etc </param-value> </context-param> Is there any way in resteasy to scan by package (com.mycompany.resource.*) name instead of having to add each resource ? It seems it's possible with jaxrs but not resteasy
b3c48ab17d16b822ac680697f5b8dd895331173997a1970d2233f8e5c7137d40
['1c34d8fad58b47e588127b107eddcdf7']
Q1 by putting your oval at coordinates 50, 50. You do not center your oval. from the javadoc try getting the center of your frame first with getWidth() and getHeight() and then use that as values for the center of your oval. Something like: g2d.fillOval(frame.getHeight()/2, frame.getWidth()/2, 200, 200); Q2 coordinates starts from upper left corner
36af86c5492663509998c515b0c27bb39fe515d02956e0330baa671f570bc07b
['1c47a925c2fe4164bd9b4102d09b21dc']
A friend of mine thought about this problem, and I got very interested in it, but I couldn't develop it. Could some help me, because I got stuck trying to verify it's injectivity and surjectivity in a rigorous way. Thanks in advance for any help :) Prove that the function $f:(Z_{+} \times Z_{+}) \rightarrow Z_{+}^{*}$ and $f(x;y)=2^{y}(2x+1)$ is bijective.
344f7d64766b66d842aa459b96c0584d1a5f238f920cde5d443e4b0366913ffd
['1c47a925c2fe4164bd9b4102d09b21dc']
Surfing on the web i found a question that i think is bit interesting :0 The problem: If $\log_{72}144=a$. Compute $\log_{1001}501^{2019!}$ I tried to factorize $72, 144, 1001$ and $501$, but $1001=7*11*13$ and $501=3*167$, and i couldn't figure it out more than this, can someone help me with this nice question? Thanks in advance for any help :)
00593c02e3b6a66aaeb36d32775001be95bc3128378c3a0074db0e945610e7e4
['1c565c21b80e47f0ba556d2c2edeaeba']
I have a PLIST file in my app that contains various configuration data. Some of the data are URLs for accessing a server. This server hosts JSON files for several different versions of our code. What I want to be able to do is have a value in the PLIST file that has the version and then be able to reference it from other values. So the url value in the plist could be https://www.company.com/${VERSION}/jsonfile.svc (where ${VERSION} is a different key int he same plist file).
fa2a273a427c303e4bcfad8baf286d0a1f352e84b628ba976fb36db5060e9736
['1c565c21b80e47f0ba556d2c2edeaeba']
This is not the answer I did in the interview but here is what I wish I had done: Store pointer to first element in dataset Loop over dataset to get count Reset dataset to point at first element Create NSMutableDictionary for storing random indexes Do for loop from i=0 to i=k. Each iteration, generate a random value, check if value exists in dictionary. If it does, keep generating a random value until you get a fresh value. Loop over dataset. If the current index is within the dictionary, add it to a the array of random subset values. Return array of random subsets.
0227bbf0dcac2603efd328ef4f7a8816023d5ec5b78d6240744f67c7c803e34e
['1c588c651045451a9dac26f1919f9860']
I trying to use Spring Cloud Stream with functions as that described in this topic. But it does not work. My function: @SpringBootApplication public class Application { public static void main(String[] args) { SpringApplication.run(Application.class); } @Bean public Consumer<String> consumer() { return s -> System.out.println(s); } } And I push message. to the consumer-in-0 channel via producer that made with @Output annotation: <PERSON> interface Source { @Output("source") MessageChannel producer(); } source.producer().send(MessageBuilder.withPayload("Hello").build()); My yaml channels configuration: spring: cloud: function: definition: consumer stream: bindings: source: destination: consumer-in-0 If I use consumer via @Input configuration - everything ok. Also in rabbitmq manager I see that producer is working and sending messages, but consumer does not consuming them. Help me please somebody. P.S. I also use Spring WebFlux
e1789eb4b5a15a51c95dc9b04d24dc4f0e0c4bb80297ff2d2a97956a38473fd5
['1c588c651045451a9dac26f1919f9860']
I use Java AWS S3 SDK to presign my requests. I have the following code: var request = new GeneratePresignedUrlRequest(bucketName, filename) .withMethod(method) .withExpiration(expiration()); // do something with request return s3Client.generatePresignedUrl(request); What I need to write in place of comment to add custom conditions like content-length-range?
db0478e21f180aed8ba1aa2ae2f7dd4fa8dc23bf7e0d9349a58de6a8a6e8d6e3
['1c78d3297469455f9ce3ebbe08160e23']
I am trying to get an required output from an array. I am getting data array from a for loop like this: Array ( [TIMESLOTID] => 27 [DATE] => za <PHONE_NUMBER>:00 [ProductID] => 196 [VariantID] => 1079 ) Array ( [TIMESLOTID] => 27 [DATE] => za <PHONE_NUMBER>:00 [ProductID] => 196 [VariantID] => 1079 ) Array ( [TIMESLOTID] => 27 [DATE] => za <PHONE_NUMBER>:00 [ProductID] => 196 [VariantID] => 1079 ) Array ( [TIMESLOTID] => 23 [DATE] => ma <PHONE_NUMBER>:00 [ProductID] => 196 [VariantID] => 1083 ) Now If the values of [TIMESLOTID] , [ProductID] and [VariantID] are matched, they should be merged into one array otherwise in a seperate array. The output will look like: Array ( [TIMESLOTID] => 27 [DATE] => Array ( [DATE] => za <PHONE_NUMBER>:00, [DATE] => za <PHONE_NUMBER>:00, [DATE] => za <PHONE_NUMBER>:00 ), [ProductID] => 196, [VariantID] => 1079 ), Array ( [TIMESLOTID] => 23, [DATE] => ma <PHONE_NUMBER>:00, [ProductID] => 196, [VariantID] => 1083 ) Please help me on this. Thanks in advance.
bd1daef7f882204d8e9a257578f20bf3a9239fa1808d2253aeb4eccb19c2625a
['1c78d3297469455f9ce3ebbe08160e23']
I am newbie to magento. I managed to import the categories to one of my magento setup. I have imported about 300 categories successfully. But the problem is the new categories have been created with new category IDs. So I have export the category using this quick script Now I wanted to know that if there is a way to change existing categories ID with the csv I have export. Please help me on this. Thanks in advance.
4b8e12ad225f876df3bb82d39c91fc427dccc1ef586bb571bbcb7023a3670278
['1c7fade383314e3394f3f82ca1d656b9']
I am creating a simple file transfer utility where based on user input I search the file in the folder and transfer the matched file to destination. The problem is camel is moving all the files which are not matching to .camel folder i dont want that to happen below is my snippet. from("file:C:\\input?noop=true;"). filter(header(Exchange.FILE_NAME) .contains("xyz")).split(body().tokenize("\n")). streaming().bean(LineParser.class, "process"). to("file:"+ Constants.getMapping().get(argumentName)+"? fileExist=Append"); Thanks in advance !!
b40eb32b7a67b44361fd8d7cd72332f37ca819c679fa508a4dfbf339b32caf5e
['1c7fade383314e3394f3f82ca1d656b9']
Hi I want below flow to create an empty file once all the files are processed currently it creates after every file processed but not after all the files are processed I tried oncompletion but unable to do from("file:C:\\input?filter=#testFilter") .split(body().tokenize("\n")) .streaming() .setHeader(Exchange.FILE_NAME,simple(newFileName+".dat")) .bean(LineParser.class, "process") .toD("file:C:\\output"+ Constants.getMapping().get(argumentName)+"? fileExist=Append&donefileName=${file:name.noext}.txt"
186d9a4c8b2e838d1e91f12b2b862f3e7a6d251b6a3175757321463ed805a594
['1c805797712b4c72b29a52ad34e41a59']
Given are N books and a book stand.The book stand has only 2 empty shelves. Now we have two restrictions to keep the books on the shelves. Only M (an integer) books can be placed on the top shelf and rest of the books are to be placed on the bottom shelf. The difference between the sum of the weight of the books on the top shelf and the sum of weight of the books on the bottom shelf should be the most among all such arrangements possible. Now, we will be given N and weights of all books and also M. we need to tell this maximum difference. Example : Let N=5 and M=2 and books weights be [4,1,3,2,5] then here answer is 9. How to approach this for given N weights and M. My Approach : I first thought that it could be done with greedy approach by sorting the weights and then putting top M books in first shelf.I want to ask for the correctness proof if this is correct ? Else I want correct solution for this problem ? Constraints : 1<=n<=10000 and we can assume 1<=m <= n / 2. Also 1<=p[i] <= 1000000 Code : int n,m; cin>>n>>m; vector<long long int> a; for(int i=0;i<n;i++){ long long int x; cin>>x; a.push_back(x); } sort(a.begin(),a.end()); long long int upper=0,lower=0; for(int i=0;i<m;i++){ upper+=a[i]; } for(int i=m;i<n;i++){ lower+=a[i]; } cout<<lower-upper<<"\n";
71bd0f3ad4c871f9968040d652657f59e7e3985e4e5778b6c4a40a81f901a619
['1c805797712b4c72b29a52ad34e41a59']
Given Training data of an organisation meter reading recorded at an interval of 15 minutes each day .Like for some N days we will be provided with data. And Now with help of this data we need to tell that on a particular day an organisation is closed or open . I need to know if any link can help in this matter if someone has worked into this field. By closed I mean that on that day consumption of electricity will obviously be almost constant,Though this is just a single feature to take into account. So how to predict this in best way ?
cc8c381e0e5f65edeff9bf88d79c5e114c6a8ddd2f67d8fc073c0d8573bddea7
['1c82172d26d344e4aca48de10b5f5d8a']
I have the following classes related to mathematics/geometry: MathLine, MathPoint, MathVector, MathPlane. On each of these, you can perform rotation and translation transformations. So I created a parent class called GeometricObject, objects which can be transformed in geometric space. Now, I am able to created pure virtual class functions with different implementations for each child class. Now, I want a general function which can take GeometricObject, but "smartly" return what type I actually put in. For example, I have the following function which rotates a Geometric object to a different coordinate system: GeometricObject rotate_object_to_global_coordinate_system(GeometricObject object) { object.rotateX(90); // Pure virtual functions object.rotateY(90); object.rotateZ(90); return object; } If I input a MathLine into it, I expect the function to "cast" into a MathLine, perform MathLine's implementation of my virtual functions, and return a MathLine. I've searched everywhere for this and it seems like this can be done by using either pointers (auto_ptr) or casting (dynamic_cast). This doesn't seem good because I've read that it's a bad way to do it because it sacrifices a noticeable amount of performance. It also seems like a simple feature that a high-level programming language should have. Can this be done? I think it's really important for me to do this because otherwise, I would have to write separate functions which basically perform the same virtual functions for different child classes. I would have to write: MathLine rotate_line_to_global_coordinate_system(MathLine object); MathPoint rotate_point_to_global_coordinate_system(MathPoint object); MathPlane rotate_plane_to_global_coordinate_system(MathPlane object); // etc.
6aba27d6602c07be2a50014043c2ff303ebe4918464fb922bf32a2ac5a985df7
['1c82172d26d344e4aca48de10b5f5d8a']
While developing my iOS app, I encountered this really strange bug with this piece of code: //kit & nextKit are instances of the class CalculationKit [kit searchForPOIsOnDataPoint:1]; PointOfInterest * testPOI1 = kit.visiblePoints[0]; //This outputs 739 for the X [nextKit searchForPOIsOnDataPoint:2]; PointOfInterest * testPOI2 = nextKit.visiblePoints[0]; //This outputs 799 for the X PointOfInterest * bugPOI = kit.visiblePoints[0]; //Now this also outputs 799 for the X //The Y is also the same as nextKit's Y //What happened? //Before, kit.visiblePoints[0] was different from nextKit.visiblePoints //After calculating nextKit's visiblePoints through searchForPOIsOnDataPoint, it changes This happens whenever I do searchForPOIsOnDataPoint: on another instance of a class. It overrides the values for the instance previously declared & assigned. Does anyone have an idea of what could happen inside of the class implementation that will cause this? I have these values in the class which are determined by the DataPoint: @interface CalculationKit : NSObject //Data From XML File @property NSMutableArray * latitudeValues; @property NSMutableArray * longitudeValues; @property NSMutableArray * visiblePoints; //Array of coordinate values //..// @end In the implementation I have variables to store the latitude and longitude values to calculate a single point: @interface CalculationKit () { //The values used in calculation of a single point double workingLatitude; double workingLongitude; //...// } And I get individual data to calculate each point by using this code inside searchForPOIsOnDataPoint: - (void) searchForPOIsOnDataPoint: (int) _DataPoint { //Gets XML Values for current data point workingLatitude = [[self.latitudeValues objectAtIndex: _DataPoint] doubleValue]; workingLongitude = [[self.longitudeValues objectAtIndex: _DataPoint] doubleValue]; //..// } I'm really confused because searchForPOIsOnDataPoint does not depend on another CalculationKit class.
ba919c85eb1af20e0d91932d310050da60bf45ebce185fe436f0c4adb5306642
['1c8634e8c76e430eaef43afe7b90d3c0']
How about this: protected void GetStatesForDdl(DropDownList ddlStateList) { //remove event handler ddlStateList.SelectedIndexChanged -= new EventHandler(ddlState_SelectedIndexChanged); //business as usual AppInputFormProcessor getStates = new AppInputFormProcessor(); ArrayList States = new ArrayList(); States = getStates.GetStates(); ddlStateList.DataSource = States; ddlStateList.DataBind(); // then force it to select desired index ddlStateList.SelectedIndex = (int)Session["ddlState"]; //ok, stick it back to control ddlStateList.SelectedIndexChanged += new EventHandler(ddlState_SelectedIndexChanged); } I suggest usage of local variables in ViewState instead of Session and SelectedValue instead of SelectedIndex.
8e573bde998db677e8c57faaa5994081fd7e46297e1e8cc57e56b265169afd2a
['1c8634e8c76e430eaef43afe7b90d3c0']
The problem: I want to scrap some data from certain webpage (I have administrative access) and to store some information in db for later analysis. Sounds easy, right? I've decided to make simple console prototype and code look something like this: string uri = @"http://s7.iqstreaming.com:8044/admin.cgi"; HttpWebRequest request = WebRequest.Create(uri) as HttpWebRequest; if(request == null) { Console.WriteLine(":( This shouldn't happen!"); Console.ReadKey(); } request.ContentType = @"text/html"; request.Accept = @"text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"; request.AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate; request.Credentials = new NetworkCredential("myID", "myPass"); using (HttpWebResponse response = (HttpWebResponse)request.GetResponse()) { StreamReader reader = new StreamReader( response.GetResponseStream()); while (!reader.EndOfStream) { Console.WriteLine(reader.ReadLine()); } reader.Close(); response.Close(); } This code works on most other sites, but here I get errors 404 (most of the time), 502 or timeout. I've consulted with Firebug (I've took Accept and compression info from there) but to no avail. Using Win-forms and webBrowser control as an alternative is not an option (at least for now). P.S. Same thing happens when I try to get HTML from http://s7.iqstreaming.com:8044/index.html (doesn't need credentials).
3f8bcd5cb495459e812bd626d97942040ecd2c2c15107a2b48d7adee5423f97c
['1c8bd63d85704d119730dfba1615c7e1']
I am trying to isolate date from date/time which is a column in the original csv file. I've isolated the column and change it to just date but I am having a tough time putting it back to the original file: def isolateDate(csv_file): file_in = open(csv_file, "rU") reader = csv.reader(file_in) next(file_in,None) for line in reader: date = line[3] date = date.split() new_date = date[0] return new_date How would I go about putting back new_date variable as the line[3] in the original file
0ee41a41678794065a61d262e9aaabf527f0ccfd864559300085e52114bee9e6
['1c8bd63d85704d119730dfba1615c7e1']
def participated(): part_counters = {} for line in reader: if int(line[6]) > 0: primary = line[7].strip() part_counters.setdefault(primary, 0) part_counters[primary] += 1 return part_counters data_out.seek(0) reader = csv.reader(data_out) next(reader,None) def generalNumber(): gen_counters = {} for line in reader: if int(line[6]) >= 0: primary = line[7].strip() gen_counters.setdefault(primary, 0) gen_counters[primary] += 1 return gen_counters I have 2 functions that try to parse out the same data from the same csv file. I've put thisdata_out.seek(0) reader = csv.reader(data_out) next(reader,None) which worked for each function to parse it but then it won't work if the variables are outside of the function. I am trying to use the return value from each function outside such as: counter_p = participated() counter_g = generalNumber() success_percentage = [counter_p.get(primary)/counter_g.get(primary, 1) for primary in counter_p] What I have is that is that if both functions are active: counter_p = {A01:5, A02:1, A03:2} and counter_g ={} but if I make participated() inactive then counter_g = {A01: 6, A02: 3, A03: 5}
187714a0e1f6be656180d2bab8a0167e5572475a2d767b667c58968b8c7465cb
['1c92b192e6a84e478d7f5146be7dc399']
Going to have to go with the good ol' "it depends on what you want to do" You could use the xp_cmdshell or powershell to change or start some options. For example if you want to start your SQL agent do this: xp_cmdshell 'net start sql server agent (instancename)' If you want to change server protocols with powershell, check out - http://msdn.microsoft.com/en-us/library/dd206997.aspx Powershell is like it says, powerful.
c3a7f058f8ab3985c21da69a4615d67ca1f870f340d90b3b1f4e4b9edaf5f304
['1c92b192e6a84e478d7f5146be7dc399']
si "abbiamo" e "da noi" e' plurale... mentre il "comunicarVi" e' il dare del voi. Quando imparai dattilografia ai tempi di marcocaco <PERSON> nella corrispondenza commerciale era pure un erroraccio, incluso non usare la maiuscola che lo avrebbe trasformato in plurale. Il mio testo, anni 80, lo preferiva al Lei. Ora le regole sono sono cambiate parecchio ma l'esempio dal Treccani e' dell'82...
b167215133d22ba3f00ba5d842b7fb787ed78dda72d05167a6d355e24d65f658
['1c9895021fe24e2396f1eea978509cf2']
Problem I have an Xpage working properly on the test Domino server. On production Domino server it can not be opened, Http 500 error displayed. The two servers has different access control settings in the server document, but the signer of the application (production server) is listed in all programmability restrictions field except "Sign script libraries to run on behalf of someone else" field. Server log [25A4:0014-1604] 2012.11.07 14:06:30 HTTP JVM: SEVERE: CLFAD0141E: Error processing XPage request [25A4:0014-1604] 2012.11.07 14:06:30 HTTP JVM: SEVERE: CLFAD0211E: Exception thrown [25A4:0014-1604] 2012.11.07 14:06:30 HTTP JVM: SEVERE: CLFAD0246E: Exception occurred servicing request for: /applications/application.nsf/xpage.xsp - HTTP Code: 500 [25A4:0014-1604] 2012.11.07 14:06:30 HTTP Web Server: Command Not Handled Exception [/applications/application.nsf/xpage.xsp] CN=First Last/O=Company/C=Country Code Question I have searched the net including IBM pages and forums for possible fix this error, but I have not found useable solution. Does anyone now how to fix this error?
1c38ec7f58d4c57cc40ba06fe715605f755186c674fe388d997e8804d1936c9b
['1c9895021fe24e2396f1eea978509cf2']
Environment I develop Xpages applications locally using Lotus Domino Designer as a web server, but for browser, not for Notes client. Problem I have not found a solution for search in another database using @DbLookup/@DbColumn, because I do not know how to define the server part: "" does not seems working in case of browser database.getServer() returns my Lotus Notes username, which also does not seems to work Question What formula/SSJS code can be used for getting the proper servername?
53e3d999230a117610b7382e72a04147f3dade3c2e488414942cd7adacba91d3
['1cac68861eb84d61944f32e097317596']
When using the markdown to slides application md2googleslides the following places an image on the background of a slide with a title string --- # This is a title ![](https://source.unsplash.com/78A265wPiO4/1600x900){.background} If we don't include a title string it will not be visible in presentation mode but there will still be a placeholder for one in the Google Slides Editor. --- ![](https://source.unsplash.com/78A265wPiO4/1600x900){.background} I was wondering if it is possible to create slides that do not have this placeholder title. Thanks
b6c4c5e2c76c397289f0543890130c2afbf9d840842db50e48f9033134b07fda
['1cac68861eb84d61944f32e097317596']
In Bootstrap 3, I would like to have vertical buttons with text beside them. However, when I put any text after the tag it puts it on a new line. Any idea of how I can keep it on the same line. Thanks! <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/> <div class="row text-center"> <form action="" method="POST" class="form-horizontal"> <div class="btn-group-vertical" data-toggle="buttons"> <label class="btn btn-default"> <input type="radio" value="0">Option A </label> Some text <label class="btn btn-default"> <input type="radio" value="1">Option B </label> Some more text <label class="btn btn-default"> <input type="radio" value="2">None of Above </label> Even more text </div> </form> </div>
04eb6e8f447e22eec02f59bbeaa0431a9000d1c52b03afb28950637f5382e4b6
['1cba6d577be2473596c77c2994feab5b']
I'm using Volley library in my Android project and trying to get an array of objects using JsonArrayRequest, I've tested it on devices before 4.3 and it doesn't work and give the error message "value of type string cannot be converted to jsonArray" on the ones after 4.3. it works and gives this JSON on Toast message [{"cid":"9842025166","Fname":"ظ†ظˆط§ظ„","Sname":"ظ…ط­ظ…ط¯","Tname":"ظ†طµط§ط±","Faname":"ط³ظ„ط§ظ…ظ‡","fullname":"ظ†ظˆط§ظ„ ظ…ط­ظ…ط¯ ظ†طµط§ط± ط³ظ„ط§ظ…ظ‡","gender":"ط£ظ†ط«ظ‰","nationality":"ط£ط±ط¯ظ†ظٹ","phone":"9632589632","address":"ظ†ظٹط¨طھظ†ظ†","cnumber":"","ctype":"ط¹ظ…ظٹظ„ ط¬ط¯ظٹط¯","ftype":"طھط·ظˆظٹط±","fnumber":"","homurl":"http://<IP_ADDRESS><PHONE_NUMBER>","Fname":"ظ†ظˆط§ظ„","Sname":"ظ…ط­ظ…ط¯","Tname":"ظ†طµط§ط±","Faname":"ط³ظ„ط§ظ…ظ‡","fullname":"ظ†ظˆط§ظ„ ظ…ط­ظ…ط¯ ظ†طµط§ط± ط³ظ„ط§ظ…ظ‡","gender":"ط£ظ†ط«ظ‰","nationality":"ط£ط±ط¯ظ†ظٹ","phone":"<PHONE_NUMBER>","address":"ظ†ظٹط¨طھظ†ظ†","cnumber":"","ctype":"ط¹ظ…ظٹظ„ ط¬ط¯ظٹط¯","ftype":"طھط·ظˆظٹط±","fnumber":"","homurl":"http://192.168.1.3/Officer/HomePictures/<PHONE_NUMBER>.png","projecturl":"","dat":"Wednesday 05/10/2017 01:57:24","Longtitude":"35.782985","Latitude":"31.714081","projLangitude":"0","projLatitude":"0","user":"111","updatinginfo":"No","kafeel":"No"}] . this is my code String url = "?NAM=" + "nawal"; JsonArrayRequest jsonArrayRequest = new JsonArrayRequest(Const.Root + Const.NAME + url, new Response.Listener<JSONArray>() { @Override public void onResponse(JSONArray response) { Log.d("nn", response.toString()); Toast.makeText(getBaseContext(), response.toString(), Toast.LENGTH_LONG).show(); for (int i = 0; i < response.length(); i++) { try { JSONObject jsonObject = (JSONObject) response.get(i); String fullname = jsonObject.getString("fullname"); String cid = jsonObject.getString("cid"); String Fname = jsonObject.getString("Fname"); String Sname = jsonObject.getString("Sname"); } catch (JSONException e) { e.printStackTrace(); } } } }, new Response.ErrorListener() { @Override public void onErrorResponse(VolleyError error) { Toast.makeText(getApplicationContext(), error.getMessage(), Toast.LENGTH_LONG).show(); } }); MySingleton.getInstance(getApplicationContext()).addToRequestQueue(jsonArrayRequest); this is server_side <?PHP include_once("conn.php"); if (isset($_GET['NAM']) ) { $NAM=$_GET['NAM']; $query="SELECT * FROM clients where Fname='$NAM' "; $result=mysqli_query($conn,$query); while($row=mysqli_fetch_assoc($result)){ $data[]=$row; } echo json_encode($data, JSON_UNESCAPED_UNICODE); } ?>
0955fb418e9ed433bcb268e2c0d8a57d2a8b16b3779a0491c09ddb3dedd682e6
['1cba6d577be2473596c77c2994feab5b']
I solved this issue by adding this line android.overridePathCheck=true to gradle.properties As this message said This warning can be disabled by using the command line flag -Dcom.android.build.gradle.overridePathCheck=true, or adding the line 'com.android.build.gradle.overridePathCheck=true' to gradle.properties file in the project directory.
e74c5fd6c496228116e6b54d59a572aa1db7aae870ad5536b1c606eab2bf6bad
['1cc35ff246694ebd9930292aaf8f27a8']
I am trying to add some nodes to my graph database from a CSV, which suppose is like: | city continent feature_1 ... |-------------------------------------------------- 0 | Barcelona Europe 1 | Stockholm Europe 2 | New York America 3 | Nairobi Africa 4 | Tokyo Asia The first approach was to simply load this data as: // Insert city nodes USING PERIODIC COMMIT 1000 LOAD CSV WITH HEADERS FROM 'file:///city_data.csv' AS row MERGE (city: City {name: row.city}) Next step was to incorporate the continent information, so I could have nodes of different colors. This means having two labels for each node, which is something I am not sure how to do. Anyway, for the moment I decided to simply have one label instead, which contained the continent information. Since this information is within the CSV file I believe apoc.create.node tool is the way to go. Hence, inspired by How to use apoc.load.csv in conjunction with apoc.create.node I tried the following: CALL apoc.load.csv('file:///city_data.csv') YIELD row CALL apoc.create.node(['row.continent'], {name:['row.continent']}) YIELD node RETURN count(*) This does not raise any error, but it does something different from what I was thinking of. It basically sets the column name ("row.continent") itself as the label...
3e00fcf3b7c38a8114f93ac4c1ef0ed1bb3b7e32a96568ac155219af1b9c1f02
['1cc35ff246694ebd9930292aaf8f27a8']
I just downloaded ElasticSearch and was trying to start Kibana. However I cannot make it. I am working with 5.2.2 versions of both programs (ElasticSearch 5.2.2 and Kibana 5.2.2). Once I initiated ElasticSearch (I assume it is working properly since it responds to a curl -XGET http://localhost:9200 request), I try to start Kibana but the following error appears: $ ./kibana /usr/local/bin/node: bad option: --no-warnings I am working in OSX. Furthermore, I have previously modified the file config/kibana.yml to point to the default elasticsearch.url. Any thoughts? Thanks! EDIT: I inspected the kibana script and the following line is raising the error: exec "${NODE}" $NODE_OPTIONS --no-warnings "${DIR}/src/cli" ${@}
fe6ec7dc22dd03d8dbf445ed52c59682174107d1245f46b25a2d50fe67f8e651
['1ccebda2e91744668490f5d00a8840bb']
Wanted to share a question my boss asked us at morning status meeting, a pretty interesting one one might say. Say you have a survey on your website and an insert query for the database, how would you insert the name of the user answered the survey using 1) C# 2) Javascript given that the user logs into the website with a password and an email. there's a different form for login page and another for index. B. Given that your website has an option for print\send email to client, How whould you insert the name of the user that performed the action (pressed print / send email) using 1) C# 2) Javascript. Interesting one that made me think hard all day
8403bb5943a5c7671634727fa5a672cbb661512399c4f597249b8bda9803cb65
['1ccebda2e91744668490f5d00a8840bb']
After much research, I figured the problem. It was on the client side, my ajax was as follows: $.ajax({ type: "GET", url: "/inc/Handlers/CarSale/CallMeHandler.ashx?phone=" + data.prefix + data.phone + "&name=" + data.name + "&carNo=" + callme.siblings("input").val(), //data: data }) in order to do manual parse I needed to add encodeURIComponent(data.name)... So IE will do the correct parse. thanks all in advance you are awesome for helping!
caa3eeaeb0eaa4213d62ac02593638134da1509dea6b310d760c3cc4bb8e98ca
['1cdf28e38a6b45b794b899bd5c81d512']
The solution could be: nav li:first-child a{ padding-left:0px; } It's because you start list all the li and go to the element that want to change. In your code nav a:first-child:hover you try to list the a and as you can see on each li are just one a, that is because all the a changes with the first-child.
8c4e63f1827e390b2b5dd1a350f0ddf62f1ed8a0cf8f4d1d245a81e4904d9ecd
['1cdf28e38a6b45b794b899bd5c81d512']
I cleaned a little also I created a function to create the addMarker, if you want to add more markers just add into the markersData array and thats it :), maybe you want to add different icons, just add it into markersData array (function(){ var map; var mapslatlng = {lat: 47.406466, lng: 8.5505948}; var markers = []; var markersData = [ ['marker 1', 47.406466, 8.5505948], ['marker 2', 47.406466, 8.5565948] ]; function initialize() { var mapOptions = { center: mapslatlng, mapTypeId: google.maps.MapTypeId.TERRAIN, zoom: 15 }; map = new google.maps.Map(document.getElementById('mapDiv'), mapOptions); mapStyle(); addMarker(); } function mapStyle() { var usRoadMapType = new google.maps.StyledMapType([ { "featureType": "road.highway", "elementType": "geometry", "stylers": [ { "saturation": -100 }, { "lightness": -8 }, { "gamma": 1.18 } ] }, { "featureType": "road.arterial", "elementType": "geometry", "stylers": [ { "saturation": -100 }, { "gamma": 1 }, { "lightness": -24 } ] }, { "featureType": "poi", "elementType": "geometry", "stylers": [ { "saturation": -100 } ] }, { "featureType": "administrative", "stylers": [ { "saturation": -100 } ] }, { "featureType": "transit", "stylers": [ { "saturation": -100 } ] }, { "featureType": "water", "elementType": "geometry.fill", "stylers": [ { "saturation": -100 } ] }, { "featureType": "road", "stylers": [ { "saturation": -100 } ] }, { "featureType": "administrative", "stylers": [ { "saturation": -100 } ] }, { "featureType": "landscape", "stylers": [ { "saturation": -100 } ] }, { "featureType": "poi", "stylers": [ { "saturation": -100 } ] } ], {name: 'Road Atlas'}); map.mapTypes.set('usroadatlas', usRoadMapType); map.setMapTypeId('usroadatlas'); } function addMarker() { for (var i = 0; i < markersData.length; i++) { var marker = markersData[i]; markers.push(new google.maps.Marker({ position: {lat: marker[1], lng: marker[2]}, title: marker[0], map: map, draggable: true })); }; } google.maps.event.addDomListener(window, 'load', initialize); })();
eb392c614dc8bdaca7e8422cfa822f27eed4f3ca4bc970a32f29bc6d8238b44c
['1ce59795612a4a5cab3ee95efe5247c9']
i have a data frame A B C True False False False False True True False False False False False I want to get column named "result" which will return the column name if it is true and nan, if any of it is not True. Expected Column result A C A na
e26ad0dc44555a77d4f6a3b5ee5be8ee9a08ceb82f26bd4eb5d92b4196a05967
['1ce59795612a4a5cab3ee95efe5247c9']
I have a data frame Category Group Subgroup Price Ri a s 1 we a s 2 ge a c 4 re b f 1.5 mb b f 2.5 I want to know the number of unique category if I groupby the column Group and Subgroup. for ex: The results should be like this if I group by Group and subgroup Group Subgroup No_of_UniqueCategory Price a s 2 3
3e8343698388d7af4834c6f8bd5369c2934c96dcb1460491801e65adeaceda40
['1ce7bead775945b588cba13ac189b497']
I have a 1 page rdlc report which exports fine to pdf, but when I export it to excel it divides the report into 2 pages horizontally in print preview as if the report width is larger than the page size, and apparantly the InteractiveWidth, PageWidth and ReportWidth properties have no effects with excel. so is there any other way to control the page width?
49cd55df8dbde2079a816009cccd605fc79c6263b728d646c0f21def58ef6a64
['1ce7bead775945b588cba13ac189b497']
You are getting this error because you are passing a string (id) to the View function, this overload searches for a view with the name passed in the string (in this case the username). if you are simply trying to pass the username directly to the view you can use something like a ViewBag, so your code should look like this: public ActionResult Profile(string id) { if (UsersRepository.GetUserByUsername(id) == null) { return PartialView("~/Views/Partials/_UsernameNotFound.cshtml", id); } ViewBag.Username=id; return View(); }
97870649d0c5a6b669acfed95b38cbe2eead1f8bc5fea12ec3f8b6756bcdd88a
['1cf6abd68c384646b3e27507155ba2f0']
I following the official support of sonarqub http://docs.sonarqube.org/display/SONAR/SCM+support and I got the error at above. did I miss something need to config, or configure wrong 08:46:33.723 INFO - Sensor SCM Sensor... 08:46:33.897 INFO - SCM provider for this project is: git 08:46:33.898 INFO - Retrieve SCM blame information... 08:46:33.915 INFO - 632 files to be analyzed 08:46:34.377 INFO - Author: PersonIdent[Not Committed Yet, , Tue Feb 3 08:46:<PHONE_NUMBER> +0000] 08:46:34.379 INFO - Source commit: null 08:46:34.377 INFO - Author: PersonIdent[Not Committed Yet, , Tue Feb 3 08:46:<PHONE_NUMBER> +0000] 08:46:34.924 INFO - Source commit: null INFO: ------------------------------------------------------------------------ INFO: EXECUTION FAILURE INFO: ------------------------------------------------------------------------ Total time: 1:01.699s 08:46:35.891 INFO - Author: PersonIdent[Not Committed Yet, , Tue Feb 3 08:46:<PHONE_NUMBER> +0000] 08:46:34.930 INFO - Author: PersonIdent[Not Committed Yet, , Tue Feb 3 08:46:<PHONE_NUMBER> +0000] 08:46:35.930 INFO - Source commit: null Final Memory: 27M/318M INFO: ------------------------------------------------------------------------ ERROR: Error during Sonar runner execution ERROR: Unable to execute Sonar ERROR: Caused by: Unable to blame file thanks very much.
9c34989c003303e06f0997c5a0b4b414b3d12123d66b47b5392d294fce826a75
['1cf6abd68c384646b3e27507155ba2f0']
I'm using phantomjs for test my site on Jenkins, and confused with got the different result of the TAP within two builds, There is nothing changed. However, The result of Junit xml are same as we expected. Can someone explain or help to me? Thank you very much! This is what I compared the result of TAP. 3,4c3,4 < ok 1 B (82) overall score < not ok 2 D (68) ynumreq: Make fewer HTTP requests --- > not ok 1 C (78) overall score > ok 2 B (80) ynumreq: Make fewer HTTP requests 24c21 < message: There are 50 static components without a far-future expiration date. --- > message: There are 45 static components without a far-future expiration date. 77c69,81 < ok 6 A (100) ycompress: Compress components with gzip --- > not ok 6 F (12) ycompress: Compress components with gzip
bbaa250c823bcc5e77b10b8d86a746292dc6262233ee24c76f79863184b8cc67
['1cffa8f734c5418eab2d1603440e51af']
Is there a way to evaluate $\int_{0}^{\phi}\vec{e_{\theta}}d\phi$, where $e_{\theta}$ is the usual unit vector in the theta direction in spherical polars without converting into Cartesian or cylindrical coordinates? If there isn't why, conceptually, not? Apologies in advance if this question has been answered elsewhere, I couldn't find an answer when looking myself - any help is much appreciated!
962fbfffc555d6c26e6458eed28465b8da9563b12a0f534cadbe31e68c65f1f5
['1cffa8f734c5418eab2d1603440e51af']
For what it's worth, my own attempt at an answer is: Whatever the integral is, we would need to integrate it into a constant unit vector along the line of integration. So one way of doing this is to convert into Cartesian coordinates since the unit vectors then don't depend on position. I'm not sure why the first part of the claim is true, though.
3f1d74151601c6a8ab16a76678300db7df054b8d878f94e9a7f19766a37e7155
['1d16da0c0e384e9499d6524e024abe82']
You're welcome. I believe that any other solution will boil down to the same thing. To compute _mathematically_ the number of bits of a number $a$, you can use the formula $n = \lfloor log_2(a) \rfloor+1$ and the $k^{th}$ bit of a number is given by $\lfloor\frac{a}{2^{n-k}}\rfloor\ modulo\ 2$. In C language you would of course use bitwise operations instead (>> and <
93f8a303f05c9826a3c1a12959ae0f5f7b7e0c6c67be18898a255f3caa8224a8
['1d16da0c0e384e9499d6524e024abe82']
Check [re_format(7)](http://www.mirbsd.org/man7/re_format), especially the section “BASIC REGULAR EXPRESSIONS” starting from “**The following is a list of basic regular expressions:**”, which are used in [grep(1)](http://www.mirbsd.org/man1/grep). These differ from shell [glob(7)](http://www.mirbsd.org/man7/glob)s, which is what [find(1)](http://www.mirbsd.org/man1/find) uses.
8af9c623821cb1d474ed5c0d8d6cde1e6051d6d45656940fcf05a5bc32c3513b
['1d21e145966c443a9ce326fa361c6053']
I have a column that has value which look similar to this: data.reg2$dummy.DR58 In every row, I want to find "data.reg2$" and replace it with "beta." - all rows have that data.reg2 at the beginning. I've tried a bunch of variations of gsub, etc., but nothing is actually doing the replacement for some reason. This is the code I currently have (which isn't working): cluster.model <- gsub('data.reg2$', 'beta.', cluster.model$betas) Any thoughts?
278514577a837ef451b4b170f8594396228957fd3042629a4055709594eb37d1
['1d21e145966c443a9ce326fa361c6053']
I'm working with a Probit model, and would like to calculate the probabilities from my model for each observation in my DF. I know I can calculate this using the formula, however I am wondering if there is a quick way to output the probabilities and append them to my DF. I am running the following model: attach(non.part.2) y <- cbind(E) x1 <- cbind(tech.ems, med.com, tech.nonemerg) probit <- glm(y ~ x1, family = binomial (link = "probit")) summary(probit) I am running several models, so it would be nice to be able to have R spit out the probabilities and allow me to name them in my DF(non.part.2) - something like p_x1 - so that I can run summary stats on the various models later. Any help is much appreciated!
8b1c1b99ffb7efe863a6c5773671388827242a99637a364033f57451227f4730
['1d2d1080b002420c8914b92a0227ce1c']
Your friendservice doesn't have app.py inside. You should whether copy it so your Dockerfile looks like FROM python:3 WORKDIR /code COPY requirements.txt ./ RUN pip install -r requirements.txt COPY app.py ./ Or you can attach volume in your docker-compose.yml so it looks like ... friendservice: build: ./Pirmas command: python app.py ports: - 5000:5001 volumes: - ./Pirmas:/code networks: - mynet ...
570a703421461e4680ba636ab5a2e11d113c94618ca8eb8050ee35a0794816e9
['1d2d1080b002420c8914b92a0227ce1c']
To investigate your issue with procs you can see comments in source code of to_proc method here http://ruby-doc.org/core-2.2.0/Method.html#method-i-to_proc. So to_proc creates new Proc not with body of method, but with calling of this method (bounded to main in this case). But I think in your specific case it would be better to write something like: module ModuleMixin def extending_relation_method # some processing self end end class Model < ActiveRecord<IP_ADDRESS>Base has_many :field_values, as: :owner, autosave: true do include ModuleMixin end end
82477b16d1022daab9c60e738d7766fdd06d8c196fe9a0d310d4d91b5391cda2
['1d3826378e5c4c51a54c957ab3030276']
I've successfully created a magento 2 module with custom payment method using mage2gen.com, the problem is i need to show dynamic payment information at order email and pdf. I try check the app/code/Magento/Sales/Model/Order/Email/Sender/OrderSender.php turns out the $transport['payment_html'] is being rendered by block layout in app/code/Magento/Payment/Helper/Data.php but i don't know how to define this payment information block layout for email in my custom module
cf88c4971dfabff2fc196fade953bac65be3f1a270d478813929e3339ed482b0
['1d3826378e5c4c51a54c957ab3030276']
i created an email template in Admin > Marketing > E-Mail Templates like this: I tried to add to my module email template html by using the template subject like this: {{template config_path="design/email/header_template"}} <table> <tr> <td> Hello </td> </tr> </table> {{trans "Footer"}} my new custom template content wont load, instead it only print plain text {{trans "<PERSON>"}}
03a378c4b41b69b9c8caa484d81b3dfdbba990cd8fddd3b665058e1f41dc083f
['1d3cdf08e7864894b7786d38f8243868']
I am new in PHP+mysql and trying to make a bidding website and created a page that displays the current items for auction and their respective attributes. I have a bid and history button in each row which is specific to each row-data. How can I retrieve the row data through clicking the row-specific button. I have no primary key in the current table so I'm using Serial number as the distinct column for now: The bid and history buttons have specific classes associated with them. How can I check these dynamically formed buttons for the click event and retrieve the respective row data? Code: <?php $conn = mysqli_connect("localhost","root","","users"); $sql = "Select * from bid_items"; $result = $conn->query($sql); $table_str = '<table id="product table"><tr> <th>Sno</th><th>Owner Name</th><th>Item Name</th><th>Closing date</th><th>Bid amount</th><th>Status</th><th>Bid</th><th>History</th></tr>'; $i=1; if($result->num_rows>0) { while($row = $result->fetch_assoc()) { if($row["closing_date"]>date("Y-m-d")) { $table_str .= '<tr>'; $table_str .= '<td>'.($i++).'</td><td>'.$row["owner_name"].'</td><td>'.$row["item_name"].'</td><td>'.$row["closing_date"].'</td><td>'.$row["bid_amount"].'</td><td>Open</td><td>'.'<input type="submit" class="bids" value="bid">'.'</td><td>'.'<input type="submit" class="hist" value="history">'.'</td>'; $table_str .= '</tr>'; } else { $table_str .= '<tr>'; $table_str .= '<td>'.($i++).'</td><td>'.$row["owner_name"].'</td><td>'.$row["item_name"].'</td><td>'.$row["closing_date"].'</td><td>'.$row["bid_amount"].'</td><td>Closed</td><td>'.'<input type="submit" class="bids" value="bid" disabled>'.'</td><td>'.'<input type="submit" class="hist" value="history">'.'</td>'; $table_str .= '</tr>'; } } } $table_str.='</table>'; echo $table_str; ?> <!DOCTYPE html> <html> <head><title>Bidding Items</title></head> <style type="text/css"> table{ border-collapse:collapse; width:100%; color: #d96459; font-family:monospace; font-size:20px; text-align:left; } th { background-color:#d96459; color:white; } tr:nth-child(even) { background-color:#f2f2f2; } </style> <body></body> </html> Current output:
a8687b53ae5a3e6a919681b5acad6248a44f46c8176600d3646c586066c04fee
['1d3cdf08e7864894b7786d38f8243868']
I'm creating a program to create a queue and add,delete and display elements. For this I create a list, then take input from users and append the same number of 0s and then proceed normally. The problem arises that the value of rear and front does not change and remains constant which leads to it not displaying and also not filling up. How can I fix this. l=[] global front global rear front=-1 rear=-1 print("Enter the number of elements ") maxsize=int(input()) i=0 q=0 for q in range(0,maxsize): #for creating an array with user input number of 0s l.append(0) def isFull(): if(rear==maxsize): return 1 else: return 0 def isEmpty(): if(front==-1 and rear==-1): return 1 elif(front==rear): return 1 else: return 0 def enqueue(n): if(isEmpty()==1): front=0 rear=0 l[rear]=n rear=rear+1 else: l[rear]=n rear=rear+1 def dequeue(): if(isEmpty()==1): return 1 else: front=front+1 while(i==0): print("Add an element ?(0) \nDelete an element?(1) \nDisplay the elements?(2)\n") a=int(input()) if(a==0): if(isFull()==1): print("Queue is full") else: b=int(input()) enqueue(b) if(a==1): dequeue() if(a==2): for c in range(front,rear): print(l[c])
a0e92d521d364a28350681fb484befe105ea50ed2674b4dc56b865d1f78f2490
['1d4c882164ee4dbf94830c8aa7d00c2e']
Vueの[ライフサイクル](https://jp.vuejs.org/v2/guide/instance.html#%E3%83%A9%E3%82%A4%E3%83%95%E3%82%B5%E3%82%A4%E3%82%AF%E3%83%AB%E3%83%80%E3%82%A4%E3%82%A2%E3%82%B0%E3%83%A9%E3%83%A0)です。タイミングは上部へスクロールしてから、Vueの[$forceUpdate()](https://jp.vuejs.org/v2/guide/components-edge-cases.html#%E5%BC%B7%E5%88%B6%E6%9B%B4%E6%96%B0)で画面を強制的に再描画させます。
c684056c223fd3e8eb681655d4f8df3e79aaed1faf9f1f225ee75001ca49c0fa
['1d4c882164ee4dbf94830c8aa7d00c2e']
Extending the answer from <PERSON>: Within ECD (Evidence Centered Design), there are quite a few possible models for 'cognitive demand'. Probably the widest use within LSA (large scale assessment) such as PISA, but also for example Smarter Balanced or PARCC, models are based on <PERSON>'s concept of DOK (Depth of Knowledge). General resources of <PERSON>'s concept can easily be found on the internet, so I won't even start listing resources. Specifically for Math, I find the conception of cognitive rigor by <PERSON> pretty enlightening. That said, one can start discussing the relevance of these models. This is not a new question, but discussed (or at least commented...) on MESE: Which mental model is most useful when thinking about math education: <PERSON>'s DoK, CCSM's Aspects of Rigor, or <PERSON>'s Taxonomy? Are there others?
4a7849205ac6257f30b18b772837697640d05ca283a42bf6642d45734289a619
['1d636e7289d146348f4c1270b99852fe']
I'm most fluent in Bash, but I'm sure you could do the same thing in Power Shell. I'm assuming that you are going to convert to .jpg format and store all the files in a ./output/ directory. My script would look like this: j=0; for i in `find . -type f \( -iname *.jpg -o -iname *.jpeg -o -iname *.png -o -iname *.gif -o -iname *.bmp \)` do j=$(($j+1)) convert $i output/`printf "%06X" $j`.jpg done This script will start a counter '$j' from 0. Then it finds all files that are of type file (rather than directories or symlinks or other such things) and match your specified extensions in a case insensitive manner. The ( ) groups a series of items that are each joined together with a -o OR specifier for the find command. We use a for loop to go over all the found files noting them with $i. Inside the loop, I increment the counter $j. Then I convert the filename as I found it to .jpg and output into the ./output/ directory. The hex numbered filename is 0 padded out to six digits using a printf command.
c0e8210496483ac939d1b9960c1192b6a89bfbffd6053db123cbf9289ff18c3c
['1d636e7289d146348f4c1270b99852fe']
Here's a slightly different way to do case sensitive searching. Note the lack of "i" in the creation of the regexp in the second example, which is what causes case insensitivity in the default implementation. case insensitive: $('#elem').autocomplete({ source: array }); case sensitive: $('#elem').autocomplete({ source: function(request, response) { var matcher = new RegExp( $.ui.autocomplete.escapeRegex(request.term, "")); var data = $.grep( array, function(value) { return matcher.test( value.label || value.value || value ); }); response(data); } });
dce6de42853b76e4a979a85ceeff0e0bdb2ef1805e8bfb0521daeaa20eb64e77
['1d6f2f51a96745c2807003d20979838e']
This maybe useful for others as I ran into the same unclarity about deleting a DNS record from a Godaddy domain using their API. Godaddy doesn't support deleting an individual record. From their support on the question whether it was possible to delete a record: Dear Sir/Madam, This API call does not exist at this time and it is something on our backlog to build out but there is no ETA to have it created. Current you can use the Put endpoint on the record type to replace all but the one you do not want to keep or you may go into our UI to remove it that way. See their api documentation for what is available (at this date July 2020). However, what you can do is replace all the existing records with a new set. So suppose you have three A records with subdomain SD1, SD2 and SD3 and you want to remove SD2. You could sent an update command using: curl -X PUT "https://api.godaddy.com/v1/domains/<yourdomain>/records/A" -H "accept: application/json" -H "Content-Type: application/json" -H "Authorization: <yourAPIKEY>" -d "[ { \"data\": \"<IP for SD1>\", \"name\": \"SD1\", \"ttl\": 3600 }, { \"data\": \"<IP for SD3>\", \"name\": \"SD3\", \"ttl\": 3600 }]" Which will result in two A records one for SD1 and one for SD3. As long as you have at least one recordtype left (this also works for MX, MS, TXT) you will be able to remove others. If you want to remove the last you have to go back to the Godaddy GUI, unfortunately.
20cb110a5950c8998773c6edb7151113621c7e627f8262888f31ba076a1c4457
['1d6f2f51a96745c2807003d20979838e']
You might check the JMeter plugin tools. There is a commandline utility here: http://jmeter-plugins.org/wiki/JMeterPluginsCMD/ which is capable of generating images. These can be shown in Jenkins. Another useful link can be found here: https://github.com/codecentric/jmeter-graph-maven-plugin (there is a link to a blog there too, but that is in German). Hope it helps you in the right direction. Edit: I used loadosophia.org in the past to generate reports.
59b15760b0ffc08a84c0bc5ac7a90690582fdbf9ff33218fdd936235870d3371
['1d9d02e561f8456ba476eb04e3fabdf0']
Les cuento, estoy trabajando con java en android haciendo un tipo chat, mi duda o pregunta, es que cuando envió mensajes desde la tableta mi app truena por que introducir un ?, ¿saben si existe alguna validación para no suplantar el signo "?" ?. Uso un recycler para pintar los datos de la misma documentación de firebase. Agradezco su atención de antemano.
86d070faa4b730bd3229fbd2d6172f43577d243ab769e73fd04c8de5373ea514
['1d9d02e561f8456ba476eb04e3fabdf0']
Want To Ask i did geekbench test on 2 types of RAMs on my  MBP 13" 2.9ghz i7 mid 2012. 1-Crucial 16GB Kit (8GBx2) DDR3L-1600 SODIMM  32bit test 2913 Single-Core Score 6105 Multi-Core Score 64 bit test 3132 Single-Core Score 6754 Multi-Core Score. 2-Kingston HyperX Impact Black 16GB(8GBx2) 1866MHz DDR3L Laptop RAM (Low Voltage - HX318LS11IB/8) 32bit test 2715 Single-Core Score 5814 Multi-Core Score. 64bit test 2986 Single-Core Score 6975 Multi-Core Score so i would like to know any opinion about RAM is better for my Macbook Pro 13" 2.9ghz i7 mid 2012??
72ea1315881f0724cc7e2fcedd479a0f2cd215445b9f8619dd894bb138e31365
['1dc41cf9ed364a2e905ca223ca150fd7']
Using ChannelFuture#cause() I noticed I was not serializing a ByteBuf object, but a GenericRecord instead. Using ByteBuf response = Unpooled.copiedBuffer(genericRecord.toString(), charset); ChannelFuture future = ctx.writeAndFlush(response); the GenericRecord gets converted to a ButeBuf and sends a response using the writeAndFlush method. The test client using a Socket implementation somehow never really received a response, but by using a SocketChannel this was resolved as well.
0843249842b1757ca4051d14a1472ac2bdc9893e7de95c28286d391720c0a177
['1dc41cf9ed364a2e905ca223ca150fd7']
I'm receiving events which end up in Kafka. From these events I fetch the id using a Kafka Streams application and posting it back to Kafka as a pair of (id, 1) in another topic. Then I would like to see if the id exists already in ElasticSearch, and if so update its counter, otherwise create a new record in ElasticSearch with the id from Kafka and counter set to 1, i.e. an upsert of the record (id, 1) to ES. I was hoping to use Kafka Connect to ElasticSearch for this, but it seems to be not that straightforward if possible at all. I can see that adding records to ES works, but merging with existing records seems is something I haven't found out about yet. Is this possible already, and if so, how, and if not, is it planned to be possible in a nearby release?
0b6299af49cb66e3a23e6afbddcacc5cf1364266fa2f59a332b42a02301fa98e
['1df0b2ae4a8e4980ab1e813d2c114cb9']
I'm setting up TeamCity 7.0.3 on a build machine. Everything is working OK apart from the Google Talk notifications using the Jabber notifier. When I send a test notification it works fine. But when the build completes/fails I don't get any notifications. The notifications do work locally on the machine using the system tray notifier. I have registered for all projects and all events but stil nothing is coming through. I am using the same gmail account to send the message as to receive it which could be a bit odd but the test messages work. This could be a firewall issue I guess but again the test message works. Any ideas?
2faee431d5ce212988e2f9091dad2bb5d27cb62ddcd752b16be7b9c395905a7b
['1df0b2ae4a8e4980ab1e813d2c114cb9']
Why is it possible to use an object initializer to set a private set auto property, when the initializer is called from within the class which owns the auto property? I have included two class as an example. public class MyClass { public string myName { get; private set; } public string myId { get; set; } public static MyClass GetSampleObject() { MyClass mc = new MyClass { myName = "Whatever", // <- works myId = "1234" }; return mc; } } public class MyOtherClass { public static MyClass GetSampleObject() { MyClass mc = new MyClass { myName = "Whatever", // <- fails myId = "1234" }; return mc; } }
220d07a6fc1386b22ba586b0f1b7934f9dd50ae9ecdd42e4e0cc3ac37df92ceb
['1df498942de84e689139d9bc930e0702']
I am doing add with a compute shader. All input-output data are stored in VkImage, the format is VK_FORMAT_R32_SFLOAT. In the shader, the corresponding layout is r32f. I have two questions about this: When imageLoad a r32f data, imageLoad always returns 4 components vec4 data. So will this waste some memory? It seems imageLoad doesn't support return a single component of data. https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/imageLoad.xhtml The real output data, every 4 data followed by 4 0.0. Does it mean r32f is 64 bits? The used shader (The test project: https://github.com/math3d/VulkanCompute/blob/master/examples/add_imager32f/add_imager32f.cpp): layout(local_size_x = 1, local_size_y = 1) in; layout(binding = 0, r32f) uniform image2D outputValues; layout(binding = 1, r32f) uniform readonly image2D values; layout(binding = 2, r32f) uniform readonly image2D filterValues; void main() { uint row = (gl_GlobalInvocationID.x); uint col = (gl_GlobalInvocationID.y); vec4 x = imageLoad(values, ivec2(row, col)); vec4 w = imageLoad(filterValues, ivec2(row, col)); vec4 res = x + w; imageStore(outputValues, ivec2(gl_GlobalInvocationID.xy), res); } The result: Compute input: 0.000000 1.000000 2.000000 3.000000 4.000000 5.000000 6.000000 7.000000 8.000000 9.000000 10.000000 11.000000 12.000000 13.000000 14.000000 15.000000 16.000000 17.000000 <PHONE_NUMBER> 19.000000 20.000000 21.000000 22.000000 23.000000 24.000000 25.000000 26.000000 27.000000 28.000000 29.000000 <PHONE_NUMBER> 31.000000 Compute filter: 0.000000 1.000000 2.000000 3.000000 4.000000 5.000000 6.000000 7.000000 8.000000 9.000000 10.000000 11.000000 12.000000 13.000000 14.000000 15.000000 16.000000 17.000000 <PHONE_NUMBER> 19.000000 20.000000 21.000000 22.000000 23.000000 24.000000 25.000000 26.000000 27.000000 28.000000 29.000000 <PHONE_NUMBER> 31.000000 Compute output: 0.000000 2.000000 4.000000 6.000000 0.000000 0.000000 0.000000 0.000000 8.000000 10.000000 12.000000 14.000000 0.000000 0.000000 0.000000 0.000000 16.000000 <PHONE_NUMBER> 20.000000 22.000000 0.000000 0.000000 0.000000 0.000000 24.000000 26.000000 28.000000 <PHONE_NUMBER> 0.000000 0.000000 0.000000 0.000000 32.000000 34.000000 36.000000 38.000000 0.000000 0.000000 0.000000 0.000000 <PHONE_NUMBER> 42.000000 44.000000 46.000000 0.000000 0.000000 0.000000 0.000000 48.000000 50.000000 52.000000 54.000000 0.000000 0.000000 0.000000 0.000000 56.000000 58.000000 60.000000 62.000000 0.000000 0.000000 0.000000 0.000000 ```
1caa12fa248a298229a5a36f383399e26a122e35f541d8cf44d092a8698a2c9c
['1df498942de84e689139d9bc930e0702']
I think there are another two options: Angle, https://github.com/google/angle, or Dawn, https://dawn.googlesource.com/dawn. If your game is written by OpenGL, Angle can help you translate it into several backends, such as Vulkan, D3D. And if you are designing a game from the beginning, you may try writing it by Dawn. Dawn is similar to a middle layer, if your game is based on dawn, it can make sure your game runs smoothly on the different backends.
bafa1dfdbd4556725ee416d98af6c377e603bcabd519c82f16ddb52947f0c886
['1e0b8688ee2c4d92a9e6adb007024340']
I have an XML file that returns like the following: <games> <game> <appID>1234</appID> <name>game 1</name> </game> <game> <appID>5678</appID> <name>game 2</name> </game> <game> <appID>9123</appID> <name>game 3</name> </game> </games> I would like my code to get the url parameter gid to $gid, search the xml for that appid and then assign $gamename if it matches in the XML. Currently it will only work when the first game is clicked. It doesn't seem to search past the first < game >. $gid = (int) $_GET['gid']; $gamespage = simplexml_load_file("http://gamepage.com/games?xml=1"); $gamelist = $gamespage->games; if ($gid == $gamelist->game->appID) { $appid = $gamelist->game->appID; $gamename = $gamelist->game->name; } else { echo "No game stats. <br />"; }
e800c5689ccf4548f164f5f541c46775f6b08a59248a623503011a46701b2e12
['1e0b8688ee2c4d92a9e6adb007024340']
I'm loading an XML file into the page and want to get information from the URL parameter and put it in the url for the XML file that simplexml is laoding. is this possible? Here is the current code: $gid = $_GET['gid']; $gach = simplexml_load_file('http://xml.com/GIDHERE/page.html?xml=1'); How can I put $gid where it says GIDHERE ?
abdbdb95a4448dd1ad19ef87bf7ec3e6aab7b05ca6360f3ec2d525cf8dbcadfa
['1e0d428768b74feb9104999b12f2eed0']
I'm having trouble with list and string formatting, and writing the changes to a new file. What I'm looking for is: STRINGS BEFORE imported txt file contents (a list of string values) STRINGS AFTER Where both the preceding and following STRINGS are already defined, and everything is written to a new file! My end goal, is so that when i import a txt file (containing a list) and run the code, it then is printed to a new file with pre-defined strings added before and after the imported txt file's list. My code right now is as follows: text_file = open(r"text_file path", "r") lines = text_file.read().split(',') lines.insert(0, "String Values Before") lines.insert("String Values After") text_file.close() lines.write("new_file.txt", "w+") The problem now is that I am inserting to the list, whereas I want the strings to be separate to the list! I've been able to produce what I want the written file to look like in the console with this code here: FIRMNAME = "apple" FILETYPE = "apple" REPLYFILENAME = "apple" SECMASTER = "apple" PROGRAMNAME = "apple" text_file = open(r"textfile path", "r+") lines = text_file.readlines().split('\n') print(("START-OF-FILE \nFIRMNAME= ") + FIRMNAME) print(("FILETYPE= ") + FILETYPE) print(("REPLYFILENAME= ") + REPLYFILENAME) print(("SECMASTER= ") + SECMASTER) print(("PROGRAMNAME= ") + PROGRAMNAME) print("START-OF-FIELDS") print("END-OF-FIELDS") print("START-OF-DATA") pprint.pprint(lines) print("END-OF-DATA") print("END-OF-FILE") I just can't figure out how to write this to a new file! Help!
435b785fbc911a8f44c076398db3f83f3f89dd14d7edd07edffd23036e2de9db
['1e0d428768b74feb9104999b12f2eed0']
In this project I've converted a csv file to an xls file and a txt file to an xls file. The objective is to then compare both xls files for differences and print out any differences to a third excel file. However, when the differences are printed they include any entry with an integer above 999, as any integer from my converted csv file is treated as a string instead of an integer. Therefore it treats a value such as 1,200 (in my converted xls file) differently from 1200 (in my converted txt file) due to the comma in the converted csv excel file. My question is: Is there a way to convert the string interpreted integers, back to being interpreted as integers? Otherwise, is there a way to delete all commas from my xls files? I have tried the usual dataframe.replace methodology and it is ineffective. Below is my code: #import required libraries import datetime import xlrd import pandas as pd #define the time_handle function to name the outputted excel files time_handle = datetime.datetime.now().strftime("%Y%m%d_%H%M") #identify XM1 file paths (for both csv origin and excel destination) XM1_csv = r"filepath" XM2_excel = r"filepath" + time_handle + ".xlsx" #identify XM2 file paths (for both txt origin and excel destination) XM2_txt = r"filepath" XM2_excel = r"filepath" + time_handle + ".xlsx" #remove commas from XM1 excel - failed attempts #XM1_excel = [col.replace(',', '') for col in XM1_excel] #XM1_excel = XM1_excel.replace(",", "") #for line in XM1_excel: #XM1_excel.write(line.replace(",", "")) #remove commas from XM1 CSV - failed attempts #XM1_csv = [col.replace(',', '') for col in XM1_csv] #XM1_csv = XM1_csv.replace(",", "") #for line in XM1_csv: #XM1_excel.write(line.replace(",", "")) #convert the csv XM1 file to an excel file, in the same folder pd.read_csv(XM1_csv).to_excel(XM1_excel) #convert the txt XM2 file to an excel file in the same folder pd.read_csv(XM2_txt, sep="|").to_excel(XM2_excel) #confirm XM1 filepath filepath_XM1 = XM1_excel #confirm XM2 filepath filepath_XM2 = XM2_excel #read relevant columns from the excel files df1 = pd.read_excel(filepath_XM2, sheetname="Sheet1", parse_cols= "H, J, M, U") df2 = pd.read_excel(filepath_XM1, sheetname="Sheet1", parse_cols= "C, E, G, K") #remove all commas from XM1 - failed attempts #df2 = [col.replace(',', '') for col in df2] #df2 = df2.replace(",", "") #for line in df2: #df2.write(line.replace(",", "")) #merge the columns from both excel files into one column each respectively df4 = df1["Exchange Code"] + df1["Product Type"] + df1["Product Description"] + df1["Quantity"].apply(str) df5 = df2["Exchange"] + df2["Product Type"] + df2["Product Description"] + df2["Quantity"].apply(str) #concatenate both columns from each excel file, to make one big column containing all the data df = pd.concat([df4, df5]) #remove all whitespace from each row of the column of data df=df.str.strip() df=["".join(x.split()) for x in df] #convert the data to a dataframe from a series df = pd.DataFrame({'Value': df}) #remove any duplicates df.drop_duplicates(subset=None, keep=False, inplace=True) #print to the console just as a visual aid print(df) #output_path = r"filepath" #print the erroneous entries to an excel file df.to_excel("XM1_XM2Comparison" + time_handle + ".xls") Also, I realize the XM1 and XM2 file names with regards to df1 and df2 is a bit confusing, but I simply renamed my files. It makes sense in terms of the files and where they belong in the code! Thank You
f5aacd0c2cf581dede4bc5c3b7f60d9c6dbcc9eb25ee56bc7a925e81d67879ae
['1e216902add34ae8b94cf2f469172fed']
I have a rotated white div that contains text that says "FOTOS" using a fontface. Like so: Whenever an animation of any other object that is in the same region as the rotated container div, the font renders like this (for the duration of the animation): Any idea on why this happens? Ideas on how to fix it are also welcome. Thanks!
f9a643524e5674d7647471e09f4d9851159ef40adfdb85ad9e779b8b761bb1b0
['1e216902add34ae8b94cf2f469172fed']
If it was read-only, you could not compile that code. This means it's not read-only but the documentation says to treat it as read-only. Rephrased question: What happens when you try to assign to an assignable property that the documentation says to treat as read-only? Short answer: Does it matter? Long answer: Without the source, it's very hard to tell. You could use ILSpy to debug it but the short answer still applies.
791834999dba1b93f547d966b5029e6105424e467d31a0ab43c382bf094fd6f9
['1e2388956d4148a98153d93d2683f586']
Say I have a tibble of values: raw = tibble( group = c("A", "B", "C", "A", "B", "C"), value = c(10, 20, 30, 40, 50, 60) ) # A tibble: 6 x 2 group value <chr> <dbl> 1 A 10 2 B 20 3 C 30 4 A 40 5 B 50 6 C 60 I want to subtract a certain amount from each value in my tibble depending on which group it belongs to. The amounts I need to subtract are in another tibble: corrections = tibble( group = c("A", "B", "C"), corr = c(0, 1, 2) ) # A tibble: 3 x 2 group corr <chr> <dbl> 1 A 0 2 B 1 3 C 2 What is the most elegant way to achieve this? The following works, but I feel like it is messy - surely there is another way? mutate(raw, corrected = value - as_vector(corrections[corrections["group"] == group, "corr"])) # A tibble: 6 x 3 group value corrected <chr> <dbl> <dbl> 1 A 10 10 2 B 20 19 3 C 30 28 4 A 40 40 5 B 50 49 6 C 60 58
df2aee91a73ecd03c57c22e6f843af6030183158af70b7ea364600cd203b117b
['1e2388956d4148a98153d93d2683f586']
I have three tables: animals: | animal_id | animal_label | |-----------|--------------| | 1 | Elephant | | 2 | Fish | | 3 | Monkey | | 4 | Snake | fruits: | fruid_id | fruit_label | |----------|-------------| | 1 | Apples | | 2 | Oranges | | 3 | Peanuts | | 4 | Bananas | likes: | animal_id | fruit_id | |-----------|----------| | 1 | 1 | | 2 | 2 | | 3 | 3 | | 3 | 4 | | 4 | 1 | Each animal can like multiple fruits and each fruit can be liked by multiple animals, so I have a many-to-many relationship between the animals and fruits. This relationship is described using the third table called likes. I am trying to determine which animals don't like bananas. In order to do so, I wrote this statement: SELECT animal_id, animal_label FROM animals WHERE animal_id NOT IN ( SELECT animal_id FROM likes WHERE fruit_id = 4) That successfully returns the elephant, fish and snake, but not the monkey, because the monkey likes bananas. However, I was wondering if this statement could be rewritten using a join. This is what I tried so far: SELECT animal_id, animal_label FROM animals LEFT OUTER JOIN likes ON animals.animal_id = likes.animal_id WHERE fruit_id <> 4 OR fruit_id IS NULL This time, all four animals are returned. The issue here is that because the monkey also likes peanuts, this statement will return it even though it likes bananas. Is there any way to solve this that would be better than my solution using the subquery?
1c1e498ef59cee840e4da444cfb867c15e92f10232156f7266a29661f2b93368
['1e2888508a8d49768b8dea481873421a']
I have wrote the code as it is written in the developer guide. But I'm not receiving any notification on simulator as well as on android. Double smtng=10; Double smtng1=10; if(smtng1==smtng) { LocalNotification ln = new LocalNotification(); ln.setId("sola"); ln.setAlertBody(".....'); ln.setAlertTitle("local"); Display.getInstance().scheduleLocalNotification(ln, System.currentTimeMillis() + 100000, LocalNotification.REPEAT_NONE); }
6d4f888e4d3c99615453570acedd3dd35fba5ad13499bc572716a230311e99c2
['1e2888508a8d49768b8dea481873421a']
I've using autocompleteTF & picker component to select items. When the user select the item somechanges occur. But if the user exit the app and open it again the selected value were return to its default value. So how to make the app to remember the previous value when opened again?
b4dc2b5e03c393cbd5628d3b7797d30d95c6e63fd0ba6ae861f5d1a0f25ea09e
['1e3928e9021f495f90c3245a88c6fced']
One reason could be because it resembles other things that are dangerous to us. Tarantulas are mostly pretty harmless but we don't eat them possibly because they resemble other highly venomous species like the brown recluse. Eight legs, lots of eyes, etc. Kind of related to what causes batesian mimicry. Milk snakes (non venomous) evolved to look a lot like coral snakes (highly venomous) so they are less likely to get eaten because predators that like eating brightly colored snakes tend to die a percentage of the time.
f5222c8e984e60551802b6f096086b1de61a1a9b2b9fee449f6895ec9ed8b71b
['1e3928e9021f495f90c3245a88c6fced']
The clarinet and the soprano sax are similar in size, but the clarinet is able to play much lower notes than the soprano sax. Why is this the case? I understand that when the clarinet is overblown the pitch goes up by a 12th, not an octave, which extends the range, but I don't understand the physics of how it can play so much lower than the soprano sax. It seems like it could be partly to do with the size of the mouthpiece (soprano sax has a much smaller mouthpiece) or possibly to do with the bore shape, but I'm not really sure whether any of these reasons are right.
7c27fc78c6fea2ff9bb25d71bf192631e1fe31ebc16dd23ed3cdb7a4cf40990c
['1e399331c96b40a0bff1af38212a90b3']
I'm launching a website using Selenium Python! On loading the Chrome browser, ZAP proxy is getting attached to it and capturing URL. I have 2 things to that needs to be clarified here: How to capture URL/requests when user parses through different links? ZAP is capturing it in GUI. Is there any API that gives me the full URL List? How to use Selenium (Python) to capture URL? It captures only current URL and when I go to other link, it doesn't print the new page URL.
2ee582981c53e8567f506d611a47f7e596cf68579efae446322d7c817cb4ceb3
['1e399331c96b40a0bff1af38212a90b3']
I'm new to automation. I wanted to know how we can use selenium webdriver and python together, so that when the webdriver uses Chrome to launch the website, a proxy gets attached to the chrome webdriver to monitor user actions. Proxy can be a ran using 'jar'or an 'exe'. Please suggest!
188954bf1a460274e8b28aa0156a51e567532ee4b35bd873557d48ae784fb935
['1e39e8e7979d48be8154cbcd8275d2a8']
I am under the impression there are certain types of polynomials that root finders have trouble with. In other words, multiple real roots, complex roots very near to each other, etc. I am not interested in polynomials with order greater than 100. I have been working on a new polynomial root finder and want to test it. I have bench marked it against <PERSON>, and do very well against that, but I am not sure that I am testing it with "difficult" polynomials. My current test involves finding the roots of polynomials built with random coefficients, or building a polynomial from random roots (all real, all imaginary, all complex, or a mixture of these). Is there any documentation that defines known problematic polynomials that can test the effectiveness of a root finder? Or can someone give some good testing guidelines for me to use?
9c2841359230b88ca1aea218175f8e34d275b055309ce9983b12fe40d4822537
['1e39e8e7979d48be8154cbcd8275d2a8']
This is the correct fix, because of the tie in between IE and Windows Explorer. What i have found is a neat trick because all of our servers export their windows shares on a common subnet. add this one line to Intranet Setting "File://192.168.0.*" (change for your correct subnet).
414d79e99ddccad4dc5021a9d584662251e324614b9d5df5bf23a63164031f66
['1e3e4db18e144ac390a8b10c8bc99d12']
<PERSON>, I have now installed QEMU as you suggested. It is strange though. The error message states "cant find emulator executable" at path "C:\Program Files (x86)\Android\android-sdk\emulator\qemu\windows-x86_64\qemu-system-x86_64.exe" However, I can copy this right out of the message and navigate to that path and I do in fact see this executable exists in the directory from the error message. I am using Visual Studio 2019, if that makes a difference.
7998ad209e75414afd867ab0cb7939ad772dc5cc8d7fdd7b61437fc86cd02442
['1e3e4db18e144ac390a8b10c8bc99d12']
Device error: emulator: Android emulator version <IP_ADDRESS> (build_id 5395263) (CL:77b96786ddf712e1477c6e05cddb09526043faef) emulator: Found AVD name 'my_device_1' emulator: Found AVD target architecture: x86_64 emulator: argv[0]: 'C:\Program Files (x86)\Android\android-sdk\emulator\emulator.exe'; program directory: 'C:\Program Files (x86)\Android\android-sdk\emulator' emulator: Found directory: C:\Program Files (x86)\Android\android-sdk\system-images\android-28\default\x86_64\ emulator: Probing for C:\Program Files (x86)\Android\android-sdk\system-images\android-28\default\x86_64\kernel-ranchu: file exists emulator: Auto-config: -engine qemu2 (based on configuration) emulator: Found directory: C:\Program Files (x86)\Android\android-sdk\system-images\android-28\default\x86_64\ emulator: emuDirName: 'C:\Program Files (x86)\Android\android-sdk\emulator' emulator: try dir C:\Program Files (x86)\Android\android-sdk\emulator emulator: Trying emulator path 'C:\Program Files (x86)\Android\android-sdk\emulator\qemu\windows-x86_64\qemu-system-x86_64.exe' emulator: try dir C:\Program Files (x86)\Android\android-sdk\emulator emulator: Trying emulator path 'C:\Program Files (x86)\Android\android-sdk\emulator\qemu\windows-x86_64\qemu-system-x86_64.exe' emulator: try dir C:\Program Files (x86)\Android\android-sdk\emulator\ emulator: Trying emulator path 'C:\Program Files (x86)\Android\android-sdk\emulator\qemu\windows-x86_64\qemu-system-x86_64.exe' emulator: ERROR: can't find the emulator executable. I have no idea how to run this, this is my first dabbling with android at all. Does anyone know how to proceed successfully past this? Thank you
37ab88396b014d1410e604ed7ec7583caef3740f1b019b2b02ddac47c3bb2dac
['1e41aaba9b72436ca9a360a660d4a402']
Absolutely. Not just because, to many, the point of science and mathematics is understanding and appreciating the beauty of reality, but also because it might become practical in the future! I doubt the people who worked on number theory foresaw crytography, for instance, or the esoteric probability theory making its way into machine learning now. Also, I think tying together distant theorems is a practical application in some sense. Or at least an educational one for practitioners who might be trying to understand something, and realize something useful based on your theorem tying it to something else. As the other answer says, I think it makes sense as long as you make it coherent with the rest of the paper!
d3413c605801bf3de80b7772cfa19f27486224f958a6a1e96efdbb2cc550a04e
['1e41aaba9b72436ca9a360a660d4a402']
You should start looking for another job. Let's consider the three possible cases: Your new CEO is right and you are being overpaid. In this case, looking for a new job will convince you of this before you burn a bridge. Your new CEO is wrong and you are being underpaid, and will change his mind when presented with new evidence. Since you are underpaid, it should be easy to find someone who will compensate you properly; with another offer in hand, he will pay you more. Your new CEO is wrong and you are being underpaid, and will not change his mind when presented with new evidence. Since you are underpaid, it should be easy to find someone who will compensate you properly; you can then accept this job and all is well. In this case, your current company is about to have problems, and it will be good that you are out. In all three cases, starting a job search is the first step. Good luck!
26dcaae57419cbb9863b9e469aca592fdedb6638c4cb2bc960f2e7cd57b95f32
['1e853bb51fd141cf9978990dbfedd69e']
I had a question where tried to get the session variable that defined in another page. But get error that the session had been started. when remove the session_start(), it say undefined variable. Tried to search for other relevant post but seems no clear solution given.. pls advise.. thanks.. session_start(); $CustID = $_SESSION['UserID'];
174d9979ced98e02c56d58ecbd242b877ec527106970ae467e9300dda85d776a
['1e853bb51fd141cf9978990dbfedd69e']
I have following insert statement, it work fine if the PName doesn't have (') value, but when the text contain of ('), the query will return with syntax error. Any idea how to fix this? many thanks. $queryinsert = "INSERT INTO CART (CartPID, CartPName, CartPrice,CartCustID, CartDate) values ( $pid, '$PName', $PPrice, $CustID, (NOW()))";
c6ae9fc81e568986f675d74098679dc4a758e469b96125da1c560217f5b66319
['1ea07f7d0883458bac7951b173b05033']
I'm creating a website for a friend on Wordpress with DIVI and WooCommerce. My shop page worked until i loged in WooCommerce. Now my page is the good one ine the builder but seems to be CSSless in real. The following screen will explain quite much (top : in Divi Builder, what i want finally / bottom : what appears on the website). Thanks.
d61f0b5ee6ba1c95fe94388d4efb3825b42a707ecf0bb15e942a5ff59119cc80
['1ea07f7d0883458bac7951b173b05033']
i'm learning Vue.JS since some days, i'm just tryna doing an app that add a chip on click on a button. The created chips should get the value on of an input as name. I have created a method that (normally), should create this chip. It's not even calling the method and i don't know why, i've tried to console.log something at the beginning of the methods to check it... Thanks all ! My App.vue : <template> <v-app id="whole_container"> <v-content id="main_container"> <v-row id="main_row"> <v-col class="hellocol" id="chips"> <customChip name="Louis"></customChip> </v-col> <v-col class="hellocol" id="chipField"> <addChip></addChip> </v-col> </v-row> </v-content> </v-app> </template> <script> import customChip from './components/chip.vue'; import addChip from './components/addChip.vue'; export default { name: 'App', components: { customChip, addChip }, data: () => ({ // }), }; </script> My AddChip file : <template> <div> <v-text-field id="newChip" :outlined="true" label="Entrez un nom" placeholder="Michel" v-model="currentName"></v-text-field> <p><PERSON> {{ currentName }}</p> <chipButton @click="addChip( currentName )"></chipButton> </div> </template> <script> import chipButton from './button.vue'; export default { data: () => ({ currentName: "" }), components: { chipButton, }, methods: { addChip: function(name) { console.log(name); let actualChips = document.getElementById('chips'); let newChip = document.createElement('customChip'); newChip.name = name; actualChips.appendChild('newChip'); } } } </script>
dda02a3a7e8d55064a84a883ae115bf12f4f2718c5de8b878bd2f990a3f80095
['1ea9ffeaf8254176a68835c52d93eb79']
I'm looking for a regex or a mask that allows me validate an angular material input using both formats (00000-0000 or 00000). My code allows me to put only a zip code like this 12345-6789 but not this one 12345. I'm using ngx-mask. and working with Angular 7. <mat-form-field> <input matInput name="zipCode" placeholder="Zip Code" [(ngModel)]="site.zipcode" mask= '00000-0000'> </mat-form-field>
f522470b4af69cda921c480cdc71adc77439e8b1ea955e2d77c81dbf68674483
['1ea9ffeaf8254176a68835c52d93eb79']
Some people said that you have to change your Startup.cs class, but I din't do nothing of that, just changed a little my Program.cs class ----------Old file-------------- public class Program { public static void Main(string[] args) { var host = CreateWebHostBuilder(args).Build(); using (var scope = host.Services.CreateScope()) { var services = scope.ServiceProvider; try { var context = services.GetRequiredService<MvcMovieContext>(); context.Database.Migrate(); SeedData.Initialize(services); } catch (Exception ex) { var logger = services.GetRequiredService<ILogger<Program>>(); logger.LogError(ex, "An error occurred seeding the DB."); } } host.Run(); } public static IWebHostBuilder CreateWebHostBuilder(string[] args) => WebHost.CreateDefaultBuilder(args) .UseStartup<Startup>(); } ----------New File--------- public static void Main(string[] args) { var host = BuildWebHost(args); using (var scope = host.Services.CreateScope()) { var services = scope.ServiceProvider; try { var dbContext = scope.ServiceProvider.GetService<MvcMovieContext>(); //SeeData is a class in my Models folder SeedData.Initialize(services); } catch (Exception ex) { var logger = services.GetRequiredService<ILogger<Program>>(); logger.LogError(ex, "An error occurred seeding the DB."); } } host.Run(); } public static IWebHost BuildWebHost(string[] args) => WebHost.CreateDefaultBuilder(args) .UseStartup<Startup>() .Build(); }
90977801dbf15e4b28a502397cce9deaecdd867f45a26db0ec6c5bb6c6103a04
['1ec83c35a9044bc0978b4d1c4b4b4f28']
All I need is to log HTTP requests/responds to db and log some other stuff to file. I try to log message into file and insert data into db during the execution of OnApplicationEndRequest(object sender, EventArgs e) method of my custom HTTP module (BasicAuthHTTPModule.cs) in my ASP.NET Web API application. My custom HTTP module follows this structure (with modification in OnApplicationEndRequest(object sender, EventArgs e) ) => https://learn.microsoft.com/en-us/aspnet/web-api/overview/security/basic-authentication#basic-authentication-with-custom-membership. I have investigated 2 cases where the application behave differently and I don't know why... case 1) When I run this project from Visual Studio, database insertion is performed fine, but file insertion isn't performed at all = nothing happens... Btw I am able to log into file from Controller, but no from HTTP Module. So it is not possible to log into file from HTTP Module class? case 2) When I host my ASP.NET WEB API on remote server and I consume the API from my local PC's console application, database insertion is not performed, neither file insertion. So nothing at all is performed in this case. It looks like that my custom HTTP module is not being hit in this case... Here are my code snippets: BasicAuthHttpModule.OnApplicationEndRequest(object sender, EventArgs e) tasks: insert log into db insert log into file switch (response.StatusCode) { case 200: if (endPoint == "/api/cards") { DatabaseEngine.sInsertIntoWebApiLogTable(); // inserts into db + saves changes WebApiConfig.myLogger.Information("success"); } break; . . . } DatabaseEngine.sInsertIntoWebAPILogTable() /// <summary> /// Adds new record to C___WEBAPI_LOG and Saves Changes /// </summary> public static void sInsertIntoWebAPILogTable() { C___WEBAPI_LOG newWebAPILog = new C___WEBAPI_LOG() { CLIENT_IP = "test1", REQUEST_ENDPOINT = "test2", REQUEST_HTTP_HEADER = "test3", REQUEST_TIMESTAMP = "test4", RESPONSE_HTTP_HEADER = "test5", RESPONSE_BODY = "test6", RESPONSE_TIMESTAMP = "test7", RESPONSE_STATUS_CODE = "test8" }; m_cnDbEngine.C___WEBAPI_LOG.Add(newWebAPILog); m_cnDbEngine.SaveChanges(); } WebApiConfig.cs public static class WebApiConfig { public static Serilog.Core.Logger myLogger; public static void Register(HttpConfiguration config) { // Web API configuration and services // Web API routes config.MapHttpAttributeRoutes(); config.Routes.MapHttpRoute( name: "DefaultApi", routeTemplate: "api/{controller}/{id}", defaults: new { id = RouteParameter.Optional } ); config.MessageHandlers.Add(new ThrottlingHandler() { Policy = ThrottlePolicy.FromStore(new PolicyConfigurationProvider()), Repository = new CacheRepository(), //Logger = new Modules.TracingThrottleLogger(traceWriter) }); myLogger = new LoggerConfiguration() .MinimumLevel.Debug() .WriteTo.RollingFile("logs\\HelloWebApi_auth-{Date}.txt") .CreateLogger(); } }
b65ac7d956e94b0557f906270d8eb7cdbf3db7b2b961ce8c6a06de169c6fa301
['1ec83c35a9044bc0978b4d1c4b4b4f28']
I am trying to loop over SQL Query result with do-while loop, but there are problems with indexing of the result variable. The problem is on the line with while (selectQuery.ElementAt(i).Source != user.Item1 && selectQuery.ElementAt(i).UserID != user.Item2 && i<selectQuery.Count()); So my question is: How can I index the sql query result variable? Here's my code: //------------------Database connection initialization-------------------------- string m_dbConnestionString = "Server=aaa; Database=bbb; uid=ccc; pwd=ddd; Trusted_Connection=True;" DataClasses1DataContext db = new DataClasses1DataContext(m_dbConnectionString); Table<Central> m_myTable = db.GetTable<Central>() // ----------------------------------------------------------------------------- int i = -1; var selectQuery = from central in m_myTable select central; foreach (var row in selectQuery) { Console.WriteLine("{0}; {1}",row.DisplayName, row.Email); } foreach (var user in allMailusers) // btw, allMailUsers is List<Tuple<string, string, string, string, string>> { do { i += 1; } while (selectQuery.ElementAt(i).Source != user.Item1 && selectQuery.ElementAt(i).UserID != user.Item2 && i<selectQuery.Count()); if (selectQuery.ElementAt(i).Source != user.Item1 && selectQuery.ElementAt(i).UserID != user.Item2) // if true, insert into DB { // create new instance of Central Central c1 = new test1.Central(); // fill up c1 with values c1.UserID = selectQuery.ElementAt(i).UserID; c1.Source = selectQuery.ElementAt(i).Source; c1.DisplayName = selectQuery.ElementAt(i).DisplayName; c1.Email = selectQuery.ElementAt(i).Email; c1.Phone = selectQuery.ElementAt(i).Phone; // insert into db m_myDb.Centrals.InsertOnSubmit(c1); m_myDb.SubmitChanges(); } // end if i = -1; } // end of foreach
498692908b77e86eacac4f7af92daa11a90d5316710c4e133d6a9e1338093381
['1ed98111684a4b8390b80ccc5f5c542d']
I often create chart reports on rstudio, knit it with rmarkdown and upload it to a private hosting account so I can share the document to be viewedas a webpage on a browser . However those reports are static, therefore the viewer cannot, for example, select a time period he or she wishes to apply to the chart. I wonder what would be the best solution, to add an interactive time selector to this rmarkdown document and make it work online. I would really appreciate any advise for a quick and simple solution to this cenario. Thanks
60e340229d2a94d1933859ef682a8ba59fba643749d5927b76ecc76228524dbd
['1ed98111684a4b8390b80ccc5f5c542d']
I am trying to get only the columns with datetime format. Using select_if for numeric is working but I can't find a function for datetime: result set with only numeric columns orders %>% select_if(is.numeric) %>% View() result set with only dttm columns ? orders %>% select_if(is.datetime) %>% View() Thanks in advance
53c2fdf52cbe66c7a7956dd9c11f4576a58c9ad8ff0bc08d7c081e3659361d34
['1ee7ce9540cc4f03a1cb93ad278d11d0']
How do I shot that the proportionality holds? I see that when mutiplying $\begin{pmatrix}0 & 1 \\ -1 & 0 \end{pmatrix}$ and the metric tensor that i get to the matrix I am supposed to show proportionality with. But being antisymmetric doesnt imply that is has to have that exact form, does it?
d0ed68bcd4f720493b0148fc1365053f39388cd6ed4b9efc40b4f3faca6f1c58
['1ee7ce9540cc4f03a1cb93ad278d11d0']
Из-за чего могут быть проблемы с функцией gets() ? Тестирующая система выдает такую ошибку: Content-type: text/xml 45a5b2ff-e647-482e-b475-39768bf61a7e 003839.cpp: In function 'int main()': 003839.cpp:17:16: error: 'gets' was not declared in this scope while (gets(s)) ^ Так выглядит часть моего кода, где используется gets() int main() { const char* sep = ".!?:-,;() \t\n"; ifstream file; file.open("input.in"); file.open("output.out"); while (gets(s)) { if (!s[0]) break; // }
80dd0195df2d71470de30cc5062e4f041c7558c29609f0e0dadd0867276a3e23
['1f04eb41b3264d69b81ebdd8a8f5826f']
@joshwaxman The link in your comment has become broken over time. I suppose it's worth updating: https://orot.ac.il/%D7%A2%D7%99%D7%95%D7%A0%D7%99%D7%9D-%D7%91%D7%A1%D7%99%D7%93%D7%95%D7%A8-%D7%94%D7%AA%D7%A4%D7%99%D7%9C%D7%94-%D7%90%D7%9C%D7%95-%D7%93%D7%91%D7%A8%D7%99%D7%9D-%D7%A9%D7%90%D7%99%D7%9F-%D7%9C%D7%94%D7%9D-%D7%A9%D7%99%D7%A2%D7%95%D7%A8
4a6c6041dae078fad50eaa443468486b17a8179f055a91b97c206e20092e5a74
['1f04eb41b3264d69b81ebdd8a8f5826f']
Regarding Tefilah, Berakhot 12a tells you that you should straighten up as you mention the Divine Name. I assume that it should be similar for those who are bowing for <PERSON>, but it's a minhag. See this for sources: https://judaism.stackexchange.com/questions/59010/exactly-how-should-the-shaliach-bow-for-barachu
ebc0391ed958ce6a9caa416c39904c0ff7811b580ca791ab20e6046399a41dfc
['1f109b38d58c4ab7825a14a5658b40a8']
I realize this is several months later but in case you still haven't figured out a work around or if someone else is in need here is what I was able to do to get it working adequately until it is fixed in iOS. We had the same type of issue you describe, iOS 9 had no issues but iOS 10 would place a random length of the barcode into the field and split the remaining part to another field. Note the below is tested on iPad 4 iOS 10.3.2 and your results may vary. This hasn't been tested thoroughly, only about 100 barcodes or so and mostly with the Koamtec since that is what was causing us the most trouble. The scanners we use (Koamtac KDC400 and Symbol LS/LI-4278) both have a setting to slow down the transmission of the bar code data. When I set them to longer delays the barcodes come through fine. For the KDC you are looking for "HID Character Delay = 50msec" (I find 100 is a good one too but it is very slow) For Symbol LS/LI you want "HID Keyboard Keystroke Delay" / "Long Delay (40 msec). For other brands/models there is a good chance the manual will have a similar code. In your linked post you mention Opticon Scanners, I don't have any of those but taking a very quick glance at the manual it might be called "Intercharacter delay" for that brand. If this works for you or if you came up with a different workaround I would love to hear it.
ba6cf64accb751258c5a3ae746aa01f33a51cbd4c3de796209856c50c819427e
['1f109b38d58c4ab7825a14a5658b40a8']
I am trying to design a database that is similar to an encyclopedia/dictionary where there is a "See also" option. I can do simple databases with multiple tables but I'm far from an expert. So I made some sample data to try and figure it out but now I am stuck. I am shooting for doing it in php/mysql so I can have web pages as the output but what I need help with is the db design and the sql to make the "see also" bit work right. I am thinking I need another table that somehow connects all of them but I’m not sure how to do that. Example Table Fields: Table 1: Place PlaceID PK PlaceName PlaceCityName PlaceStateName PlaceSeeAlso Table 2: Person PersonID PK PersonName PersonJob PersonSeeAlso Table 3: Thing ThingID PK ThingName ThingSeeAlso Example data: Places Table 00 PlaceA Philadelphia PA PersonA, PersonB, ThingA, PlaceC 01 PlaceB Philadelphia PA PersonA, ThingB, PlaceA, PlaceC 02 PlaceC Philadelphia PA PersonA, ThingB, ThingC, PlaceA Person Table 00 PersonA Worker ThingB, PlaceA, PlaceC 01 PersonB Worker PersonA, PersonC, ThingB, PlaceA, PlaceC 02 PersonC Boss PersonB, ThingB, ThingC, PlaceA, PlaceB Things Table 00 ThingA PersonA, PlaceC 01 ThingB PersonB, PlaceB, ThingC 02 ThingC PersonA, PersonC, PersonE, PlaceC, ThingA So for example say you did a search for a person, place or thing, let’s say "PersonC", the output on a webpage/window in my program/whatever would be: Name: PersonC City: Philadelphia State: PA Description: Boss See Also: PersonA, ThingB, ThingC, PlaceA All of the things under "See Also" should be clickable to bring up the matching record. So in the above example you click "ThingC" you would get Name: ThingC See Also: PersonA, PersonC, PersonE, PlaceC, ThingA All of the things under "See Also" should be clickable etc etc etc. Just a reminder I am in need of help with how to structure the DB and maybe some of the sql as far as the See Also part is concerned, not the making things clickable on a webpage etc.
5ee2baef7f35737e3d63f5ee0a76c8df700d5bbd0f8153beec8685d8e88ae0d7
['1f2957e25f7642acb903ab6ee6d218b5']
That's not the correct way to declare environment variables. You should declare an environment variable like: MAIL_HOST .env file should be different for each environment. In dev .env file MAIL_HOST should contain the development URL and in production .env file MAIL_HOST should contain the production URL You can choose the env file by using dotenv library by using require('dotenv').config();
2d20621fd4c3aacedc1a215f78a16b72d03dfa0c2730d69220ece742b8485824
['1f2957e25f7642acb903ab6ee6d218b5']
You are redirecting it to /adminpanel/1 without waiting the response from the findById (async) function. This should work: router.post('/chngpwd', function(req, res, next) { var {currentpassword, newpassword, confirmnewpassword} = req.body; var uid = req.session.passport.user; if (newpassword == confirmnewpassword) { User.findById(uid).then(dbres => { req.flash('error_msg',"THIS MESSAGE DON'T WORK"); res.redirect('/adminpanel/1'); }); }else { req.flash('error_msg',"New passwords don't match"); res.redirect('/adminpanel/1'); } });
53b3a6c610e1d17e8ee4cbe1a8201b6cd3f54544b31e69d1f075b80dd41620d1
['1f307f2da6c14562ae2a82b23dd50ab1']
Works for me perfectly fine when i only let the animation done when it's needed at scrolling by if(slid){ .... } and invoking .stop() before animations. (Otherwise multiple of those animations will be done since scroll event is triggered multiple times. Those animations end up in the queue of animations. By just invoking animate you put your animation in this queue (and it will be done only AFTER all the other animations are done). By calling stop() you can empty this queue and thus immediately let your animation be done ) Look at http://jsfiddle.net/371fqnbo/2/ However your code contains some redundancies which could be eliminated.
fb69ce2b17be7db2726af68e3f35925e55fd325d206348378e7a730c57894a27
['1f307f2da6c14562ae2a82b23dd50ab1']
how about: <body> <div id="tweets"> <?php $tweets = $twitter -> get('https://api.twitter.com/1.1/statuses/user_timeline.json?screen_name=MiDizajn&count=100'); $first = true; foreach($tweets as $tweet){ print_r('<span'.($first?'':'style="display: none"').'>'.$tweet -> text.'</span><br /><br />'); if($first){ $first = false; } } ?> </div> <button id="prev">prev</button> <button id="next">next</button> </body> and jQuery: $(document).ready(function(){ $("#prev").click(function(){ if( $("#tweets>span:visible").prev().size() > 0){ $("#tweets>span:visible").hide().prev().show(); } }); $("#next").click(function(){ if( $("#tweets>span:visible").next().size() > 0){ $("#tweets>span:visible").hide().next().show(); } }); }); I didn't test the php part and usually dont use php, but i think this should work. Of course you could use fadeOut and fadeIn instead of hide and show or do some advanced fading-effects.
9939bd1e02e0af35f12660662b334b1056ef2ba7aceacd9606b1d2baf94c2e81
['1f40a1aae809487fab8d2418d5dc6786']
The answer from iforce2d might be obsolete. I got the following code working properly with box2d v2.2.1, cocos2D v2.0.0 using Xcode v4.5.2 (here I assume I have a pointer to a b2Body named 'body' with only one fixture, i.e., I don't iterate over all fixtures on the body): b2Fixture *fix = body->GetFixtureList(); b2Filter filter = fix->GetFilterData(); filter.groupIndex = -1*kPlayerGroupIndex; fix->SetFilterData(filter); In the above code I prevent 'body' from colliding with my player body which also has the same groupIndex value, i.e., -1*kPlayerGroupIndex, where kPlayerGroupIndex is a positive integer constant. Any bodies with this negative groupIndex never collide with one another. You could also update the categoryBits or maskBits accordingly to prevent collisions. GetFilterData(&filter) and SetFilterData(&filter) returned errors for me given the version numbers I quoted above.
d8a70dc8161a214d0822aec8d1146fe6a5c7464d2139dc5657f886eb2ddee96a
['1f40a1aae809487fab8d2418d5dc6786']
I had the same issue using the Box2D v2.2.1 C++ code. I'm using a b2PrismaticJoint between a static body and a moving (dynamic) body to simulate a "lift" (or elevator). When the lift reaches the upper end of translation along the prismatic joint, it appears to stop. However, when another body is sitting on top of the lift and it reaches the upper end of translation, the body on top the lift begins to "bounce" around as if the lift is still applying a force. (I believe this is exactly what is happening, i.e., the lift's body doesn't translate any further along the prismatic joint, but the prismatic joint's motor is still cranking away and applying upward forces to the body). I initially resolved this issue by manually setting the prismatic joint's motor speed to 0.0 when the upper end of translation was reached. In my main game loop, i.e., the function that gets called at the frame rate ("tick:" in Box2D or "update:" in Cocos2D), I inserted the following (I'm using Objective-C here and kLiftJointValue is an arbitrary integer constant): // Iterate over all joints (used to prevent upper end oscillations from psimaticJoints on lifts) for (b2Joint* j = world->GetJointList(); j; j = j->GetNext()) { if ((int)(j->GetUserData()) == kLiftJointValue) // check to see if lift is at upper end of translation { CGFloat currentTranslation = ((b2PrismaticJoint*)j)->GetJointTranslation(); CGFloat lowerLimit = ((b2PrismaticJoint*)j)->GetLowerLimit(); CGFloat upperLimit = ((b2PrismaticJoint*)j)->GetUpperLimit(); b2Body *bodyA = j->GetBodyA(); b2Body *bodyB = j->GetBodyB(); BOOL notStopped = (bodyA->GetType() == b2_dynamicBody || bodyB->GetType() == b2_dynamicBody); if (fabsf(currentTranslation - lowerLimit) <= 0.01*(upperLimit - lowerLimit) && notStopped ) { CCLOG(@"Stopping platform"); (j->GetBodyA())->SetType(b2_staticBody); (j->GetBodyB())->SetType(b2_staticBody); ((b2PrismaticJoint*)j)->SetMotorSpeed(0.0); } } } The above code simply iterates over all joints in the world and looks for those tagged appropriately, and if the body has translated to within 1% of the maximum translation allowed then the moving body is changed to static and the motor is disabled by setting the motor speed to 0. You could also use Box2D collision detection and set the joint's motor speed to 0 that way... I then realized that the best way to implement this lift (without disturbing anything sitting on top of the lift) was to slowly decelerate the prismatic joint's motor speed gradually. This is how I did it: // Iterate over all joints (used to prevent upper end oscillations from psimaticJoints on lifts) for (b2Joint* j = world->GetJointList(); j; j = j->GetNext()) { if ((int)(j->GetUserData()) == kLiftJointValue) // check to see if lift is at upper end of translation { CGFloat currentTranslation = ((b2PrismaticJoint*)j)->GetJointTranslation(); CGFloat lowerLimit = ((b2PrismaticJoint*)j)->GetLowerLimit(); CGFloat upperLimit = ((b2PrismaticJoint*)j)->GetUpperLimit(); b2Body *bodyA = j->GetBodyA(); b2Body *bodyB = j->GetBodyB(); BOOL notStopped = (bodyA->GetType() == b2_dynamicBody || bodyB->GetType() == b2_dynamicBody); if (fabsf(currentTranslation - lowerLimit) <= 0.25*(upperLimit - lowerLimit) && notStopped) { // Get current motor speed and update CGFloat currentSpeed = ((b2PrismaticJoint*)j)->GetMotorSpeed(); CGFloat newSpeed; if (currentSpeed < 0.0) { if (fabsf(currentTranslation - lowerLimit) <= 0.01*(upperLimit - lowerLimit) && notStopped ) { CCLOG(@"Stopping platform"); (j->GetBodyA())->SetType(b2_staticBody); (j->GetBodyB())->SetType(b2_staticBody); ((b2PrismaticJoint*)j)->SetMotorSpeed(0.0); } else { CCLOG(@"Decelerating: speed=%f", currentSpeed); newSpeed = 0.95*currentSpeed; } } else if (currentSpeed > 0.0) { CCLOG(@"Accelerating: speed=%f", currentSpeed); newSpeed = 1.05*currentSpeed; if (newSpeed > 20.0) newSpeed = 20.0; } // update motor speed ((b2PrismaticJoint*)j)->SetMotorSpeed(newSpeed); } } } You'll need to play with the various constants (especially the constants 0.95 and 1.05) since they are fine-tuned for specific motor properties (maxMotorForce = 1000 and motorSpeed = 20 in my case). Of course elsewhere in my project I have timers running which reset the lift body and joint motor properties as needed (to make it travel up, then back down by reversing the joint's motor speed with a positive value). I didn't implement the acceleration/deceleration technique when the lift was translated near the other (bottom) limit since I didn't care about stuff riding the lift being imparted forces in this direction when the lift stopped. However, the same approach as outlined above can be used to smoothly accelerate or decelerate as the lift leaves from or returns to the bottom...
e7b5c143a2fdfc02bbad05540cc8959efaf8b8072c09c51614ad115c33cedbc4
['1f48289910b2451795d9847cb571936b']
Well, for certain the CPU architecture needs to be a match. Applying an x64 install image won't get you a USB disk that boots on x86 or ARM. Beyond that, it's probably more portable than (for example) SATA, because the USB controller software interface is highly standardized and only a handful of drivers need to be present (OHCI, EHCI, UHCI, xHCI) plus USB mass storage profile, no worries about BIOS setting for RAID mode that doesn't speak AHCI and needs proprietary drivers. I heard that getting such an install to stay activated if you move it around can be an issue.
bd5fbcf27446c07bb0d6b8165097ac75368fee38ad10d434e326e328020618e1
['1f48289910b2451795d9847cb571936b']
`apt-get` refuses to remove anything, because the last kernel it tried to install didn't fit on `/boot`, leaving unmet dependencies. Those dependencies can't be installed due to lack of space, and *really* old kernels can't be installed, because of unmet dependencies in the global package list. :(