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
c71bf202366b4219027134f26b6ab2b6163fe4220c253430e0a605f9684ff7a8
['1638d2eafe71429180917cc23fc7b89e']
Try Irfanview. It's free for personal use. If it is running Press C or use menu bar -> options -> Capture/Screenshot... for screenshots. There are many different ways to choose captured area like full desktop, foreground window or fixed screen. You choose custom hotkey or timed screenshots. You can use a dedicated folder or your last used printer. If you are an advanced user, you can use its command line options to write a script. There are many different applications for Linux like GIMP or built-in in every Linux desktop environment. Just press printscreen for a screenshot.
6437c77f729b700d6493c9e6dad113f9f2b64de114099886c7e8ccf9520dc37f
['1638d2eafe71429180917cc23fc7b89e']
Yes; my cluster uses btrfs on the partitions I've configured for HDFS. The one thing I would caution you about is the use of brtfs' transparent compression feature, which is enabled via mount option. The Hadoop HDFS daemons are aware of the size of the volumes and the freeused for HDFS on a node and the free space thereon, and if you enable compression those size values become "unreal," i.e., an assertion of "50% full" of "500MiB" when the volume is mounted compressed neither means that it can hold only 500MiB nor that it's half full (with compression enabled on a btrfs volume, you can write a file of all zeros that is insanely larger than the volume's actual size). Because of that unreliability and because of the extra CPU overhead that would go into compression and decompression, I would avoid the temptation even though for a lot of data typically going into HDFS the effective compression ratios might be quite favorable. Another reason to avoid compressing HDFS volumes is that as the daemons rearrange blocks what with your replication setting and all, the machines will be uncompressing blocks on read on one node only to write them back out compressed on another node. Having said this, one potential feature the Hadoop team may want to consider implementing would be to handle compression at the HDFS level; under that regime blocks would only be compressed or uncompressed when written or read by code, to include the hdfs utility. I'm just not sure it would be worth the CPU overhead, though.
6f75b9d6d7c96f073b085d17a982c0930573e4624a55d976c6d5887565a5bde3
['163c79dac5df468fab87a13bec1fa58a']
You could add/remove the items to their respective dropdown menu based upon the changing values from the other selection. To be more clear, when the first selection is changed, read the value of the selected option then use that value to remove/disable that item from the second dropdown-menu. You would also need to be making sure that you're displaying the other 2 options (If you're removing them from the dropdown)
d5e577e57537c25e77277fc8e8a45c91834d8ba902d4ba48d982ba3512999f3d
['163c79dac5df468fab87a13bec1fa58a']
So i'm having the trouble that if I have a "long" webpage (where you make your window as big as you can but still need to scroll) the image doesn't "behave" correctly. I thought that setting the background-size property to cover would do this but is the image isn't big enough (Which would have to be pretty big) I just get white space once I scroll down the page a little bit. Is there a property that would, say, set the height of the background to 100% then properly scale the image so it has the correct width proportional to the original height? My solution as of now is having a background color that the image "eases" into, just to make it look smooth.
53f0af4601129f3be6d0b76faae112201102d5782205028886801d2bbe270caf
['16483ca154814ce0ae5d70cbf0788879']
You could also try use "CDT GCC Built-in Compiler Settings". Go to the project properties > C/C++ General > Preprocessor Include Path > Providers tab then check "CDT GCC Built-in Compiler Settings" if it is not. None of the other solutions (play with include path, etc) worked for me for the type 'string', but this one fixed it.
d583dadabc49cc8d4936939f62b86942b55a53fb37d6eea3e48ccdb16cec966a
['16483ca154814ce0ae5d70cbf0788879']
I'm trying to figure out a way of having an app-contextual style function for a Draw interaction (OpenLayers 4). I have a Draw Interaction constructed with a custom style function (a prototype method of one of my objects), but the problem is that the function will be called with this as Window, so I can't access to my app context. As I'm not responsible for that call (called by OpenLayers), I can't specify the this I want. Is there a detail I didn't see in the OpenLayer API, or in javascript (I'm not an expert) that could solve my issue ? Here is my code : function MyClass(){ (...) // This state should impact the draw interaction style this.myState = someValue; // My interaction this.addInteraction = new ol.interaction.Draw({ (...) style: this.styleFunction }); } // My style function which need to access this.myState MyClass.prototype.styleFunction = function( feature, resolution ) { // The following this is Window instead of MyClass.this if( this.myState ) return style1; else return style2; } Adding MyClass.this as a Window property is not a solution as I may have multiple instances of MyClass. Thanks for any suggestions
c3726869209bef8e37c45a755fa1f912d4f2671bce0d877d16189c5471e8b419
['164891fd93924bada4a5c9d5c395280c']
After each update to the TextView call while gtk.events_pending(): gtk.main_iteration() You can do your update through a custom function: def my_insert(self, widget, report, text): report.insert_at_cursor(text) while gtk.events_pending(): gtk.main_iteration() From the PyGTK FAQ: How can I force updates to the application windows during a long callback or other internal operation?
d87953f38c05c35dc5fdd1f0c4e823311677ad74f867eda7ccb294c293b6a889
['164891fd93924bada4a5c9d5c395280c']
I recently started the Matasano Crypto Challenges (aka Cryptopals), which proposes essentially the same principle in this exercise. Specifically, if you want to break a repeating-key xor cipher, try to find the value of n that minimizes the Hamming distance between any two n-length blocks of cipher text, and n will generally correspond to the size of the cipher key. While this strategy worked in that particular case, it wasn't obvious to me why it should work. I've reasoned through it from first principles and come to a few conclusions. Note: I am by no means an expert in cryptography, and it's entirely possible that this argument is specious, or I'm using incorrect terminology. At a high level... I believe this essentially works in this case because you are encoding an English cipher text using 8-bit bytes, and the entropy of the English language is much lower than the entropy of all possible combinations of 8 bits. i.e. English only has 26 letters, but there are 256 possible combinations of 8 bits. Entropy seems to be preserved via repeating-key xor, and so you are essentially looking for the block size that minimizes it. This implies that if you found some way implement a repeating-key xor that transformed alphanumeric plain text into alphanumeric cipher text, this method wouldn't work. More specifically... I reason that the Hamming distance is a metric that survives transformation of the underlying text by repeating-key xor, given that it is applied to blocks of text that match the length of the cipher key. This is fairly easy to show for small block and key sizes. For instance, assume the plain text is 001010, the key is 010, and the cipher is therefore 011000. The Hamming distance between the two halves of the plain text is 2, and the Hamming distance between the two halves of the cipher text is also 2. I'm fairly certain that this scales to any text and key length, again assuming that you are taking the distance between blocks of the same size as the key. Now consider what I said above, that the entropy of the English language is fairly low compared to the entropy of the entire possible byte space. This implies that the Hamming distance between two blocks of English text will in general be less than the Hamming distance between two blocks of random bytes. Combine these principles, and it becomes clear that at least in theory, if you pick the correct block size / key size, the Hamming distance will be minimized for the cipher text (because it was already minimized for the plain text and survives the xor transformation). If you don't pick the correct key size, then you are taking the Hamming distance of essentially random bytes, which will in general be much higher.
97cbd119a7e130dc136afa62e8c590c47e780da3802a02321b74d4d692a94d26
['164b06d57290408290712860a9d9b758']
very short answer. subroutines!! Subroutines execute in the context of the calling routine. Two virtues: no parameter passing, easy to create. In some languages, subroutines are private to (and are part of) the calling (invoking) routine (see various dialects of BASIC). direct answer: Section and Paragraph support a different way of thinking about programming. Higher performance than call subprogram. Supports overlays. The "fall thru" aspect can be quite useful, a feature rather than a vice. They may be necessary depending on what you are doing with a specific COBOL compiler. See also PL/1, BAL/360, architecture 360/370/...
6cdc9720efe18b378a4bbdc10052a99d6b61c09b56664fd826a16bf6d2fa0ef3
['164b06d57290408290712860a9d9b758']
You had rather good luck with your c sample. In c we expect that the storage for "message" is out of scope after return : but the pointer returned points to where the value of "message" used to be. To correct the c, declare and define a local variable with enough space to take the longest message IN THE CALLING FUNCTION. Pass a pointer to that space to the function, rather than returning a dangling pointer. As a side note: in production code, your c code might work for years then unexpectedly show intermittent failures. Please review the scope rules in both c and c#.
1474552d3c8712fa0ee231ddaceb0646d8016abef1b8e30244b0b7356a5dbe41
['164b3f1d2fa7460aa37bfc6b08ef9f2b']
cv<IP_ADDRESS>Mat<IP_ADDRESS>data uses uchar in order avoid being a template class. In order to fill it with other image data you'll need to cast the data pointer. In your case try something like this: Mat img1(height, width, CV_16UC4); ushort * data = reinterpret_cast< ushort* >( img1.data ); for (i = 0; i < iwidth*height; i++) { ... } Alternatively, instead of changing the data pointer img1.data directly in your for-loop, you could consider using the templated pixel access function cv<IP_ADDRESS>Mat<IP_ADDRESS>at<T>() img1.at<Vec4w>(y,x) = reinterpret_cast<Vec4w>(Processor.imgdata.image[i]) use the specialized class Mat4w img(height, width) and then operator(y,x) img1(y,x) = reinterpret_cast<Vec4w>(Processor.imgdata.image[i])
fbf80dda5a5cb53a7808c3a71bc217930a0633b8e7c11ec81d1a7aa5caed29e2
['164b3f1d2fa7460aa37bfc6b08ef9f2b']
You could use cv<IP_ADDRESS>Subdiv2D for triangulation. Here is a link to C++ and Python examples. But I think this implementation cannot handle holes, if I remember correctly. I would also suggest that you check out the C-library Triangle. It allows you to specify holes besides many other useful things. Apparently, several wrappers for Python exist for it (but I have never used them).
e2950bdb03f511b3c766c7505c71f65b18bd354db021551d80ff46c2037dd853
['164ce3677e7048799c1a83f0dbb138d1']
Is it possible to make a release from custom branch (not develop)? I tried to use startCommit command, but Maven JGitFlow plugin has been switched to the develop branch before release is started. Also, when I changed git configuration manually, it was automatically changed to develop. I would like to use following steps: release-start - create release branch release-finish - create tag, merge to the master and develop, update pom.xml versions. Issue found Create a branch from tagged version Fix issues there Make another release from that branch
311a47416deb5c1e1f4caef411ca9dfceece0e2b77dee8933cbd582d3379c434
['164ce3677e7048799c1a83f0dbb138d1']
Working example (@EnableBatchProcessing is removed, JobBuilderFactory and StepBuilderFactory are created in Java configuration): @Configuration @ImportResource( value = { "classpath:org/springframework/batch/admin/web/resources/servlet-config.xml", "classpath:org/springframework/batch/admin/web/resources/webapp-config.xml" } ) public class BatchConfiguration { @Bean public JobBuilderFactory jobBuilderFactory(JobRepository jobRepository) { return new JobBuilderFactory(jobRepository); } @Bean public StepBuilderFactory stepBuilderFactory(JobRepository jobRepository, PlatformTransactionManager transactionManager) { return new StepBuilderFactory(jobRepository, transactionManager); } }
4e2544c5e4b9229537a3c0a4380542991680d9e25ef4729cd9ff6896ae49ba59
['164e33d9802a467390b89174b16f51da']
We were using bartender for QR code printing: http://www.seagullscientific.com/aspx/free-bar-code-label-printing-software-download.aspx in BarTender we can specify x-dimension of QR code I am using following library to generate QR code. http://www.shayanderson.com/php/php-qr-code-generator-class.htm But it uses google charts for generating QR code and i am unable to find option of x-dimension in google chart. So now i want to implement this x-dimension functionality in PHP. Please guide me if there is any open source solution available or if there is any paid solution. [Edit] Please consider following data as sample to generate QR code. 123456789123456789123456789 123456789123456789123456789 123456789123456789123456789 123456789123456789123456789 123456789123456789123456789 123456789123456789123456789 123456789123456789123456789 123456789123456789123456789 123456789123456789123456789 123456789123456789123456789 123456789123456789123456789 123456789123456789123456789 123456789123456789123456789 123456789123456789123456789 123456789123456789123456789 123456789123456789123456789 123456789123456789123456789 123456789123456789123456789 123456789123456789123456789 123456789123456789123456789
346c558c798c4c7e92e664aa3610abfcea81b54e682f96c62e2fe3abf7055150
['164e33d9802a467390b89174b16f51da']
I am working in SVN PHP library, when i try to use svn_add it shows the following error Warning: svn_add(): svn error(s) occured 155007 (Path is not a working copy directory) '/var/www/myrepo' is not a working copy in /var/www/test/test.php on line 7 also tried svn_checkout, svn_cat etc etc I have complete svn repository setup on the my local machine and i am passing the following URL '/var/www/repo/'. Here is the my code $path = '/var/www/myrepo/'; svn_add($path.'test.txt'); tried its http URL as well, it works well with Rabbit VCS SVN and performing all operations with the same URL. Please suggest any solution. Here is the link to phpsvn : http://pk1.php.net/manual/en/book.svn.php Thanks
b76b1e36d65c55c30905e8d8c776516018e0bf79dd5372ebd15df28fb2b62b08
['165c7047e4114616840918d0c08ced75']
We have been debugging an issue today, that fits your description perfectly. We experienced this issue on Apache 2.4.25 on Debian Stretch. From reading GDB thread dumps and Googling for suspicious looking symbols, we eventually found this bug report, that seemed to fit the problem: https://bz.apache.org/bugzilla/show_bug.cgi?id=60956 It seems that the bug was introduced in Apache 2.4.12, and finally fixed in 2.4.28. We backported Apache 2.4.33 from Debian Buster to Stretch. We'll have to monitor the server for a few days to be sure, but we're quite confident that this has fixed it for us.
56c9fdcbd7192948245a2465d6eda2efaff4791becb51fb7e19104a9ea2af889
['165c7047e4114616840918d0c08ced75']
I own Panasonic Eluga Ray Max phone, How can I turn it on without power and volume button as both are broken. Device is already USB debugging enabled but adb cant see it while only charging. So my basic requirement is to boot the phone. Now another question is when I connect phone to PC/wall charger, screen lights up, charging status is show and general "power by android" message stay on screen for few seconds. So my question is there must be some sort of kernel gets loads just to display those messages and charging status, so why adb cant see device. and is there any other tool available which can boot a boot with command line when phone is displaying those message or charging status.
8903674b84510ac8f04b79d5f0ba3a5e101e36f3a36ce97099a3267b4efe8165
['166ac5258aee4b4e891c6a03417f8a48']
I have a homework where I'm creating a program in Python 3.7.x where I need to calculate the number of different paths form point A to B. Now I'm doing a simple Tkinter GUI where it create a square grid of buttons using a user input (from 1 to 8)(Please see image below) Then I created a function where I save the coordinates from the first clicked button and the second, which is the nested function: ``` startPoint = None endPoint = None clicks = 0 def SaveCoord(x,y): def returnFunction(): global clicks if clicks == 0: global startPoint startPoint = [x,y] print(startPoint) clicks+=1 elif clicks == 1: global endPoint endPoint = [x,y] print(endPoint) clicks+=1 else: print("You have already selected your points!") return returnFunction ``` In order to calculate the number of paths, i need to get the difference of X's and Y's which are stored as startPoint and endPoint lists. How can I do that ? I'm not able to access returnFunction() values.Every time I try to do so i get a 'NoneType' object is not subscriptable error If needed I can post the whole code Thank you in advance
76aece7c02436a76b23956bb16355c448dc0e7dbd56188c4afbd5786c51f4902
['166ac5258aee4b4e891c6a03417f8a48']
I was asked to create an automation tool to create a report excel sheet using the data from an internal web page of the company I work for. I selected python(3.7) as my language(since most of my coworkers use it as well)and Selenium to do the job. Once I have clicked and filled all the fields using Selenium to filter the data I need, I got at least 60 pages of 20 rows each one(the number can vary), so I have to copy each page data in an excel sheet and click the 'next' button, copy the data again and so on, until all pages are processed. I was able to copy the data for the first page of the web site, but when I try to do the 'next' process, it fails in saving the data in the excel sheet. Here is the code I'm working with ***Bunch of Selenium steps*** def excelFactory(values, row, col): #fuction to create the excel workbook fname = 'App_Report.xlsx' if os.path.exists(fname): #check if the workbook is already created wb = openpyxl.load_workbook(fname) ws = wb.get_sheet_by_name('Sheet') else: #create the workbook if not found wb = Workbook() ws = wb.active ws.cell(row= row, column= col).value = values #insert the data from the online web in the #workbook row = row + 1 wb.save(fname) def dataDownload(): #function to parse thru the online table and read the data data = driver.find_elements_by_class_name("rowNumber") for td in data: values = td.text print(td) excelFactory(values, row, col) NxtButton = driver.find_elements_by_class_name('NxtButtonClassName') for content in NxtButton: if content.text == 'Next': content.click() dataDownload() dataDownload()
8f72a116964df051f41e46e1b314aa2a1e2b69ed6a479d48ffbb6ffb9e735ff8
['166b007e6b304a16a45e22687b08e90d']
@cerr Ok, so I have done some work with Linux/Apache web servers, but I am not an expert. With that being said though, is the host being managed by GoDaddy or do you manage the host. If its the former then usually GoDaddy will provide you an address to point your @ record and you upload the files the files to your host. Go Daddy has great customers service and can definitely help you achieve this. Now, if you are managing the host and you have multiple website on the host you will need to do your bindings properly, which I am not 100% sure how to do on Linux.
6e51912133acc133ae46a6262419d804e686079b03edc2eaf13ecf950b3b4af8
['166b007e6b304a16a45e22687b08e90d']
@cerr that's correct the @ record should point to your new host. Now also, are you managing the web server? If so you need to make sure you have that domain address assigned to the correct web site on the web server. The process for that will vary based on what OS you are running and web server software like IIS, Apache, etc.
f2187bfde62e083361e9d7a6a2f57f92920e5dbbe1db8d761c1eb529113fecde
['167202d6e46941d988eec3d8a832dfc1']
I am trying to repeat header row (column names) for each group of my report which are in the same page.Please note that i know how to repeat headers on each page, but this is specifically related to repeating header rows on the same page but for each group as shown in the example below.
51bf1710f6c4bea752831aae4b70b5174c586f5a8e13fdacfce29f1731e6ff6b
['167202d6e46941d988eec3d8a832dfc1']
I have a large table which contains 83 million records in it. There is a column called 'TradingDateKey' based on which the table is partitioned. Below are the partition schema and partition functions : CREATE PARTITION SCHEME [ps__fac_sale] AS PARTITION [pf__fac_sale] TO ([fg__fac_sale__2005], [fg__fac_sale__2006], [fg__fac_sale__2007], [fg__fac_sale__2008], [fg__fac_sale__2009], [fg__fac_sale__2010], [fg__fac_sale__2011], [fg__fac_sale__2012], [fg__fac_sale__2013], [fg__fac_sale__2014]) GO CREATE PARTITION FUNCTION pf__fac_sale AS RANGE LEFT FOR VALUES (20050630, 20060630, 20070630, 20080630, 20090630, 20100630, 20110630, 20120630, 20130630) GO As you can see there are no partitions after 20130630 to 20150915. The problem is that We have a query given by our client to run against the above table whihc also uses some joins and it is taking long time to execute . can you please let me know the best possible way to fix this. Can we alter the partition function and schema and rebuild indexes or it has to be complete reload of data into another table with proper partition function & schema?. Your help is appreciated .Thank you
115638391fb2a154706d6175be533eb221cd8045f1e8dbbbb4ca1e973aec0f6c
['167657f34d324571b6a22f846c64c8d5']
I am trying to save a full camera image to a specified Uri when passing the uri to the camera intent. But it does not return to onActvityResult. However, I have tried getting the image using Bundle in the onActivityResult but it returns a thumbnail. I have tried lots of tutorials and they all had this problem. Can u please help!!! Intent camera = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); File u = getTempFile(); picUri = Uri.fromFile(u); camera.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(u)); startActivityForResult(camera, TAKE_PICTURE); onActivityResult if (requestCode == TAKE_PICTURE && resultCode == RESULT_OK && null != data) { Toast.makeText(this, "Image saved to:\n"+picUri, Toast.LENGTH_LONG).show(); }
0ed10648d78c20a8544520b1c6f76914b2240beca1eb71aad257080a3540c6d7
['167657f34d324571b6a22f846c64c8d5']
Determining the number of hidden layers/neurons are based on a trial and error method, and is highly dependable upon the type of training data your using. I always try out matching the number of hidden neurons to the number of input neurons first, and then increment/decrements afterwards. Try changing the number of training epoch and the learning rate too.
162271774f771edfb669f2eedf4842b79ec024704586e16dc2af33cd754cf8d7
['16833c2d1e974034bde832d4d3690b32']
I'm capturing image from camera in horizontal scroll-view .When i select that image and display in full image in Image-view its getting very blurry. Why not display clear image in imageview.How to solve this .Thanks in advance btnCamera.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE); startActivityForResult(cameraIntent, CAMERA_REQUEST); Log.e("Camera", " Open"); } }); protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if (requestCode == CAMERA_REQUEST) { Bitmap photoBitMap = (Bitmap) data.getExtras().get("data");} }
fbb459c65bc248cd011b2d0e7727ef25fcdf7827baa26e016b37f3c15edd8785
['16833c2d1e974034bde832d4d3690b32']
I'm trying to parse string date to date , but getting error of java.text.ParseException: Unparseable date: "" (at offset 0).Here is method for converting date.Exception occur at this line Date date = simpleDateFormat.parse(dateString); public static String convertDateStringFormat(String dateString, String originalDateFormat, String outputDateFormat){ String finalDate = null; SimpleDateFormat simpleDateFormat = new SimpleDateFormat(originalDateFormat); try { Date date = simpleDateFormat.parse(dateString); simpleDateFormat = new SimpleDateFormat(outputDateFormat); finalDate = simpleDateFormat.format(date); } catch (ParseException e) { e.printStackTrace(); } return finalDate; } String newDateString = Constant.convertDateStringFormat(strActiondate , "MM/dd/yyyy hh:mm:ss a", "yyyy-MM-dd hh:mm:ss a"); Log.e("newDateString "," = " + newDateString ); Some string dates are converted , some date are getting null and occur java.text.ParseException: Unparseable date: "" (at offset 0) . Here is my log cat error 02-22 10:40:15.539 <PHONE_NUMBER>/com.example.tazeen.classnkk E/newDateString﹕ = null 02-22 10:40:15.539 <PHONE_NUMBER>/com.example.tazeen.classnkk E/newDateString﹕ = 2015-12-03 12:00:00 AM 02-22 10:40:15.540 <PHONE_NUMBER>/com.example.tazeen.classnkk E/newDateString﹕ = 2015-12-09 12:00:00 AM 02-22 10:40:15.540 <PHONE_NUMBER>/com.example.tazeen.classnkk E/newDateString﹕ = 2015-12-01 12:00:00 AM 02-22 10:40:15.541 <PHONE_NUMBER>/com.example.tazeen.classnkk W/System.err﹕ java.text.ParseException: Unparseable date: "" (at offset 0) 02-22 10:40:15.541 <PHONE_NUMBER>/com.example.tazeen.classnkk W/System.err﹕ at java.text.DateFormat.parse(DateFormat.java:579) 02-22 10:40:15.541 <PHONE_NUMBER>/com.example.tazeen.classnkk W/System.err﹕ at com.example.AdapterClasses.Constant.convertDateStringFormat(Constant.java:49) 02-22 10:40:15.541 <PHONE_NUMBER>/com.example.tazeen.classnkk W/System.err﹕ at com.example.tazeen.classnkk.CustomActionActivity.GetAllActivityList(CustomActionActivity.java:1572) 02-22 10:40:15.541 <PHONE_NUMBER>/com.example.tazeen.classnkk W/System.err﹕ at com.example.tazeen.classnkk.CustomActionActivity$GetAllServicesDetails.doInBackground(CustomActionActivity.java:1229) 02-22 10:40:15.541 <PHONE_NUMBER>/com.example.tazeen.classnkk W/System.err﹕ at com.example.tazeen.classnkk.CustomActionActivity$GetAllServicesDetails.doInBackground(CustomActionActivity.java:1216) 02-22 10:40:15.541 <PHONE_NUMBER>/com.example.tazeen.classnkk W/System.err﹕ at android.os.AsyncTask$2.call(AsyncTask.java:292) 02-22 10:40:15.541 <PHONE_NUMBER>/com.example.tazeen.classnkk W/System.err﹕ at java.util.concurrent.FutureTask.run(FutureTask.java:237) 02-22 10:40:15.541 <PHONE_NUMBER>/com.example.tazeen.classnkk W/System.err﹕ at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112) 02-22 10:40:15.541 <PHONE_NUMBER>/com.example.tazeen.classnkk W/System.err﹕ at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) 02-22 10:40:15.541 <PHONE_NUMBER>/com.example.tazeen.classnkk W/System.err﹕ at java.lang.Thread.run(Thread.java:818) Thanks.
0e30024f77139f7af9347fd31cba13df12e2ea8d1830aa8a969d25f17b7b960c
['16917b19294648a5a17daeacbe4236f2']
<PERSON> - Then how come blacklisting sites out there block our IP specifically as the source? Does that just mean that the source scripts reside on our server, but they might be using open relays elsewhere to do the actual sending? That would make sense I suppose ... I've used tcpdump before but I'll have to google that further ...
4a31303245880186d817f0869129cdca35c11914b922a476f1c7a7f278ef1a6e
['16917b19294648a5a17daeacbe4236f2']
I've been fiddling around with the Hetzner Backup Space and I want to use rsync via. rsnapshot in order to back up my files (more info at their Wiki here) They state in their documentation: The direct use of rsync is not possible. Backup space can, however, be locally mounted using smbfs, sshfs or ftpfs, which allows a limited use of rsync. To take full advantage of rsync (such as incremental backups using hardlinks) an image file must be created, which should be mounted via loopback. In addition to this, it is also possible to add encryption via encfs (Encrypted File System) to protect the data. I've already given it a stab by using Curlftpfs and, well, as it was to be expected that doesn't work very well - I get hangs and timeouts and a plethora of errors. I would like to try the more "correct" way of solving this as described by the quote above - but how do I actually accomplish this? I've tried googling the matter, but the information out there is conflicting and confusing. Encryption is not a must-have for me. I just want something that works, the simpler the better :)
62f5ea355aad785ee7aab43f1a1a5289372f9d683134378e4a149e2d0a55d39e
['16a38b4be7bd4a3cbf68ccfe25f45953']
I receive a variety of input files (CSV, Excel) from clients that all feed into the same data model. The clients all use different headers for their data so I need to map the header options to a single field in a data model. Example: I have a field Company in the class model and the possible headers I need to read from might be Firm, Company, CompanyName, or Business. Right now I'm using a large repetitive switch statement to handle this based on the headers that I've seen. This is working but it's really ugly and repetitive. var map = new Dictionary<string, string>(); var colKey = ""; switch (columnName.ToUpper()) { case "FIRM": case "COMPANY": case "COMPANYNAME": case "BUSINESS": colKey = "COMPANY"; if (!map.ContainsKey( colKey )) { map.Add( colKey, columnName); } break; case "ADDRESS1": case "LINE1": colKey = "LINE1"; if (!map.ContainsKey ( colKey )) { map.Add( colKey, columnName); } break; } Ultimately I need to read the data out of DataRows that may have a variety of headers into a data model. The above code gives me a dictionary I can use to access the data by a known name even though the data's header may not match my data model. Is there a better way to map/parse these possible header options into a data model field?
3b984402e74a76eeb4d7ecb9fb3301bcab39149bb5ca88322e5d317b3f001d6e
['16a38b4be7bd4a3cbf68ccfe25f45953']
I'm not sure these are the best options but they'll definitely get the job done: declare @durations table ( Duration int ) Insert into @durations(Duration) values(60),(80),(90),(150),(180),(1000) --Option 1 - Manually concatenate the values together select right('0' + convert(varchar,Duration / 60),2) + ':' + right('0' + convert(varchar,Duration % 60),2) from @Durations --Option 2 - Make use of the time variable available since SQL Server 2008 select left(convert(time,DATEADD(minute,Duration,0)),5) from @durations GO
1a4cd0be8b4b6e8d1baaab0b185d3fad38139c5d69e2688743a87da43671edef
['16a3f749262d4392989058f324e7eabd']
I have implemented routes to match query parameters in ExtJS7 with following routes code ':node:params': { before: 'isLoggedIn', action: 'onAction', conditions: { ':params': '(^\\?[%a-zA-Z0-9\\-\\_\\s,&=]+)' } } I have also tried with following code ':node?:params': { before: 'isLoggedIn', action: 'onAction' } in both cases, routes with query parameters are not being matched to above routes but invokes unmatchedroute action
b08b70687bcf9bf6098e699becfd9929d0c9d6b279e7146dd8f87bc6ea521efe
['16a3f749262d4392989058f324e7eabd']
Sencha Cmd v6 when built creates a directory under current ext app with name "${ext.dir}", changing config for ext.dir in sencha.cfg does not help How to disable it from generation directory with name "${ext.dir}" instead with some other sensible name. Versions Ext v6 Sencha Cmd 6.1.0
76922efff08038c1782d9ebaf467c89f69a6188e9dd10730ee9da859ecffd5d7
['16b29c6ed010438a9cd0c38876979304']
Maybe Linq to Sql generated not effective Sql query? You can try to fetch all data before apply GroupBy operation. Like this: var vrdetails = vrtemp.ToList().GroupBy(x => x.CompName); In that case you run GroupBy operation on server side. It will increase volume of transferred data but it can work more effective on Sql server
0ac9b222c3bcf9ea94839a4e8053e988190ac0a4a042a7fc7f0655829a456028
['16b29c6ed010438a9cd0c38876979304']
You can try to set domain name by preview.urlprefix parameter http://www.tinymce.com/wiki.php/MCImageManager:preview.urlprefix You can set this parameter in config file or dynamically by code. So you need have something like this in config file: With this setting domain name should add to pictures that was added by tinyMCE image manager
1ca333c167bf7f9de31aceb843888b8a977639fbad0ef8c59b0eb5ee30806d9e
['16c09fffb77f4461a3dfe51d5d30f6d4']
(Linux Mint - V19 / Hardware Acer Laptop, Travelmate / Pen-Tablet Display - xp-pen Artist 12) I use the driver in V1.3.4....etc (Original package of xp-pen HP) The Pen-Tablet Display works, but I need the driver that the pen fits with the screensize and Mouse. Use the Terminal - /folder there the package is located I use: chmod +x Linux_Pentablet_Driver_V1.3.4.sh after that: sudo ./Linux_Pentablet_Driver......sh Now you get a window from the driver to set-up it. But, there is a problem: I have to activate the driver always new
cf659f7dd412d8b3c61609703e9b0892febe53ac9dd902483872f624eb70fbd4
['16c09fffb77f4461a3dfe51d5d30f6d4']
Thanks a lot everyone and and each of you for your time and help and energy, thanks a ton. The issue is resolved, I have added another lines of code in the Postback, which checks the action of the User. For example, if used Remove from the Group, Then get the name of the Group and use action REMOVE Then Update the DropDown box and Current membership box. I did the same for the add group too, and it resolved the issue for me. Thanks again , and whishing you a great day ahead. Regards and Best wishes <PERSON>
60da7988fba1b71c89a9750531be8aa6a9000709c65977c05fccb03b24abbebb
['16cf128a008049f9962fab560427dbf1']
I have a site on drupal that pull some data from Facebook and Twitter with Oauth2, it was working fine but after an update it looks like it stoped working. When I update facebook I get an error like: An AJAX HTTP error occurred. HTTP Result Code: 500 Debugging information follows. Path: /batch?id=123456&op=do StatusText: Internal Server Error ResponseText: The twitter one just simply show a white error page with a 500 message, any ideas on how I can troubleshot this?
b56490cb91713a930b99d2ca923a0ea0f4b8452fa546944bd10525639b02fe24
['16cf128a008049f9962fab560427dbf1']
I have a site on Drupal 7 and a template file for a content type is printing my menu twice. A module named menu_block is installed on the site. My menu is rendered by this call: <?php print render($page['sidebar_first']); ?> Even if I clear the code entirely I can see on text my menu options twice and on the HTML code a class is added to the first one "menu-block-1" and the second one "menu-block-2".
bfd8c81d1c875d9d9c2e7f577d3b49db11d61255b9b1b2d6b945b55702d4666d
['16d1753f10c14886a10976e8b44c6059']
The electrical parameters to consider when choosing a MOSFET are a lot! For SMPS applications the parasitic parameters of a MOSFET are critical, these determine your transition time, your on- resistance, ringing (overshoot when switching) and back-gate breakdown that all relate to effeciency of your SMPS. This image depicts most of the relevant paracitics for a MOSFET. For a power switch you typically want: Very low on resistance (That comes from choosing a wide and short channel MOSFET) Low input capacitance (expacially the Miller capacitance) Low paracitic inductance to drain and source to minimise voltage spikes during switching (Think in terms of physically short connections to your other components) High bake-gate breakdown (high enough to handle whatever voltage spikes your paracitic inductance gives you) For a gate driver (supposing that's what you mean by inverter) you typically want: Low input capacitance for fast switching High drive strength (That is again given by choosing a wide and short channel device. Rule of thumb is to use a MOSFET with 1/3 of the width "W" and 1/3 of the length "L" that your respective power MOSFET has There is a lot more to this subject than what I've mentioned, but it might be a good place to start. Hope it helps.
d2f45349151208df84497cfeff732d3d6111415804f815e7188cd3a3a5700398
['16d1753f10c14886a10976e8b44c6059']
If I follow your link, I can see the char rooms associated with "bicycles". However, I'm not logged in ("Log In" in header). If i click on a chatroom, I access the chat but I can't participate because I am not logged in. If instead I click "log in" in the header I end up on the chat login page. "Log in with stackexchange" gives me the error "No referer was present - this may be due to a browser setting" (which is due to the naziproxy). Test and help page gives me the all-clear.
5fe3feb2d3eba0bc77eb0f8f56fd4341afccaf199ab929750468c3685d78acd5
['17397b83ee16418396b9a9af7138c241']
So I'm not sure if I have this correct, but my understanding is that you're setting a Timer object to fire off an .observe call each second? If so your Firebase calls aren't retrieving the data in time (.observe is async, so that's where the lag comes from). What I would suggest doing instead would be to first set the timestamp you're counting down to and post that value to Firebase. When each device needs the countdown button, they retrieve the timestamp, then set the Timer object to fire in 1 second intervals to retrieve the current time from something like NSDate().timeIntervalFrom1970, find the difference between the two, then set the button text (and deactivate the Timer once the countdown is over). Maybe something like this?: override func viewDidAppear(_ animated: Bool) { // get time to count down from Firestore.firestore().collection("countdown").document("thursday").getDocument { (document, error) in guard let document = document, document.exists else { // document doesn't exist return } guard let theTime = document.data() else { print("Document data was empty.") return } print("Current data: \(theTime)") let stringData = "\(theTime)" let finalTime = stringData.substring(from: 9, to: 16) self.setTimer(for: finalTime) } } // set Timer func setTimer(for finalTime: String) { let timer = Timer.scheduledTimer(withTimeInterval: 1.0, repeats: true) { timer in let timeNow = Date() let dateFormatter = DateFormatter() dateFormatter.timeZone = TimeZone(abbreviation: "EDT") dateFormatter.locale = NSLocale.current dateFormatter.dateFormat = "HH:mm:ss" let strDate = dateFormatter.string(from: timeNow) // stop timer once finalTime reached. Idk what finalDate is but here's if it's formatted the same as strDate is. guard finalTime != strDate else { timer.invalidate() print("countdown over") return } let dateDiff = self.findDateDiff(time1Str: strDate, time2Str: finalTime) print("This is the countdown time: \(dateDiff)") } timer.fire() } Also, I would suggest comparing timestamp values as Doubles and then formatting the difference how you need to instead of formatting each variable and then comparing them as strings
eae4b441ba87e789aa69a42735d59dbb29c9a04849b11433cc7fb4feac969151
['17397b83ee16418396b9a9af7138c241']
I'm trying to make a custom textfield/sendbutton view that overrides inputAccessoryView, but I'm having 2 problems I can't seem to solve: When the custom view becomes the first responder, I get this warning twice: CustomKeyboardProject[5958:3107074] API error: <_UIKBCompatInputView: 0x119e2bd70; frame = (0 0; 0 0); layer = <CALayer: 0x283df9e00>> returned 0 width, assuming UIViewNoIntrinsicMetric Then when I try to resign the custom view as the first responder, Xcode throws this warning: CustomKeyboardProject[5958:3107074] -[UIWindow endDisablingInterfaceAutorotationAnimated:] called on <UITextEffectsWindow: 0x11a055400; frame = (0 0; 375 667); opaque = NO; autoresize = W+H; layer = <UIWindowLayer: 0x283df78a0>> without matching -beginDisablingInterfaceAutorotation. Ignoring. Has anyone been able to silence these warnings? Heres my code: protocol CustomTextFieldDelegate: class { func sendMessage() } class CustomTextField: UITextField { override var canBecomeFirstResponder: Bool { return true } override var canResignFirstResponder: Bool { return true } } class CustomKeyboardView: UIView { let textField: CustomTextField = { let textField = CustomTextField() textField.backgroundColor = .green textField.textColor = .white return textField }() let attachButton: UIButton = { let button = UIButton() button.backgroundColor = .red button.setTitle("Attach", for: .normal) return button }() let sendButton: UIButton = { let button = UIButton() button.backgroundColor = .blue button.setTitle("Send", for: .normal) button.addTarget(self, action: #selector(sendMessage), for: .touchUpInside) return button }() @objc func sendMessage() { delegate?.sendMessage() } weak var delegate: CustomTextFieldDelegate? init() { super.init(frame: .zero) isUserInteractionEnabled = true setViews() } required init?(coder aDecoder: NSCoder) { fatalError("init(coder:) has not been implemented") } func setViews() { let subviews = [attachButton, sendButton, textField] subviews.forEach { $0.translatesAutoresizingMaskIntoConstraints = false addSubview($0) } autoresizingMask = .flexibleHeight subviews.forEach { NSLayoutConstraint.activate([ $0.centerYAnchor.constraint(equalTo: centerYAnchor), ]) } layoutSubviews() [attachButton, sendButton].forEach { NSLayoutConstraint.activate([ $0.widthAnchor.constraint(equalTo: $0.heightAnchor), $0.heightAnchor.constraint(equalTo: textField.heightAnchor) ]) } NSLayoutConstraint.activate([ textField.topAnchor.constraint(equalTo: topAnchor), attachButton.leftAnchor.constraint(equalTo: leftAnchor), textField.leadingAnchor.constraint(equalTo: attachButton.trailingAnchor), sendButton.leadingAnchor.constraint(equalTo: textField.trailingAnchor), sendButton.trailingAnchor.constraint(equalTo: trailingAnchor), ]) } override var intrinsicContentSize: CGSize { return .zero } } class CustomTableView: UITableView { let keyboardView = CustomKeyboardView() override init(frame: CGRect, style: UITableView.Style) { super.init(frame: frame, style: style) keyboardDismissMode = .interactive } required init?(coder aDecoder: NSCoder) { fatalError("init(coder:) has not been implemented") } override var canBecomeFirstResponder: Bool { return true } override var canResignFirstResponder: <PERSON><PHONE_NUMBER>] API error: <_UIKBCompatInputView: 0x119e2bd70; frame = (0 0; 0 0); layer = <CALayer: 0x283df9e00>> returned 0 width, assuming UIViewNoIntrinsicMetric Then when I try to resign the custom view as the first responder, Xcode throws this warning: CustomKeyboardProject[5958:<PHONE_NUMBER>] -[UIWindow endDisablingInterfaceAutorotationAnimated:] called on <UITextEffectsWindow: 0x11a055400; frame = (0 0; 375 667); opaque = NO; autoresize = W+H; layer = <UIWindowLayer: 0x283df78a0>> without matching -beginDisablingInterfaceAutorotation. Ignoring. Has anyone been able to silence these warnings? Heres my code: protocol CustomTextFieldDelegate: class { func sendMessage() } class CustomTextField: UITextField { override var canBecomeFirstResponder: Bool { return true } override var canResignFirstResponder: Bool { return true } } class CustomKeyboardView: UIView { let textField: CustomTextField = { let textField = CustomTextField() textField.backgroundColor = .green textField.textColor = .white return textField }() let attachButton: UIButton = { let button = UIButton() button.backgroundColor = .red button.setTitle("Attach", for: .normal) return button }() let sendButton: UIButton = { let button = UIButton() button.backgroundColor = .blue button.setTitle("Send", for: .normal) button.addTarget(self, action: #selector(sendMessage), for: .touchUpInside) return button }() @objc func sendMessage() { delegate?.sendMessage() } weak var delegate: CustomTextFieldDelegate? init() { super.init(frame: .zero) isUserInteractionEnabled = true setViews() } required init?(coder aDecoder: NSCoder) { fatalError("init(coder:) has not been implemented") } func setViews() { let subviews = [attachButton, sendButton, textField] subviews.forEach { $0.translatesAutoresizingMaskIntoConstraints = false addSubview($0) } autoresizingMask = .flexibleHeight subviews.forEach { NSLayoutConstraint.activate([ $0.centerYAnchor.constraint(equalTo: centerYAnchor), ]) } layoutSubviews() [attachButton, sendButton].forEach { NSLayoutConstraint.activate([ $0.widthAnchor.constraint(equalTo: $0.heightAnchor), $0.heightAnchor.constraint(equalTo: textField.heightAnchor) ]) } NSLayoutConstraint.activate([ textField.topAnchor.constraint(equalTo: topAnchor), attachButton.leftAnchor.constraint(equalTo: leftAnchor), textField.leadingAnchor.constraint(equalTo: attachButton.trailingAnchor), sendButton.leadingAnchor.constraint(equalTo: textField.trailingAnchor), sendButton.trailingAnchor.constraint(equalTo: trailingAnchor), ]) } override var intrinsicContentSize: CGSize { return .zero } } class CustomTableView: UITableView { let keyboardView = CustomKeyboardView() override init(frame: CGRect, style: UITableView.Style) { super.init(frame: frame, style: style) keyboardDismissMode = .interactive } required init?(coder aDecoder: NSCoder) { fatalError("init(coder:) has not been implemented") } override var canBecomeFirstResponder: Bool { return true } override var canResignFirstResponder: Bool { return true } override var inputAccessoryView: UIView? { return keyboardView } } private let reuseId = "MessageCellId" class ExampleViewController: UITableViewController { private let customTableView = CustomTableView() var messages = [String]() override func loadView() { tableView = customTableView view = tableView } override func viewDidLoad() { super.viewDidLoad() tableView.becomeFirstResponder() tableView.register(UITableViewCell.self, forCellReuseIdentifier: reuseId) customTableView.keyboardView.delegate = self } override func viewDidAppear(_ animated: Bool) { super.viewDidAppear(animated) DispatchQueue.main.async { self.customTableView.keyboardView.textField.becomeFirstResponder() } } // tableView delegate methods override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return messages.count } override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cell = tableView.dequeueReusableCell(withIdentifier: reuseId) cell?.textLabel?.text = messages[indexPath.row] return cell! } override func scrollViewWillBeginDragging(_ scrollView: UIScrollView) { customTableView.keyboardView.textField.resignFirstResponder() } } extension ExampleViewController: CustomTextFieldDelegate { func sendMessage() { // double check something is in textField let textField = customTableView.keyboardView.textField guard let body = textField.text, body != "" else { return } messages.append(body) tableView.reloadData() view.endEditing(true) customTableView.keyboardView.textField.text = "" } }
403270b3e76cf40b948b947512dfe4e70ba5486c7d14deb3c70d8c4a94cb4285
['174695eac1904ddba21d76b166a5eff7']
This works may not be the most elegant solution: df = pd.DataFrame({'A': [1, 2, 3, 4], 'B': ['AA', 'ABC, LMN', ('XYZ', 'PQR'), 'OLA']}) # Output A B 0 1 AA 1 2 ABC, LMN 2 3 (XYZ, PQR) 3 4 OLA df['B'].apply(lambda x: ','.join([val for val in x]) if isinstance(x, tuple) else x) # Output 0 AA 1 ABC, LMN 2 XYZ,PQR 3 OLA Name: B, dtype: object
68f2fd836e66ada3c1c4c0710857326453e68b96fd7710f971237dad183c104a
['174695eac1904ddba21d76b166a5eff7']
Here is a better explanation, I have a list of keys of a dict: keys_list = ['one', 'two', 'three'] and my dict is: my_dict = {'one':{'two': {'three': 'three_value'}, 'some': 'some_value'}, 'next': 'next_value'} I would actually like my code to traverse through the list to get the value associated with the last key, as such print(my_dict['one']['two']['three']) # Output: three_value If the keys_list changed to: keys_list = ['next'] It would search print(my_dict['next']) # Output: next_value My current solution import copy copied_dict = copy.deepcopy(my_dict) for key in keys_list: copied_dict = copied_dict[key] print(copied_dict) It is bad, I know and would love a simpler solution.
7beea2af83db288d2432354d612d0d72856037348146a8dcf6bdd76625e92144
['176287cd4abb48e29b2c70e0d5b65a39']
I need to plot data sites on a map. For example, survey "DEPROAS" has five stations so, I need to plot'em and insert it in legend guide. But, when I do this, instead of plotting just once (representative of these five stations), It plots five dots. Any idea? Figure and code below. #### DEPROAS #### - <PERSON> fcf1=[-22-(59.030/60),-42-<PHONE_NUMBER>)] fcf2=[-23-<PHONE_NUMBER>),-41-(54.700/60)] fcf=[fcf1,fcf2] fcf=np.array(fcf) lat_fcf = fcf[0:len(fcf),0] lon_fcf = fcf[0:len(fcf),1] x_fcf,y_fcf=m(lon_fcf,lat_fcf) plt.plot(x_fcf[0],y_fcf[0], 'o', label='DEPROAS', color='#88ff4d', zorder = 3000) plt.plot(x_fcf[1],y_fcf[1], 'o', label='DEPROAS', color='#88ff4d', zorder = 3000) #### DEPROAS #### - Ubatuba fub1=[-23-(43.560/60),-44-(53.860/60)] fub2=[-24-<PHONE_NUMBER>),-44-(39.005/60)] ##rever nos dados no lab fub=[fub1,fub2] fub=np.array(fub) lat_fub = fub[0:len(fub),0] lon_fub = fub[0:len(fub),1] x_fub,y_fub=m(lon_fub,lat_fub) plt.plot(x_fub[0],y_fub[0], 'o', label = 'DEPROAS', color='#88ff4d', zorder = 3000) plt.plot(x_fub[1],y_fub[1], 'o', label = 'DEPROAS', color='#88ff4d', zorder = 3000) #### DEPROAS #### - Guanabara fbg1=[-23-(18.34/60),-42-(45.81/60)] fbg=[fbg1] fbg=np.array(fbg) lat_fbg = fbg[0:len(fbg),0] lon_fbg = fbg[0:len(fbg),1] x_fbg,y_fbg=m(lon_fbg,lat_fbg) plt.plot(x_fbg[0],y_fbg[0], 'o', label = 'DEPROAS', color='#88ff4d', zorder = 3000)
f0a2fdc8c3087fa56e1762bab0f3c0b3979112ffc4870f95f57d3b03fca9127e
['176287cd4abb48e29b2c70e0d5b65a39']
I think that when you use Pandas to plot, it will look for indices within itself and not for values. So, in your case, when you do: point.plot(p1,x) Pandas will look for the index 1993 in the x-direction, i.e, throughout all columns. In other words, you should have 1993 columns. I tried to reproduce your problem as follows: import pandas as pd import numpy as np df = pd.DataFrame(np.random.randint(0,100,size=(10, 4)), columns=('rok', 'kroliki', 'lisy', 'marchewki')) data = df[1:] data=data.astype(float) x = int(data['kroliki'].max()) y = int(data['lisy'].max()) z = int(data['marchewki'].max()) p = data['rok'].where(data['kroliki'] == x) q = data['rok'].where(data['lisy'] == y) r = data['rok'].where(data['marchewki'] == z) p1 = int(p[p.notnull()]) q1 = int(q[q.notnull()]) r1 = int(r[r.notnull()]) point = pd.DataFrame({'x':[p1],'y':[q1],'z':[r1]}) point.plot((p1,x),(q1,y),(r1,z)) I get the following error: >>> AttributeError: 'tuple' object has no attribute 'lower' And when I run each point separately: >>>> IndexError: index 85 is out of bounds for axis 0 with size 3 To solve it: import matplotlib.pyplot as plt plt.plot((point.x, point.y, point.z), (x,y,z),'ko') And I got the following result: Hope it helps.
f0acbf3aabfabae3a8fc6eb8bc042be17579e6af7cca992b1affd0cef389839e
['176f2da151ff416588d7650a262c90c6']
https://docs.djangoproject.com/en/3.1/ref/contrib/messages/#adding-messages-in-class-based-views The SuccessMessageMixin has an attribute success_message, which should be updated in your case to; success_message = "You're registered successfully, Please verify your account from gmail" You should also redirect to the desired page, or render the current page if needed
175138846de6e18ad817d323f007d72b2d220b8907500a972351facf720ead15
['176f2da151ff416588d7650a262c90c6']
More clarity for users that may encounter similar problem. It may be confusing if the app name and the model name is the same, for example the app name is "student", and in student/models, you have a class called Student, which inherits models.Model place holder implementation: model_variable = models.ForeignKey('the_appname.the_model_class_name) more precise example: with an app name as student and model name also Student, and another app attendance, with an attribute "student_id" student_id = models.ForeignKey('student.student)
58a1feab59e848e327e3822651c738ecb75637ce91dc29c71b173faa900a6956
['177316083e6d4be4a788fd5e33ed22f4']
I'm programming a little game where i want to show up a StartScreen and after clicking on it the game will start. But the String's don't show up. The code is: int nRows = 115; int nCols = 42; int[][] grid; Font smallFont; public hitit() { setPreferredSize(new Dimension(1150,420)); setBackground(Color.orange); setFont(new Font("SansSerif", Font.BOLD, 48)); smallFont = getFont().deriveFont(Font.BOLD,18); setFocusable(true); } void drawStartScreen(Graphics2D g) { g.setColor(Color.red); g.setFont(smallFont); g.drawString("hit it",600,100); g.drawString("(click to start)", 250, 240); } public void paintComponent(Graphics2D gg) { super.paintComponent(gg); Graphics2D g = (Graphics2D) gg; g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); drawStartScreen(g); } public static void main(String[] args) { JFrame f = new JFrame(); f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); f.setTitle("hit it"); f.setResizable(true); f.add(new hitit(), BorderLayout.CENTER); f.pack(); f.setLocationRelativeTo(null); f.setVisible(true); } } I tried to implement a run-method but that didn't changed the problem
e017cf03df5869afb874e5b049ab69cd987f91ea663a6c8fd0e741602496fc77
['177316083e6d4be4a788fd5e33ed22f4']
So I copy-pasted the code into a new file and now it's actually working I don't know why, but the position for the two strings was not problem. package testetetetet; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Dimension; import java.awt.Font; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.RenderingHints; import javax.swing.JFrame; import javax.swing.JPanel; public class hitit extends JPanel { int nRows = 115; int nCols = 42; Font smallFont; public hitit() { setPreferredSize(new Dimension(1150, 420)); setBackground(Color.orange); setFont(new Font("SansSerif", Font.BOLD, 48)); setFocusable(true); smallFont = getFont().deriveFont(Font.BOLD, 18); } void drawStartScreen(Graphics2D g) { g.setColor(Color.red); g.setFont(smallFont); g.drawString("hit it", 1150/2, 190); g.drawString("(click to start)", 1150/2, 240); } public void paintComponent(Graphics gg) { super.paintComponent(gg); Graphics2D g = (Graphics2D) gg; g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); drawStartScreen(g); } public static void main(String[] args) { JFrame f = new JFrame(); f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); f.setTitle("hit it"); f.setResizable(false); f.add(new hitit(), BorderLayout.CENTER); f.pack(); f.setLocationRelativeTo(null); f.setVisible(true); } }
b89fa3cb2077e1e32872e297be4a961c6aa7ab1f27a303fb9fbe329c0bcdfcee
['177324ad3f95496498fc9eb9a5cee125']
Good day! Im currently dealing with the formula in determining the expected number of real roots of random algebraic polynomial,,, and I want to solve for the formula of the standard deviation. I have collected a number of real roots from 100,000 different random polynomials with degree of 25. I have the following results: $$Number of real roots==>Number of samples$$ $$1 ==> 2479$$$$3==>24 808$$$$5==>46350$$$$7==>23110$$$$9==>3168$$$$11==>83$$$$13==>2$$ Hence, the expected number of real roots of random algebraic polynomial is asymptotically close to $$\sqrt{n} = \sqrt{25} = 5$$ wherein the actual result based on the given above is $$4.99874$$ Surprisingly, as the number of samples increases, the distribution become more normal. But the results stated above are arbitrary, but again with sufficiently large number of samples, the result will be close to $$\sqrt{n}.$$ At this point, I want to solve for the formula of standard deviation but since the points are arbitrary, it gives me a hard time to solve for the standard deviation... because points changes everytym a new trial will be perform. Is there a feasible way how to deal with standard deviation with unknown points?
531d22c2912b9dcccce0d45a3623a0ef384d0525adb60a84d0277f4f5290fc7f
['177324ad3f95496498fc9eb9a5cee125']
@mvw hmm... let say sir that I have $$\frac{2}{\pi} ln (n)$$ as the mean of a normally distributed discrete data,,, but then I want to compute for the standard deviation...but based on the formula of standard deviation it requires every point x to be subtracted from the mean,,, in order to do so... I must know the magnitude (height) of every point x...
97264fe161f694b70390e5076d0c42bd405504d8ddb816eb871db88ddfa9988c
['17825892206b4eb5bddd98c604439eb1']
It's 36 exposure roll..I've now managed to remove the film..I took the base plate off the camera and noticed a little gear lever was preventing the film advance lever from winding/advancing, so very carefully i pulled it back and it seemed to work as normal again..But, i left it for a while and it got stuck again! I repeated what i done but it eventually goes back to getting stuck?
abeb45f90ef13a0e01ccb0687092c38d7bd379fac79e8fba338754000ae5e17e
['17825892206b4eb5bddd98c604439eb1']
The <PERSON> polynomial of a knot is of the form $$\Delta(t)=det(V^T-tV),$$ where $V$ is the Seifert matrix, see http://archive.lib.msu.edu/crcmath/math/math/a/a116.htm. What is geometric or some other meaning of the zeros of the polynomial? I've encountered a similar expression in the theory of 2D/planar electrical networks, where the zeros are essentially multipliers of harmonic continuation on the networks.
afdfd9b0efd6ecaf9c83adf83caada1aa8b5b31cf5247a678c6df55498d56ed9
['179650fbc9714774ae892bfa3c307737']
Your example code didn't seem to indicate that a character stream was needed. If so, String can already handle all that you want. Assuming String s contains the data, char[] chars = s.toCharArray(); byte[] bytes = s.getBytes("utf-8"); The question then reduces to how to get bytes from a byte stream into String, for which you can use ByteArrayOutputStream, like so: ByteArrayOutputSteam os = new ByteArrayOutputSteam(); os.write(buffer, 0, buffer.length); // it just stores the bytes, doesn't convert yet. // several more os.write() calls s = os.toString("utf-8"); // now it converts the full buffer to a string in the specified encoding. If you truly want something that has a byte input stream and a character output stream, there isn't a built-in one.
c7f3634638b1518242d3c93bed80205fcfa813a329b5433c2bff7d55314a132d
['179650fbc9714774ae892bfa3c307737']
There are several encodings available for chinese (e.g. simplified and traditional). See http://download.oracle.com/javase/6/docs/technotes/guides/intl/encoding.doc.html for a list. The most common ones are GB2312 aka EUC_CN for simplified chinese and Big5 for traditional chinese. I've also seen chinese documents represented in UTF-8.
818cac8eff8a99b46fa117558944add638479bbd9a43552f0912e4a9afb87342
['17a3e8f193c646e3806db5e5371760c5']
If I want to filter a numpy array based on value conditions, I can do: arr = np.array([1, 2, 3, 4]) filtered = arr[arr > 2] # [3, 4] What if my elements have certain properties I wish to filter? Like this: arr = np.array([1], [2, 2], [3, 3, 3], [4, 4, 4, 4]) filtered = arr[len(arr) > 2] # this does not output the desired [[3, 3, 3], [4, 4, 4, 4]], but rather [arr]
287ba977ec9ae544c10ac6648faa62205e13e198fa4dc68b927cdf08c87c8fef
['17a3e8f193c646e3806db5e5371760c5']
I have a bundle of high-dimensional data and the instances are labeled as outliers or not. I am looking to get some insights around where these outliers reside within the data. I seek to answer questions like: Are the outliers spread far apart from each other? Or are they clustered together? Are the outliers lying 'in-between' clusters of good data? Or are they on the 'edge' boundaries of the data? If outliers are clustered together, how do these cluster densities compare with clusters of good data? 'Where' are the outliers? What kind of techniques will let me find these insights? If the data was 2 or 3-dimensional, I can easily plot the data and just look at it. But I can't do it high-dimensional data.
c5fe72cd3da694dbbc43a7a236d2ba55e6b9045726f06b08e11d5049ef1b945e
['17aa4868fbd14362ac47889de0b917e5']
I have a JavaFX program that connects to external web API to download some data. I test parts of the logic using mocks in unit tests but now I would like to test the GUI, that is run the program and see how the downloaded data looks like when put in TableView or ListView. public class Main extends Application { private MainController mainController; @Override public void start(Stage primaryStage) throws Exception { FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("/fxml/main.fxml")); Parent root = fxmlLoader.load(); mainController = fxmlLoader.getController(); primaryStage.setTitle("Title"); primaryStage.setScene(new Scene(root, 600, 550)); primaryStage.show(); } @Override public void stop() { mainController.close(); } } What I tried to do is to have a test method that launches the application using Aplication.launch and then calls a MainController's method setApi to replace the default API manager object with a mockup. Unfortunately I don't know how to get access to the mainController object. So, my question is - can it be done? If yes - how? If not - what is an other way to test the GUI with sample data?
98b2184674d279503c8ee3589eb6007bc1314504c9717dbdc55b86e7328b8a1f
['17aa4868fbd14362ac47889de0b917e5']
I think I found the answer myself. The problem apparently was that this code should be run in JavaFX thread. It can be done this way: public class JavaApp { public void openNewWindow() { Platform.runLater(() -> { try { FXMLLoader loader = new FXMLLoader(getClass().getResource("new-window.fxml")); Parent root = loader.load(); Stage newStage = new Stage(); newStage.setTitle("New window"); newStage.setScene(new Scene(root, 100, 100)); newStage.show(); } catch (IOException e) { e.printStackTrace(); } }); } }
e5cd734c8daaa35863c2135cf9fe97fa8f24be826731142c2615cc9cf57daafb
['17e20997b1f84fcc81eb46f9287bc0b7']
А зачем все это делается? Если я правильно понимаю, CourseHelper bch = new BaseCourseHelper(); вызовет метод getСourse с BaseCourseHelper, после чего этот вызванный метод вернет объект BaseCourse, который будет присвоен ссылке Course вот здесь course = bch.getCourse, а тут System.out.println(bch.getCourse().id); выводит значение поля id для Course, чтобы он бы и сделал, если бы getCourse() вернул не BaseCourse, а Course.
675323f2b2472b5df20fa4821016af2b4a4132b9d81f50d9ea51bac7f5daf743
['17e20997b1f84fcc81eb46f9287bc0b7']
I am trying to determine whether there is a statistically significant difference between the performance of a SVM classifier on two different datasets. The performance of the classifier is determined through Leave-One-Out cross-validation. Each dataset has 480 samples, and is binary categorical: correct prediction or incorrect prediction. It is my understanding that it isn't possible to use a chi-squared test as the separate outcomes from cross-validation tests are not independent within the dataset itself - the same sample is used 479 times. If anybody could suggest to me where to look or how to go about this, I would really appreciate it!
0d65ad19d3caacf1db8d1e785b26ddbe9d7b4e39fae1a781ae68e7d3be9ceb8a
['17e38ab6749945f5ab136e26c37f561e']
A few comments to get you going in the right direction, though you might get better response if you post this to the physics community on Stack Exchange. (a) I don't know what you mean by "$d\theta/dt = d\theta /d\infty$". That is more or less a nonsensical statement. A derivative must be with respect to a variable. $\infty$ is not a variable. Besides, derivatives are "all about slopes" and what you are looking for has nothing to do with the slope of the function. You wish to know how the function behaves as t gets "very large" (i.e. as $t \rightarrow \infty$). When we want to know such things we should think about taking limits... (b) Why take logs? What does a logarithm "do"? (e) You are trying to find a $t$ when $\theta$ takes on a particular value. So you need to solve the equation for $t$. So, how do you "get $t$ out of the exponent"? The answer to this is connected to why you are having trouble with part (b).
1d83f925485d5dcde91fe4168440456d9f341029d13a0115a53809ad31c8879e
['17e38ab6749945f5ab136e26c37f561e']
$F_z$ is not (necessarily) a function of $z$. Notationally if $F$ was a function of z we would write $F(z)$, not $F_z$. What is meant is that $F$ is a "vector field". That is, $\vec{F}(x,y,z)$ is a function which assigns a vector to every position in 3-space. So $F_x$, $F_y$ and $F_z$ refer to the x, y and z-coordinates of $\vec{F}$ at any location. Any coordinate of $F$ could be a function of any position coordinate (or of all three).
23e1c846e35a2593bca2cab532844a221d7db86a2f02891445f9517e5a0cdbe1
['17f2ee0f8761473b830204464a3e2fbc']
Let's say I have Table1 with primary key _id and a boolean column doc_availability; Table2 with foreign key _id and DateTime column last_update and I want to change the availability of a document with _id 14 in Table1 to 0 i.e unavailable and update Table2 with the timestamp when the document was last updated. The following query would do the task: UPDATE Table1, Table2 SET doc_availability = 0, last_update = NOW() WHERE Table1._id = Table2._id AND Table1._id = 14
f0b03c7f0cb5ffc729104801bac9369fce6399d40546ab75babe1a9c5ec8a6ae
['17f2ee0f8761473b830204464a3e2fbc']
To interact with the external storage, you need to create a file_path.xml and also declare a FileProvider in your manifest like so: file_paths.xml: <?xml version="1.0" encoding="utf-8"?> <paths> <external-path name="images" path="AppName" /> </paths> AndroidManifest.xml: <provider android:name="androidx.core.content.FileProvider" android:authorities="com.example.appname" android:exported="false" android:grantUriPermissions="true"> <meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/file_paths"> </meta-data> </provider> After this is done, you can then call the SDK to add or remove files. If your app targets Android 6 and above, you have to request permission at runtime, and also check if the permission has been granted before attempting to access the storage. I use Dexter to manage runtime permission. A function like so can help you achieve this. The method that takes picture with camera, and save it to the directory: private void takeCameraImage() { Dexter.withActivity(this) .withPermissions(Manifest.permission.WRITE_EXTERNAL_STORAGE) .withListener(new MultiplePermissionsListener() { @Override public void onPermissionsChecked(MultiplePermissionsReport report) { if (report.areAllPermissionsGranted()) { fileName = System.currentTimeMillis() + ".jpg"; Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); takePictureIntent.putExtra(MediaStore.EXTRA_OUTPUT, getCacheImagePath(fileName)); if (takePictureIntent.resolveActivity(getPackageManager()) != null) { startActivityForResult(takePictureIntent, REQUEST_IMAGE_CAPTURE); } } } @Override public void onPermissionRationaleShouldBeShown(List<PermissionRequest> permissions, PermissionToken token) { token.continuePermissionRequest(); } }).check(); } The method that returns the URI of the file private Uri getCacheImagePath(String fileName) { File path = new File(Environment.getExternalStorageDirectory(), "AppName"); if (!path.exists()) path.mkdirs(); File image = new File(path, fileName); return getUriForFile(ImagePickerActivity.this, getPackageName(), image); } You can then do something with the file by overriding the onActivityResult() method. NOTE: the File() object accepts two parameters: File(File parent, @NonNull String child) the child must match one of the paths declared in your file_paths.xml. In this case, I used AppName.
e492de0ce89671732dc6ccae88f0fd9a387d81bce008fd679f9fbb56d50cd7df
['17f68cd46cba4386bd5745af06a70f2b']
Double check the sizes of your ranges at the time you're assigning the values. So, set a breakpoint in the editor on the line atsRange.Value = reportRange.Value and check at that point the following values (maybe add them as watches?) atsRange.Rows.Count atsRange.Columns.Count reportRange.Rows.Count reportRange.Columns.Count I suspect that your dimensions are mismatched quite heavily. And if you assign the values of a smaller range into those of a larger range, any cells beyond the area in the smaller range will be set to '#N/A'. So if atsRange is much bigger than reportRange, you'll get a bunch of '#N/A' values.
13c99f99f5abd94ecf19e318d3070b6e2e9d60cf5d1fef7454e1ba5493e65ca2
['17f68cd46cba4386bd5745af06a70f2b']
Excel will only copy-paste that nicely (formulas, formatting, etc) between local Office applications. So when you try to copy from the one device to the other, it's forcing your cells down to a simple plaintext representation. For evidence of this, you could try pasting that same value into a simple text editor like Notepad - you'll see that the only data in your clipboard are the plaintext values, formatted with tabs and newlines to denote the cell positions. But, we can get around this! Turn your spreadsheet over to "Formula View Mode" temporarily - you can toggle this on/off with CTRL+` (which is the "backtick" located under the escape button on a standard QWERTY keyboard). Now you'll see all the formulas in your cells instead of the values. If you copy cells, these formulas will be copied. Then you should be able to paste directly into the remote instance of Excel without any issues.
028cf098cb2e7434a0033d52b099198b8400117ae58b4b4ea9a68954627872b6
['17f7044ca2e04361b87819c1a69c4792']
I'm having difficulties starting the AudioQueue when my app is in the background with iOS4.0 The code works fine when the app is active, but fails with -12985 code when running in the background. err = AudioQueueStart( queueObject, NULL ); if( err ) { NSLog(@"AudioQueueStart failed with %d", err); = NO; AudioQueueStop(queueObject, YES); return; } For the code above, err is set to -12985
bfe4af205e1ef42273373a7d6d876ae94424758d6e2697d97bf961a4cb5e9eb9
['17f7044ca2e04361b87819c1a69c4792']
It's likely your database isn't set to the same encoding as the string you're inserting. Postgres is typically UTF-8. You'll have to set the proper encoding on your string. That could be as simple as "string".encode('UTF-8') Or if the string is improperly tagged you may also have to force_encoding first. ie. it's stored as 'Windows-1252' but not marked as such by Ruby. "string".force_encoding('Windows-1252').encode('UTF-8') We had this problem working with Sendgrid + Heroku Rails http://blog.zenlike.me/2013/04/06/sendgrid-parse-incoming-email-encoding-errors-for-rails-apps-using-postgresql/
9b9e29fbd11d27d8dc008658c6d8bb53a72c42145af4983dd9ee99037a0556e8
['17f899a225904b10894d12ee9270d4e2']
Less elegant, but you may use awk as well. If it is not granted that the same ID+NAME combos will always come consecutively, you have to count each by reading the whole file before output: awk -F, '{c[$1,$2]+=1}END{for (ck in c){split(ck,ca,SUBSEP); print ca[2];g[ca[2]]+=1}for(gk in g){print gk,g[gk]}}' game.csv This will count first every [COL1,COL2] pairs then for each COL2 it counts how many distinct [COL1,COL2] pairs are nonzero.
541c3a1420f80e21367bd2a20c8c4cd186f75dc802f9ad10dcc3e35f346705ef
['17f899a225904b10894d12ee9270d4e2']
A compact and relatively efficient solution is to iterate through elements of needle and always try to locate its first occurrence in the rest of haystack: def istherehidden(needle,haystack): hsp=0 try: for i in needle: hsp+=1+haystack[hsp:].index(i) return True except ValueError: return False Now istherehidden([4,5,7],[4,0,5,0,6,7]) returns True, and istherehidden([5,4,7],[4,0,5,0,6,7])returnsFalse`.
ee372986ed0c40992913a198a3552db7de57b10a163b33b1713a92dfea93d918
['17fe95b3b76949ff94879b528ff69370']
First you can check the member function is already in nm libgnuradio.a | grep gr_firdes<IP_ADDRESS>complex_band_pass or nm libgnuradio.a | grep complex_band_pass and Adds LOCAL_LDFLAGS := -L/usr/local/lib LOCAL_LDLIBS += -llog -lgnuradio If you debug the full build log then build V=1 will be helpful or use VERBOSE=1
06791ba48548987d451948ba724cd0a8052286586d4fd7e7b4d150cddafc75eb
['17fe95b3b76949ff94879b528ff69370']
in http://msdn.microsoft.com/en-us/library/367y26c6.aspx You can use "/FA /Fa" options you can use.. In there documents, CL /FAcs HELLO.CPP /FA Assembly code; .asm /FAc Machine and assembly code; .cod /FAs Source and assembly code; .asm If /FAcs is specified, the file extension will be .cod /FAu Causes the output file to be created in UTF-8 format, with a byte order marker. By default, the file encoding is ANSI, but use /FAu if you want a listing file that displays correctly on any system, or if you are using Unicode source code files as input to the compiler. If /FAsu is specified, and if a source code file uses Unicode encoding other than UTF-8, then the code lines in the .asm file may not display correctly.
00fad6abdb86f6acbdd711e32b2ff9075f2764cc124a37f1922d1479dfbe943f
['1803525e24634595963c6cee95fbc64e']
Nevermind, it was a simple fix. I declared the variables "day" and "day2" outside of the switch case statements instead of inside. import java.util.Scanner; public class exercise_4_5 { public static void main (String[] args) { Scanner scanner = new Scanner(System.in); System.out.println("Enter today's day:"); int num = scanner.nextInt(); if(num > 6 || num < 0) { System.out.println("This is an invalid number"); } String day = "Invalid"; switch(num) { case 0: day = "Sunday"; break; case 1: day = "Monday"; break; case 2: day = "Tuesday"; break; case 3: day = "Wednesday"; break; case 4: day = "Thursday"; break; case 5: day = "Friday"; break; case 6: day = "Saturday"; break; } Scanner scanner2 = new Scanner(System.in); System.out.println("Enter the number of days elapsed since today:"); int num2 = scanner2.nextInt(); int newday = num + num2; while(newday > 6) { newday = newday - 7; } String day2 = "Invalid"; switch(newday) { case 0: day2 = "Sunday"; break; case 1: day2 = "Monday"; break; case 2: day2 = "Tuesday"; break; case 3: day2 = "Wednesday"; break; case 4: day2 = "Thursday"; break; case 5: day2 = "Friday"; break; case 6: day2 = "Saturday"; break; } System.out.println("Today is " + day + " and the future day is " + day2); } }
a697135924fe7e823a2f9e94c6c576c0c800349937d13446f05a68b65a440cb1
['1803525e24634595963c6cee95fbc64e']
So I have a batch file that imports text from a separate txt document and displays it to the user, and I would like to convert them both into a single exe file, meaning the user wouldn't see or be able to change the txt file. Is this possible or am I just speaking non-sense?
872c573800b5ce385145a5cb966615ca77ad396072aef5d17f70ce0218251659
['1805cca55e49470193bc512971222476']
In my case, I don't want to make a full text search across all the fields. As a quick as working solution I added custom column, search queries to be run accordingly to: @Column(name = "full_text_search_index", columnDefinition = "TEXT", nullable = false) In this column I store and keep consistent (on entity updates) needed fields for search (some kind of denormalization), then search queries just run in 'contains' like mode. This column is indexes, so it is working quite good.
4007bbe29f3fbabe8c8158896aea13fad4d2d464342ca744766223ff42165440
['1805cca55e49470193bc512971222476']
Immutable + Lombok + Jackson can be achieved in next way: import com.fasterxml.jackson.databind.ObjectMapper; import lombok.AccessLevel; import lombok.AllArgsConstructor; import lombok.NoArgsConstructor; import lombok.Value; @Value @NoArgsConstructor(force = true, access = AccessLevel.PRIVATE) @AllArgsConstructor public class LocationDto { double longitude; double latitude; } class ImmutableWithLombok { public static void main(String[] args) throws Exception { ObjectMapper objectMapper = new ObjectMapper(); String stringJsonRepresentation = objectMapper.writeValueAsString(new LocationDto(22.11, 33.33)); System.out.println(stringJsonRepresentation); LocationDto locationDto = objectMapper.readValue(stringJsonRepresentation, LocationDto.class); System.out.println(locationDto); } }
4891e94722903a3abdc9c90fd1f5bbd7a846837286b4cf079a693f12e93e6a5a
['1806b82cbef44cd69d8cf8403da688ca']
I am using Visual Studio 2017 with Selenium C# for automation testing. I do see when I right click a Test, 'Associate to Test Case' is enabled. When I click it though, I do see an error - 'You are not logged into Team Services or Team Foundation Server. Please login to an account and try again'. I validated in the Team Explorer - Home, my test repository is displayed. I did close and reopen Visual Studio and reconnected to my project but still seeing the error. Any advice would be great. Thank you. :)
5bbd4afad08b34e8bdc1d92cde19c7f9b804515c5c16036c022dd53e795fa30b
['1806b82cbef44cd69d8cf8403da688ca']
Currently have only 4 tests which all pass. The first 3 do close the browser window in between tests. After the 4th test is complete, the browser is left open. Doesn't matter which browser I use. Any guidance would be great. The code: Test class file: using System; using System.Collections.Generic; using System.Text.RegularExpressions; using System.Windows.Input; using System.Windows.Forms; using System.Drawing; using Microsoft.VisualStudio.TestTools.UITesting; using Microsoft.VisualStudio.TestTools.UnitTesting; using Microsoft.VisualStudio.TestTools.UITest.Extension; using Keyboard = Microsoft.VisualStudio.TestTools.UITesting.Keyboard; using OpenQA.Selenium; using OpenQA.Selenium.Firefox; using OpenQA.Selenium.Chrome; using OpenQA.Selenium.IE; using Microsoft.VisualStudio.TestTools.UITesting.HtmlControls; using NUnit.Framework; using OpenQA.Selenium.Support.UI; using OpenQA.Selenium.Remote; using TestContext = Microsoft.VisualStudio.TestTools.UnitTesting.TestContext; using OpenQA.Selenium.Interactions; using OpenQA.Selenium.Safari; namespace Resolver.TestCases { /// <summary> /// /// </summary> [TestClass] public class NavigationTests: Common.Base { public static string Url = "some url"; public static string browser = "chrome"; public static string userName = "<EMAIL_ADDRESS>"; public static string password = "password"; public static string bogusUserName = "stimpycom"; public static string bogusPassword = "123"; [AssemblyInitialize] public static void Setup(TestContext context) { Common.BrowserActions.ChooseDriverInstance(browser); HomePage.GoTo(Url); NUnit.Framework.Assert.IsTrue(HomePage.IsAt()); Pages.LoginPage.SetUserName(userName); Pages.LoginPage.SetUserPassword(password); Pages.LoginPage.LoginIntoApp(); Common.Base.Extras.Sleep(3000); } [TestMethod] public void InvalidLogin() { ////log out Pages.UserMenu.OpenUserMenu(); Pages.UserMenu.Logout(); //click in the email/username and password fields - leave blank Pages.LoginPage.SetUserName(""); Pages.LoginPage.ValidateMissingUsername(); Pages.LoginPage.SetUserPassword(""); Pages.LoginPage.ValidateMissingPassword(); Pages.LoginPage.ValidateLoginNotEnabled(); //enter just password Pages.LoginPage.SetUserPassword(password); Pages.LoginPage.ValidateLoginNotEnabled(); //set the user name and password to bogus values Pages.LoginPage.SetUserName(bogusUserName); Pages.LoginPage.SetUserPassword(bogusPassword); Pages.LoginPage.ValidateLoginNotEnabled(); //validate can log in HomePage.GoTo(Url); Pages.LoginPage.SetUserName(userName); Pages.LoginPage.SetUserPassword(password); Pages.LoginPage.LoginIntoApp(); Common.Base.Extras.Sleep(500); } [TestMethod] public void Go_toLeftNavigationOption() { Pages.CasesPage.SelectCases(); Pages.CasesPage.SelectTypeofCases("Active"); Pages.CasesPage.SelectTypeofCases("Resolved"); Pages.CasesPage.SelectTypeofCases("Closed"); Pages.CasesPage.SelectTypeofCases("Recent"); Pages.CasesPage.SelectTypeofCases("All Cases"); Pages.EasyEstimatePage.SelectNav("Easy Estimate"); Pages.ReferACasePage.SelectNav("Refer a Case"); Pages.QuestionsPage.SelectNav("Questions"); Pages.SettingsPage.SelectNav("Settings"); Pages.CasesPage.SelectCases(); } [TestMethod] public void Go_toTopNavigationOption() { Pages.NotificationsTopNav.OpenNotificationsTopNav(); //user pulldown - My Profile Pages.UserMenu.OpenUserMenu(); Pages.UserMenu.OpenMyProfile(); //Search //Pages.CaseSearch.SearchForCase(); } [TestMethod] public void RememberMeValidation() { ////log out first Pages.UserMenu.OpenUserMenu(); Pages.UserMenu.Logout(); Common.Base.Extras.Sleep(150); ////set the user name and password Pages.LoginPage.SetUserName(userName); Pages.LoginPage.SetUserPassword(password); //check the remember me check box Pages.LoginPage.CheckRememberMe(); Pages.LoginPage.LoginIntoApp(); Common.Base.Extras.Sleep(2000); //log out Pages.UserMenu.OpenUserMenu(); Pages.UserMenu.Logout(); Common.Base.Extras.Sleep(150); //only enter the user password ID to login if (browser == "ie") { Pages.LoginPage.SetUserName(userName); } Pages.LoginPage.SetUserPassword(password); Pages.LoginPage.LoginIntoApp(); Common.Base.Extras.Sleep(350); Pages.UserMenu.OpenUserMenu(); Pages.UserMenu.Logout(); } [TestCleanup] public void CleanUp() { Common.BrowserActions.Close(); } } } The BrowserActions class file (maybe where my logic is off) using OpenQA.Selenium; using OpenQA.Selenium.Firefox; using OpenQA.Selenium.Chrome; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading; using System.Threading.Tasks; using static System.Windows.Forms.VisualStyles.VisualStyleElement; using OpenQA.Selenium.IE; using OpenQA.Selenium.Support.UI; using OpenQA.Selenium.Edge; using OpenQA.Selenium.Remote; using static Dapper.SqlMapper; namespace Resolver.Common { public enum BrowserType { Chrome, Firefox, IE, Edge } public class BrowserActions { public static BrowserType _browserType; private static readonly IDictionary<string, IWebDriver> Drivers = new Dictionary<string, IWebDriver>(); private static readonly IDictionary<string, WebDriverWait> Waits = new Dictionary<string, WebDriverWait>(); private static IWebDriver driver; private static WebDriverWait wait; public static IWebDriver webDriver { get { if (driver == null) { throw new NullReferenceException("IWebDriver is null. The WebDriver browser instance was not initialized. " + "You should first call the method 'InitBrowser'."); } return driver; } private set { driver = value; } } public static WebDriverWait Wait { get { if (wait == null) { throw new NullReferenceException("WebDriverWait is null, The WebDriver browser instance was not initialized. " + "You should first call the method 'InitBrowser'."); } return wait; } private set { wait = value; } } public static string Title { get { return driver.Title; } } public static void Goto(string url) { driver.Url = url; driver.Manage().Window.Maximize(); Thread.Sleep(5000); driver.Manage().Cookies.DeleteAllCookies(); } public static void ScrollToBottom()//IWebDriver driver { long scrollHeight = 0; do { IJavaScriptExecutor js = (IJavaScriptExecutor)webDriver; var newScrollHeight = (long)js.ExecuteScript("window.scrollTo(0, document.body.scrollHeight); return document.body.scrollHeight;"); if (newScrollHeight == scrollHeight) { break; } else { scrollHeight = newScrollHeight; Thread.Sleep(400); } } while (true); } public BrowserActions(BrowserType browser) { _browserType = browser; } public static void ChooseDriverInstance(string browser) { switch (browser) { case "chrome": driver = new ChromeDriver(); break; case "ie": var optionsIE = new InternetExplorerOptions() { IntroduceInstabilityByIgnoringProtectedModeSettings = true, IgnoreZoomLevel = true, EnableNativeEvents = false, RequireWindowFocus = false, //maybe helpful UnhandledPromptBehavior = UnhandledPromptBehavior.Accept, EnablePersistentHover = true, EnsureCleanSession = true }; driver = new InternetExplorerDriver(optionsIE); //driver = new RemoteWebDriver(new Uri("https://test-resolver-web.azurewebsites.net/"), optionsIE.ToCapabilities(), TimeSpan.FromSeconds(300)); break; case "firefox": driver = new FirefoxDriver(); break; case "Chrome-headless": ChromeOptions opts1 = new ChromeOptions(); opts1.AddArgument("ignore-certificate-errors"); opts1.AddArgument("headless"); opts1.AddUserProfilePreference("credentials_enable_service", false); opts1.AddUserProfilePreference("profile.password_manager_enabled", false); ChromeDriverService service1 = ChromeDriverService.CreateDefaultService(); driver = new ChromeDriver(service1, opts1, TimeSpan.FromMinutes(2)); // wait = new WebDriverWait(driver, TimeSpan.FromSeconds(Properties.Settings.Default.DefaultTimeout)); Drivers.Add("chrome", driver); Waits.Add("chrome", wait); break; case "Edge": driver = new EdgeDriver(); //wait = new WebDriverWait(driver, TimeSpan.FromSeconds(Properties.Settings.Default.DefaultTimeout)); Drivers.Add("Edge", driver); Waits.Add("Edge", wait); break; default: driver = new ChromeDriver(); break; } } public static void Close() { foreach (var key in Drivers.Keys) { Waits[key] = null; Drivers[key].Close(); Drivers[key].Quit(); driver = null; GC.Collect(); } } } } Also, maybe not necessary to include - the Pages class file: using OpenQA.Selenium; using OpenQA.Selenium.Remote; using OpenQA.Selenium.Support.PageObjects; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using NUnit.Framework; using OpenQA.Selenium.Firefox; using Resolver; using Microsoft.VisualStudio.TestTools.UITesting; using OpenQA.Selenium.Support.UI; namespace Resolver { public static class Pages { public static HomePage HomePage { get { var homePage = new HomePage(); // PageFactory.InitElements(Browser.Driver, homePage); // //static method takes the driver instance of the given class // //and the class type, and returns a Page Object with its fields // //fully initialized. return homePage; } } public static LoginPage LoginPage { get { var loginPage = new LoginPage(); // //PageFactory.InitElements(Browser.Driver, homePage); // ////static method takes the driver instance of the given class // ////and the class type, and returns a Page Object with its fields // ////fully initialized. return loginPage; } } public static CasesPage CasesPage { get { var casesPage = new CasesPage(); return casesPage; } } public static EasyEstimatePage EasyEstimatePage { get { var easyEstimatePage = new EasyEstimatePage(); return easyEstimatePage; } } public static ReferACasePage ReferACasePage { get { var referACasePage = new ReferACasePage(); return referACasePage; } } public static QuestionsPage QuestionsPage { get { var questionsPage = new QuestionsPage(); return questionsPage; } } public static SettingsPage SettingsPage { get { var settingsPage = new SettingsPage(); return settingsPage; } } public static UserMenu UserMenu { get { var userMenu = new UserMenu(); return userMenu; } } public static CaseSearch CaseSearch { get { var caseSearch = new CaseSearch(); return caseSearch; } } public static NotificationsTopNav NotificationsTopNav { get { var notificationsTopNav = new NotificationsTopNav(); return notificationsTopNav; } } public static CreateAnAccount CreateAnAccount { get { var createAnAccount = new CreateAnAccount(); return createAnAccount; } } } public class LoginPage { public LoginPage() { } IWebElement userNameField => Common.BrowserActions.webDriver.FindElement(By.Id("username")); IWebElement passwordField => Common.BrowserActions.webDriver.FindElement(By.Id("password")); IWebElement emailRequiredMessage => Common.BrowserActions.webDriver.FindElement(By.Id("email-required")); IWebElement passwordRequiredMessage => Common.BrowserActions.webDriver.FindElement(By.Id("password-error")); IWebElement loginInformationIncorrectErrorMsg => Common.BrowserActions.webDriver.FindElement(By.Id("invalid-login")); IWebElement emailInvalidMessage => Common.BrowserActions.webDriver.FindElement(By.Id("email-error")); IWebElement loginButton => Common.BrowserActions.webDriver.FindElement(By.Id("login_button")); IWebElement rememberMeCheckbox => Common.BrowserActions.webDriver.FindElement(By.Id("remember_me")); //IList<IWebElement> oCheckBox = BrowserActions.Driver.FindElements(By.Id("mat-checkbox-1")); IWebElement forgotUsernamePassword => Common.BrowserActions.webDriver.FindElement(By.Id("forgot_username_password")); IWebElement createAnAccount => Common.BrowserActions.webDriver.FindElement(By.Id("create_account")); IWebElement logoutSuccessMessage => Common.BrowserActions.webDriver.FindElement(By.Id("logout-message")); public void SetUserName(string userName) { userNameField.SendKeys(userName); passwordField.Click(); Common.Base.Extras.Sleep(5000); } public string GetUserName() { var userNameCurrent = userNameField.Text; return userNameCurrent; } public void SetUserPassword(string password) { passwordField.SendKeys(password); userNameField.Click(); } public void CheckRememberMe() { rememberMeCheckbox.Click(); } public void LoginIntoApp() { loginButton.Click(); } public void ValidateLoginNotEnabled() { Assert.IsFalse(loginButton.Enabled); } public void ValidateMissingUsername() { DefaultWait<IWebElement> wait = new DefaultWait<IWebElement>(emailRequiredMessage); wait.Timeout = TimeSpan.FromSeconds(250); Assert.IsTrue(emailRequiredMessage.Displayed); } public void ValidateMissingPassword() { Assert.IsTrue(passwordRequiredMessage.Displayed); } } public class CaseSearch { public CaseSearch() { } IWebElement searchButton => Common.BrowserActions.webDriver.FindElement(By.Id("search-icon")); //IWebElement searchButton2 => BrowserActions.Driver.FindElement(By.XPath("//button[contains(text(), 'search-icon')]")); IWebElement closeSearch => Common.BrowserActions.webDriver.FindElement(By.Id("collapse-search")); public void SearchForCase() { searchButton.Click(); } public void CloseCaseSearch() { closeSearch.Click(); } } public class NotificationsTopNav { public NotificationsTopNav() { } IWebElement notificationBell => Common.BrowserActions.webDriver.FindElement(By.Id("notifications-bell")); public void OpenNotificationsTopNav() { notificationBell.Click(); } } public class UserMenu { public UserMenu() { } IWebElement userMenu => Common.BrowserActions.webDriver.FindElement(By.Id("userMenu")); IWebElement openMyProfile => Common.BrowserActions.webDriver.FindElement(By.Id("my-profile")); IWebElement logout => Common.BrowserActions.webDriver.FindElement(By.Id("logout")); IWebElement userNameField => Common.BrowserActions.webDriver.FindElement(By.Id("username")); public void OpenUserMenu() { Common.Base.Extras.Sleep(3000); userMenu.Click(); } public void OpenMyProfile() { openMyProfile.Click(); } public void Logout() { logout.Click(); Common.Base.Extras.Sleep(2000); //validate returned to the login page NUnit.Framework.Assert.IsTrue(userNameField.Displayed); } } public class CasesPage { public CasesPage() { } IWebElement myCases => Common.BrowserActions.webDriver.FindElement(By.PartialLinkText("My Cases")); IWebElement activeCases => Common.BrowserActions.webDriver.FindElement(By.PartialLinkText("Active (10)")); IWebElement resolvedCases => Common.BrowserActions.webDriver.FindElement(By.PartialLinkText("Resolved (12)")); IWebElement closedCases => Common.BrowserActions.webDriver.FindElement(By.PartialLinkText("Closed (13)")); IWebElement recentCases => Common.BrowserActions.webDriver.FindElement(By.PartialLinkText("Recent (16)")); IWebElement allCases => Common.BrowserActions.webDriver.FindElement(By.PartialLinkText("All Cases (71)")); public void SelectCases() { myCases.Click(); Common.Base.Extras.Sleep(2000); } public void SelectTypeofCases(string caseCategory) { switch (caseCategory) { case "Active": activeCases.Click(); break; case "Resolved": resolvedCases.Click(); break; case "Closed": closedCases.Click(); break; case "Recent": recentCases.Click(); break; case "All Cases": allCases.Click(); break; default: myCases.Click(); break; } } } public class EasyEstimatePage { public EasyEstimatePage() { } IWebElement myCases => Common.BrowserActions.webDriver.FindElement(By.PartialLinkText("Easy Estimate")); public void SelectNav(string leftNavigationOption) { myCases.Click(); } } public class ReferACasePage { public ReferACasePage() { } IWebElement myCases => Common.BrowserActions.webDriver.FindElement(By.PartialLinkText("Refer a Case")); public void SelectNav(string leftNavigationOption) { myCases.Click(); } } public class QuestionsPage { public QuestionsPage() { } IWebElement myCases => Common.BrowserActions.webDriver.FindElement(By.PartialLinkText("Questions")); public void SelectNav(string leftNavigationOption) { myCases.Click(); } } public class SettingsPage { public SettingsPage() { } IWebElement myCases => Common.BrowserActions.webDriver.FindElement(By.PartialLinkText("Settings")); public void SelectNav(string leftNavigationOption) { myCases.Click(); } } public class CreateAnAccount { public CreateAnAccount() { } IWebElement name => Common.BrowserActions.webDriver.FindElement(By.PartialLinkText("")); IWebElement userName => Common.BrowserActions.webDriver.FindElement(By.PartialLinkText("")); IWebElement password => Common.BrowserActions.webDriver.FindElement(By.PartialLinkText("")); IWebElement passwordConfirm => Common.BrowserActions.webDriver.FindElement(By.PartialLinkText("Settings")); IWebElement readAndAcceptTerms => Common.BrowserActions.webDriver.FindElement(By.PartialLinkText("Settings")); IWebElement createAnAccountButton => Common.BrowserActions.webDriver.FindElement(By.PartialLinkText("Create an account")); IWebElement loginLink => Common.BrowserActions.webDriver.FindElement(By.PartialLinkText("Login")); public void EnterRequiredData(string name, string username, string password, string passwordConfirm) { } public void AlreadyHaveAccountClick() { createAnAccountButton.Click(); } } public class HomePage { //public static string Url = "https://test-resolver-web.azurewebsites.net"; public static string PageTitle = "Resolver"; public RemoteWebDriver _driver; public object webDriver; public HomePage(RemoteWebDriver driver) => _driver = driver; public HomePage() { } public static void GoTo(string Url) { Common.BrowserActions.Goto(Url); //_driver.Manage().Window.Maximize(); Console.WriteLine("Go to url in the home page : " + Url); } public static bool IsAt() { return Common.BrowserActions.Title == PageTitle; } } }
1cb28fd7283ac921c30e87a75a5f41775cf31f8d03a3730c6770202f52aaba72
['180fa1c7a6d04513b051915141c15b4d']
None of these options worked for me, trying to use a date_field_tag. What did work is passing the value like this: date_field_tag(:my_thing_end_date, :end_date, value: Date.current.strftime('%Y-%m-%d') From the docs ( http://apidock.com/rails/v4.0.2/ActionView/Helpers/FormHelper/date_field) The default value is generated by trying to call “to_date” on the object’s value, which makes it behave as expected for instances of DateTime and ActiveSupport<IP_ADDRESS>TimeWithZone. So passing the date as a string that would be entered by the user seems to be the solution. Also, according to this good info on dates and time zones, Date.current is preferable to Time.today: https://robots.thoughtbot.com/its-about-time-zones.
7583a08394a7d583fb1298c812de96abf2ef7d489f489884b132ab4fdcbbf431
['180fa1c7a6d04513b051915141c15b4d']
You are getting undefined method error because the method is being called on nil. You can only call updated_at on a pre_writing, so you need to make sure you have one first. Then you need to call the method on the actual object rather than the id. That can be done with something like <%= element.pre_writings.first.try(:updated_at) %> Using try will prevent the error if pre_writings.first is nil. Or you can add the check in your if: <% if @classroom.user_id == current_user.id && element.pre_writings.any? %> <%= element.pre_writings.first.updated_at %> You may also want to rename element to student for readability since it's the student that has many pre_writings.
846434b535a863c8ce19406eec0521016b606b7914f60bf0f0d56c636d268de3
['181d30b7b8124bde87f4e4d7e3f6d184']
If you are using your myStack variable inside of the scope of your myFunction() call, it will not be garbage collected until the end of the myFunction() call. For example: public void myFunction() { Stack myStack = new Stack(); //do stuff with myStack } In this situation, if you call myFunction(), your myStack variable will be garbage collected once your myFunction() call is over. However, if you are accessing the myStack variable inside of the myFunction() method (from some other scope), it won't be garbage collected at the end of the myFunction() call because there is (likely) another reference to it.
e5e0acff3581d5232b1d390eab4a7818deecfd095295c27b4f794eade113cd3b
['181d30b7b8124bde87f4e4d7e3f6d184']
What I would suggest is not doing all of this work manually, but letting your computer take a bit of the workload. You can use a tool such as Fiddler and the Fiddler Request To Code Plugin in order to programmatically generate the C# code for duplicating the web request. You can then modify it to take whatever dynamic input you may need. If this isn't the route you'd like to take, you should make sure that you are requesting this data with the correct cookies (if applicable) and that you are supplying ALL POST data, no matter how menial it may seem.
9aaeba49e703b99091b74e6597c0ec8c93f1a6ef4d6aaa83aebda3c9694e24f0
['181d661036f84564a1f8c82dc01af2a6']
I want to connect two computers using netcat that are on the different subnets The problem is when I start Netcat to listen on one computer, I am unable to connect to it from another computer which is on a different Subnet.. Here is a quick sketch to help you understand my problem properly Problem Description I have heard a little bit about tunneling. Can it be used to in this case? If yes, then how will i do it practically?
51ac3f5d08bcabee040e80ba3069a7a3c7aa2254eb453d0273e425fa259a3ea4
['181d661036f84564a1f8c82dc01af2a6']
I'm trying to compile a simple face detection program in C++ in VS2010 and have come across two LNK 2019 errors: Error 2 error LNK2019: unresolved external symbol _cvReleaseHaarClassifierCascade referenced in function _main Error 3 error LNK2019: unresolved external symbol _cvHaarDetectObjects referenced in function "void __cdecl detectFaces(struct _IplImage *)" (?detectFaces@@YAXPAU_IplImage@@@Z) Relevant code lines: cvReleaseHaarClassifierCascade( &cascade ); ... CvSeq *faces = cvHaarDetectObjects( img, cascade, storage, 1.1, 3, 0, /*CV_HAAR_DO_CANNY_PRUNNING*/ cvSize( 40, 40 ) ); I couldn't really find many references to this particular issue and I believe all the relevant libraries/directories are as they should be for the solution. When I go to the function definitions it finds them in objdetect.hpp but what I don't understand is why I'm getting these LNK errors?
9a1e0ceb29fd9ddb25c3275da4ac847346861691f3b19d60992416700b3cd25b
['181e83f776cd46199463b5af09673713']
I've installed Mikrotik hEX at location 'A', Mikrotik hAP AC^2 at location 'B', and connected each with OVPN L2. Both two routers have their NAT features turned on, and have their private network. hEX has network <IP_ADDRESS>/23, and hAP has network <IP_ADDRESS>/24. These two local networks are are bound as one local network <IP_ADDRESS><PHONE_NUMBER>, and hAP has network <PHONE_NUMBER>. These two local networks are are bound as one local network <PHONE_NUMBER>. I've confirmed all bridge, routing and DHCP policy are configured and worked as I expected. After configuring above setting, I'm trying to connect to an public IP ('X') from device attached under hEX, to use this route. End device -> hEX -> hAP -(NAT)-> Remote server 'X' To accomplish this, I've added routing policy to 'X' to use IP of VPN server binding interface on hEX as gateway, and confirmed ICMP echo reply is well received, stable, and requires about 9-12 ms to be replied. However, when I use any software which is using TCP to establish connection(I've not confirmed if UDP is being affected too, but I think it is negative.), something strange happens like this: Even other TCP packets are replying ASAP, under 50 msec, if TCP connection is established. However, only TCP ACK packet replying SYN, ACK of server is keep being retransmitted for about 10 secs and then handshake process is continued. This behavior is also found while HTTPS connection is established, and is observed at all devices under hEX. If I remove routing policy to address X, then use route End device -> hEX -(NAT)-> Remote server 'X', TCP handshake is immediately established. If I connect to address X on device under hAP, by using route End device -> hAP -(NAT)-> Remote server 'X', TCP handshake is immediately established. What is the problem, and how should I fix it?
e9f76b8eaee38cc6e55ae5ab90d532d2e14a6fbd61ed5182a5b58ffe9d082806
['181e83f776cd46199463b5af09673713']
I've installed Transmission daemon on machine #0(Ubuntu 16.04.5, native), and Apache2(Apache/2.4.18) on machine #1(Ubuntu 16.04.5, on XCP-NG 75). Apache is now reverse-proxying transmission for adopting TLS to transmission rpc. Wherever I connect to transmission via apache, it continues returning 'Connection reset by Peer' for few minutes interval. I can sure this is not a problem of network, since SSH connection from My PC to machine #1, and machine #1 to machine #0 both remains stablized. This is a config for transmission vHost. <IfModule mod_ssl.c> <VirtualHost *:443> SSLEngine on SSLCertificateFile [A Certificate File] SSLCertificateKeyFile [A Certificate Key File] SSLCertificateChainFile [A Certificate Chain File] ServerName [Hostname] ProxyRequests Off ProxyPass / http://[Address to machine #0]:9091/ ProxyPassReverse / http://[Address to machine #0]:9091/ <Location "/"> AuthType Basic AuthName "Transmission" AuthUserFile [Authentication File] Require valid-user </Location> </VirtualHost> </IfModule> Which makes this kind of problem? and how should I fix it?
9463d2b471f47a41f2f33da348d1fcf959ede07c16f40fab7d98dd83d7feb0ab
['181f232080a1460e8a10468aeb7a921c']
So that new notifications settings thing on lolipop is really cool and all, but you need to change the volume in order to bring it up. Which is a problem when listening to music, because pressing the volume button brings up music volume, not notification volume. Is there a way to silence/unsilence my phone while listening to music without downloading a third party app?
39b0a0067828fb6d3910b2f64d019edbdae4748b16a44d0af4a4e1b718a3ebb1
['181f232080a1460e8a10468aeb7a921c']
I have some remote Linux servers on which I wish to run a Windows-only application. I don't want to stop running Linux on any of the servers because they do other Linux-only things, so I am thinking of running Windows 7 in a VM under Linux. The application is a video encoding software that only works in Windows. I'd have Cygwin on the Windows guest OS, scp the input file in, ssh to invoke the encoder, and scp the output file back to the Linux host OS. Questions: Will VirtualBox perform OK? Is there a better option? Is there a way to expose a directory on the Linux host, to the Windows guest, in order to skip the scping? Finally, if you would approach this problem differently, how would you do it?
4e74d972c3b693511d57302110e78ab056dc64893bb8e1d64a52da6ded7a1c48
['182b0fd03e6248ef8da06af6a9233202']
for empty array just put the if condition check out the example below. I hope this will help you .btnEmpty{ color: red; } if (values1.length === 0) { $('button').addClass('btnEmpty'); }else{ $('button').removeClass('btnEmpty'); } and if you want to check both var then just || in if condition if (values1.length === 0 || values2.length === 0) { $('button').addClass('btnEmpty'); }else{ $('button').removeClass('btnEmpty'); }
0177a8833d50e47dd4f3e5ff81f38a6cbad30eb1f9672bcd4b8baacfdd8d398a
['182b0fd03e6248ef8da06af6a9233202']
I also got that same issue of "{"error": "unsupported_grant_type"}" for that, I just pass all the body parameters directly without using JSON.stringify({}); It works for me, find the example code below. body: 'grant_type=password&username=MyUserName&password=MyPassword' you need to update the body section only. fetch('MyApiUrl', { method: 'POST', headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, body: 'grant_type=password&username=MyUserName&password=MyPassword' }) .then(res => res.json()) .then(token => console.log(token)) .catch(err => console.error(err)); Hope this will help you.
557b4f94db5ba94a9be1b12c89f3f6b046f4c054270f890089b222ba5d5cb285
['18381c42b3484ad1a912a25e3be42c2b']
I am using 64 Bit Portable Perl Version - <IP_ADDRESS> and tried installing the module. Seems to work fine for me. Kindly try the following steps: After you install portable perl, you need to 1) change to to directory where you have installed it 2) run the portableshell.bat command. 3) Check and reconfirm if the right perl version is running. C:\Users\pmu>cd C:\myperl64_51822 C:\myperl64_51822>portableshell.bat ---------------------------------------------- Welcome to Strawberry Perl Portable Edition! * URL - http://www.strawberryperl.com/ * see README.TXT for more info ---------------------------------------------- Perl executable: C:\myperl64_51822\perl\bin\perl.exe Perl version : 5.18.2 / MSWin32-x64-multi-thread C:\myperl64_51822>perl --version | find /I "version" This is perl 5, version 18, subversion 2 (v5.18.2) built for MSWin32-x64-multi-thread 4) use the cpanm command instead of cpan. It works for me as shown below. C:\myperl64_51822>cpanm Text<IP_ADDRESS>CSV_XS --> Working on Text<IP_ADDRESS>CSV_XS Fetching http://www.cpan.org/authors/id/H/HM/HMBRAND/Text-CSV_XS-1.05.tgz ... OK Configuring Text-CSV_XS-1.05 ... OK Building and testing Text-CSV_XS-1.05 ... OK Successfully installed Text-CSV_XS-1.05 1 distribution installed C:\myperl64_51822> Note - It took a long time to install the module. I hit Ctrl+C after a long time and the above message came up. Hope this helps.
46c258d8c8a2677430cc507e4670076c196723791200cf10d44832628150dd35
['18381c42b3484ad1a912a25e3be42c2b']
Have you installed 64 Bit Python? If so, you might face such issues. I had faced similar issues so, I removed 64 Bit Python and installed 32 Bit python and it worked. On the other hand, if you have to absolutely work with 64 Bit Python, try using a 64 Bit Vim Version - You can try out this link. http://solar-blogg.blogspot.com.au/p/vim-build.html
f7efa9a25af13d6fc5ee414d7cb4312085a5d0f5672d8991545d52bb2339ad65
['183a025fa36d4c0baac1035fd484ef81']
I also needed to pull the last event from the vmware.log file in order to backtrack the power off time for VMs where there is no vCenter event history. I looked at file timestamps but found that some VM processes and possibly backup solutions can make them useless. I tried reading the file in place but ran into issues with the PSDrive type not supporting Get-Content in place. So for better or worse for my solution I started with one of LucD's scripts - the 'Retrieve the logs' script from http://www.lucd.info/2011/02/27/virtual-machine-logging/ which pulls a VMs vmware.log file and copies it to local storage. I then modified it to copy the vmware.log file to a local temp folder, read the last line from the file before deleting the file and return the last line of the log as a PS object. Note, this is slow and I'm sure my hacks to LucD's script are not elegant, but it does work and I hope if helps someone. Note: This converts the time value from the log to a PS date object by simple piping the string timestamp from the file into Get-Date. I've read that this does not work as expected for non-US date formatting. For those outside of the US you might want to look into this or just pass the raw timestamp string from the log instead of converting it. #Examples: #$lastEventTime = (Get-VM -Name "SomeVM" | Get-VMLogLastEvent).EventTime #$lastEventTime = Get-VMLogLastEvent -VM "SomeVM" -Path "C:\alternatetemp\" function Get-VMLogLastEvent{ param( [parameter(Mandatory=$true,ValueFromPipeline=$true)][PSObject[]]$VM, [string]$Path=$env:TEMP ) process{ $report = @() foreach($obj in $VM){ if($obj.GetType().Name -eq "string"){ $obj = Get-VM -Name $obj } $logpath = ($obj.ExtensionData.LayoutEx.File | ?{$_.Name -like "*/vmware.log"}).Name $dsName = $logPath.Split(']')[0].Trim('[') $vmPath = $logPath.Split(']')[1].Trim(' ') $ds = Get-Datastore -Name $dsName $drvName = "MyDS" + (Get-Random) $localLog = $Path + "\" + $obj.Name + ".vmware.log" New-PSDrive -Location $ds -Name $drvName -PSProvider VimDatastore -Root '\' | Out-Null Copy-DatastoreItem -Item ($drvName + ":" + $vmPath) -Destination $localLog -Force:$true Remove-PSDrive -Name $drvName -Confirm:$false $lastEvent = Get-Content -Path $localLog -Tail 1 Remove-Item -Path $localLog -Confirm:$false $row = "" | Select VM, EventType, Event, EventTime $row.VM = $obj.Name ($row.EventTime, $row.EventType, $row.Event) = $lastEvent.Split("|") $row.EventTime = $row.EventTime | Get-Date $report += $row } $report } } That should cover your request, but to expound further on why I needed the detail, which reading between the lines may also benefit you, I'll continue. I inherited hundreds of legacy VMs that have been powered off from various past acquisitions and divestitures and many of which have been moved between vCenter instances losing all event log detail. When I started my cleanup effort in just one datacenter I had over 60TB of powered off VMs. With the legacy nature of these there was also no detail available on who owned or had any knowledge of these old VMs. For this I hacked another script I found, also from LucD here: https://communities.vmware.com/thread/540397. This will take in all the powered off VMs, attempt to determine the time powered off via vCenter event history. I modified it to fall back to the above Get-VMLogLastEvent function to get the final poweroff time of the VM if event log detail is not available. Error catching could be improved - this will error on VMs where for one reason or another there is no vmware.log file. But quick and dirty I've found this to work and provides the detail on what I need for over 90%. Again this relies on the above function and for me at least the errors just fail through passing through null values. One could probably remove the errors by adding a check for vmware.log existance before attempting to copy it though this would add a touch more latency in execution due to the slow PSDrive interface to datastores. $Report = @() $VMs = Get-VM | Where {$_.PowerState -eq "PoweredOff"} $Datastores = Get-Datastore | Select Name, Id $PowerOffEvents = Get-VIEvent -Entity $VMs -MaxSamples ([int]::MaxValue) | where {$_ -is [VMware.Vim.VmPoweredOffEvent]} | Group-Object -Property {$_.Vm.Name} foreach ($VM in $VMs) { $lastPO = ($PowerOffEvents | Where { $_.Group[0].Vm.Vm -eq $VM.Id }).Group | Sort-Object -Property CreatedTime -Descending | Select -First 1 $lastLogTime = ""; # If no event log detail, revert to vmware.log last entry which takes more time... if (($lastPO.PoweredOffTime -eq "") -or ($lastPO.PoweredOffTime -eq $null)){ $lastLogTime = (Get-VMLogLastEvent -VM $VM).EventTime } $row = "" | select VMName,Powerstate,OS,Host,Cluster,Datastore,NumCPU,MemMb,DiskGb,PoweredOffTime,PoweredOffBy,LastLogTime $row.VMName = $vm.Name $row.Powerstate = $vm.Powerstate $row.OS = $vm.Guest.OSFullName $row.Host = $vm.VMHost.name $row.Cluster = $vm.VMHost.Parent.Name $row.Datastore = $Datastores | Where{$_.Id -eq ($vm.DatastoreIdList | select -First 1)} | Select -ExpandProperty Name $row.NumCPU = $vm.NumCPU $row.MemMb = $vm.MemoryMB $row.DiskGb = Get-HardDisk -VM $vm | Measure-Object -Property CapacityGB -Sum | select -ExpandProperty Sum $row.PoweredOffTime = $lastPO.CreatedTime $row.PoweredOffBy = $lastPO.UserName $row.LastLogTime = $lastLogTime $report += $row } # Output to screen $report | Sort Cluster, Host, VMName | Select VMName, Cluster, Host, NumCPU, MemMb, @{N='DiskGb';E={[math]::Round($_.DiskGb,2)}}, PoweredOffTime, PoweredOffBy | ft -a # Output to CSV - change path/filename as appropriate $report | Sort Cluster, Host, VMName | Export-Csv -Path "output\Powered_Off_VMs_Report.csv" -NoTypeInformation -UseCulture Cheers! I pray this pays back some of the karma I've used. <PERSON><IP_ADDRESS>MaxValue) | where {$_ -is [VMware.Vim.VmPoweredOffEvent]} | Group-Object -Property {$_.Vm.Name} foreach ($VM in $VMs) { $lastPO = ($PowerOffEvents | Where { $_.Group[0].Vm.Vm -eq $VM.Id }).Group | Sort-Object -Property CreatedTime -Descending | Select -First 1 $lastLogTime = ""; # If no event log detail, revert to vmware.log last entry which takes more time... if (($lastPO.PoweredOffTime -eq "") -or ($lastPO.PoweredOffTime -eq $null)){ $lastLogTime = (Get-VMLogLastEvent -VM $VM).EventTime } $row = "" | select VMName,Powerstate,OS,Host,Cluster,Datastore,NumCPU,MemMb,DiskGb,PoweredOffTime,PoweredOffBy,LastLogTime $row.VMName = $vm.Name $row.Powerstate = $vm.Powerstate $row.OS = $vm.Guest.OSFullName $row.Host = $vm.VMHost.name $row.Cluster = $vm.VMHost.Parent.Name $row.Datastore = $Datastores | Where{$_.Id -eq ($vm.DatastoreIdList | select -First 1)} | Select -ExpandProperty Name $row.NumCPU = $vm.NumCPU $row.MemMb = $vm.MemoryMB $row.DiskGb = Get-HardDisk -VM $vm | Measure-Object -Property CapacityGB -Sum | select -ExpandProperty Sum $row.PoweredOffTime = $lastPO.CreatedTime $row.PoweredOffBy = $lastPO.UserName $row.LastLogTime = $lastLogTime $report += $row } # Output to screen $report | Sort Cluster, Host, VMName | Select VMName, Cluster, Host, NumCPU, MemMb, @{N='DiskGb';E={[math]<IP_ADDRESS>Round($_.DiskGb,2)}}, PoweredOffTime, PoweredOffBy | ft -a # Output to CSV - change path/filename as appropriate $report | Sort Cluster, Host, VMName | Export-Csv -Path "output\Powered_Off_VMs_Report.csv" -NoTypeInformation -UseCulture Cheers! I pray this pays back some of the karma I've used. Meyeaard
5bfbb3fe5959b3d8249643cb45b210df37b8b247cca31aab4da058ac45ef73d8
['183a025fa36d4c0baac1035fd484ef81']
<PERSON>, thank you for your solution. I expanded on the example you provided and wanted to give that back to the community. The use case is a bit different here - I have a loop checking if an array of VMs can be migrated and if there are any failures to that check the operator can either remediate those until the checks clear or they can opt to "GO" and have those failing VMs excluded from the operation. If something other than GO is typed state remains within the loop. One downside to this is if the operator inadvertently presses a key the script will be blocked by Read-Host and may not be immediately noticed. If that's a problem for anyone I'm sure they can hack around that ;-) Write-Host "Verifying all VMs have RelocateVM_Task enabled..." Do { $vms_pivoting = $ph_vms | Where-Object{'RelocateVM_Task' -in $_.ExtensionData.DisabledMethod} if ($vms_pivoting){ Write-Host -ForegroundColor:Red ("Some VMs in phase have method RelocateVM_Task disabled.") $vms_pivoting | Select-Object Name, PowerState | Format-Table -AutoSize Write-Host -ForegroundColor:Yellow "Waiting until this is resolved -or- type GO to continue without these VMs:" -NoNewline $secs = 0 While ((-not $Host.UI.RawUI.KeyAvailable) -and ($secs -lt 15)){ Start-Sleep -Seconds 1 $secs++ } if ($Host.UI.RawUI.KeyAvailable){ $input = Read-Host Write-Host "" if ($input -eq 'GO'){ Write-Host -ForegroundColor:Yellow "NOTICE: User prompted to continue migration without the blocked VM(s)" Write-Host -ForegroundColor:Yellow "Removing the following VMs from the migration list" $ph_vms = $ph_vms | ?{$_ -notin $vms_pivoting} | Sort-Object -Property Name } } } else { Write-Host -ForegroundColor:Green "Verified all VMs have RelocateVM_Task method enabled." } } Until(($vms_pivoting).Count -eq 0)
20e6ac1201a41230785f61ba94040a6366e2401f810b81980b2f427b6454830a
['183eaee717344356a2a9a49fc2c3c184']
I want to generate a large number of random numbers (uniformly distributed on the interval [0,1]). Currently the generation of these random numbers is causing my program to run quite slowly, however the program only needs them to be calculated to around 5 decimal places. I'm not entirely sure of how MATLAB generates random numbers, but if there is a way of only calculating them to 5 decimal places then it will (hopefully greatly) speed up my program. Is there a way of doing such a thing? Thanks very much.
2e2e4dc57a172a62c60ed03f650ff62ae0948f47f6803f1b92c944e48efb9afb
['183eaee717344356a2a9a49fc2c3c184']
There are two reasons you are getting different answers Fist, there is an issue of numerical instability. Take a look at the values in the inverses - they are very large. This means that the original matrix you are trying to invert has at least one singular value that is very small, meaning that the matrix is difficult to invert. Secondly, you're trying to invert a non-square matrix. Matrix inverses are actually only unique in the case of square matrices. For non-square matrices, officially matrix inverses don't exists. Instead, the functions you are calling will be finding the left- or right-inverses, but these are in general not unique, and so two different but completely valid implementations of algorithms to find these inverses may give different answers.
1408f66e540d649f7aaadb9e8ea72f38a121ec4a4de508fa94caaaf7a5efacf6
['18404b875582458ca3fb6ec34fb8e1cb']
As always, it depends If the object you are passing as a parameter (the “options” object) is commonly used across the application, possibly being used to call different functions, the unstructured approach can be useful. However, if you need to create a specific object to call each of the “doLotsOfThings” functions, it probably isn't worth it and just using old-school parameters could be better.
3b4e4c1f56f978dc36447d1b9e6c557ebec083c7a300deb9ab8a8ae17b7c0f23
['18404b875582458ca3fb6ec34fb8e1cb']
I suspect your grub config got removed or corrupted somewhere along the way. Here is a helpful manual Basically look to see if GRUB_DEFAULT is set correctly. The --id here is example-gnu-linux. menuentry 'Example GNU/Linux distribution' --class gnu-linux --id example-gnu-linux { ... } then you can make this the default using: GRUB_DEFAULT=example-gnu-linux
bbf5f10fb55a6059dc49ceba6891269a81193ea4ea8851c8dc33b48fc56183ad
['184d451ea250477496131be806b4bc6d']
I've installed pygame using the command pip install pygame. When I enter my python console and so import pygame it gives me ImportError: No module named pygame and then tried installing with sudo apt install python-pygame but I am still facing the same issue. I finally resulted to cloning from https://bitbucket.org/pygame/pygame and build then installing and I'm still getting the import error. Is there any other way available that i could install pygame?
9ebc8f9cb80f0c3d5ab6fbb50dd92fbc03c07f0231ddbccfe3d6ce01c186fe7f
['184d451ea250477496131be806b4bc6d']
I have a python code like so wallpaper/ setup.py wallpaper/ __init__.py environments.py run.py The run.py has a function like so: import environments def main(): .. do something() if __name__=='__main__': main() After installing this package how do I execute the run.py script on my terminal. I realize this question has been asked before but I wasn't satisfied with that answer as it did not offer me any insight.
cdc280ac65ef5efc0e2d16aaab704796ab85a5e1b90a2b5bc67b2034cd7d68d7
['1852127a8a684ac880322f9d559a55d4']
Such behavior could be explained if the HTTP Client you use opens persistent connections to the server, and the server occasionally terminates them. Normally, the connection to an HTTP server is closed after each response. With HTTP "keep-alive" you keep the underlying TCP connection open until certain criteria are met. What those conditions are depends on the server, which is free to close the connection after an arbitrary timeout or number of requests (just as long as it returns the response to the current request). When the server closes such a connection the client usually reopens it again, and depending on implementation, may throw an exception or print a warning.
4c92881ea0b06f57e0855afeae95867714b471ae270460c6814ab46b8edcd6ce
['1852127a8a684ac880322f9d559a55d4']
I have a requirement to identify two patterns in a String, and if exists, i need to remove the substrings. Currently my code is below where I'm removing the substrings in two steps. I want to create a single Regex to identify "A," or "S," if exists, to replace with empty string. My code: if (charCode === characteristicsCode.SERIAL_NUMBER) { charValue = charValue.replace(/[(A,)]/g, ''); charValue = charValue.replace(/[(S,)]/g, ''); }
251cd3a66b36393c66816b6c656ec914f53d49120f76bda863272036f54251aa
['18575e04782a4b3c92a4821780f627dd']
It certainly does not have topspin at any point. The first reason is correct. It has less backspin and therefore appears to drop. The camera angle from behind the pitcher is deceiving. Although it appears to drop off suddenly, it is more gradual than it appears. A straight fastball defies gravity quite a bit, as does a split fingered fastball, because they both have backspin. The splitter just does not defy gravity nearly as much. The best splitters have relatively high velocity to mimic a fastball, but reduced backspin to get the “drop” action.
3e3a29462f76cd837588ea2f0ae648c81a4a85dca1ddc03b7fa737e077d9a9f9
['18575e04782a4b3c92a4821780f627dd']
I am reading The C Programming Language (2nd Edition). On page 157 and 158 the author gives a code snippet of fopen in the Unix system. At the end of the snippet the author added: In particular, our fopen does not recognize the "b" that signals binary access, since that is meaningless on UNIX systems, nor the "+" that permits both reading and writing. Why does the author say it's meaningless? (The "b" and "+" mentioned here are file access modes)
61960cb051ff4f826432a097283a0177759cc953511b7ffa18d4732adf45720c
['18608b441bb74f098bdc4105bda315fa']
I'm trying to send the file, user_id, email and Bearer access_token in my POST request but for some reason - I'm getting a 200 but the aforementioned data isn't being stored in the database. In Postman, all works fine though. Here's the response in the axios.post(..) console.log(response) line. You could see that the data: {} is empty. But why? {data: {…}, status: 200, statusText: "OK", headers: {…}, config: {…}, …} config: {url: "http://myendpoint/api/auth/wall-of-fame", method: "post", data: FormData, headers: {…}, transformRequest: Array(1), …} data: {} headers: {cache-control: "no-cache, private", content-type: "application/json"} request: XMLHttpRequest {readyState: 4, timeout: 0, withCredentials: false, upload: XMLHttpRequestUpload, onreadystatechange: ƒ, …} status: 200 statusText: "OK" __proto__: Object What could be problem? I have a Laravel and a React.js codebase that are completely separate projects. Frontend code: import React, {Component} from 'react'; import axios from 'axios'; class Upload extends Component { constructor(props) { super(props); this.state = { selectedFile: null, id: null, email: '' }; this.onFormSubmit = this.onFormSubmit.bind(this); this.onChange = this.onChange.bind(this); this.fileUpload = this.fileUpload.bind(this); } componentDidMount() { console.log("Inside componentDidMount()"); let id = localStorage.getItem("id"); let email = localStorage.getItem("email"); this.setState({ id: id, email: email }) console.log(id); console.log(email); } onFormSubmit(e) { e.preventDefault(); this.fileUpload(this.state.selectedFile); } onChange(e) { this.setState({ selectedFile: e.target.files[0] }, () => this.state.selectedFile); } fileUpload(file) { const formData = new FormData(); const accessToken = localStorage.getItem("access_token").slice(13,-8); console.log(accessToken); console.log(this.state.id); console.log(this.state.email); console.log(file.name); formData.append('file',file.name); formData.append('user_id', this.state.id); formData.append('email', this.state.email); const headers = { 'Authorization' : 'Bearer ' + accessToken, // 'Access-Control-Allow-Origin' : "*" } axios.post('http://myendpoint/api/auth/wall-of-fame', formData, {headers}) .then(response => { console.log(response); }).catch(error => { console.log(error); }) } render() { return ( <form encType='multipart/form-data' id="login-form" className="form" onSubmit={this.onFormSubmit}> <input type="file" name="file" onChange={this.onChange}/> <button type="submit">Upload</button> </form> ); } } export default Upload; Here's my controller code: <?php namespace App\Http\Controllers; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\DB; class FileUploadController extends Controller { public function store(Request $request) { $user = Auth<IP_ADDRESS>user(); // dd($user); if($user) { $user_id = Auth<IP_ADDRESS>user()->id; $email = Auth<IP_ADDRESS>user()->email; $filePath = $request->file('file')->getClientOriginalName(); $data = [ 'file_path' => $filePath, 'user_id' => $user_id, 'email' => $email ]; <IP_ADDRESS>table('mydb.photos')->insert($data); } return response()->json($user); } }
f6d24d4a603fea4134cf45248c17ffb68345c0897e4b636d6553d9df6def4822
['18608b441bb74f098bdc4105bda315fa']
I have a Wall component where the user gets redirected from the Login component upon successful authentication. Inside the Wall component, I'm calling name which's the user's name they've registered with. All I'm doing here is greeting the user per the code. The user's name comes through successfully. However, when I refresh the page - I get TypeError: Cannot read property 'name' of undefined error but how's that so when the name's being displaying on the browser? Is this issue persisting because it's inside componentDidMount()? That's my only suspicion but I could be wrong. What am I doing wrong here and how can I fix this in a way where whenever the user logs in successfully and refreshes the page, it persists with no issues? import React, {Component} from 'react' class Wall extends Component { constructor(props) { super(props); console.log(this.props.location.state.name); this.state = { name: '' }; } componentDidMount() { this.setState({name: this.props.location.state.name}) } render() { return ( <div> <h1>Hello, {this.state.name}!</h1> </div> ); } } export default Wall;
344beee3fc9eb4afc13d51270b317f5d632087f988545a746d60747ba14ed980
['186c962ebbbe4eb6817a4bd90e82ba21']
I want to split upp my agent nodes in multiple zones depending on HW the agent nodes is running on. How do i add Zones in the setup configuration when installing? And can a agent node be in multiple zones at the same time? both zone a and b or just one? Mesos install page 1.9: All agents within a zone should be tagged with an attribute (e.g., zone:us-east-1a ) current config: --- agent_list: - <IP_ADDRESS> - <IP_ADDRESS> - <IP_ADDRESS> bootstrap_url: file:///opt/dcos_install_tmp cluster_name: DC/OS exhibitor_storage_backend: static ip_detect_path: genconf/ip-detect master_discovery: static master_list: - <IP_ADDRESS> process_timeout: 10000 public_agent_list: - <IP_ADDRESS> resolvers: - <IP_ADDRESS> - <IP_ADDRESS> ssh_key_path: genconf/ssh_key ssh_port: 22 ssh_user: centos
446f45b14e6a0398888c8ad15db18fd997e04ca6b1f3e41623e360167da72f51
['186c962ebbbe4eb6817a4bd90e82ba21']
I have a problem where we are trying to run several services on our mesos dcos cluster and some are running spark process and some python services. So in our small test mesos dcos cluster we reach 70% cpus resources used multiple times per day. And services people want to start just get hanging waiting for cpu offers that can be well met on slave nodes but for some reson are not allowed to be allocated. A typical example would be 7 total cpus unused and 1-3 services looking for cpu offers of 0.5 to 2 cpu resources to use. that can be met. if looking on the node resource over view. To my question are there a hard limit not allowing more then 70% of the cpus to be allocated at the same time? And are there a reson for this limit what would be the effect of changing this to a higher value? And last who do we change the limit?
426acee77a31c5d59867b2068f253dc1fd77d4f1290fe5f95a08e11de3a2fb2b
['1895f08a75304ac2994e4d93bb1b20ec']
I have a question about AsyncStorage.. console.log(this.state.UserEmail); AsyncStorage.setItem('email', JSON.stringify(this.state.UserEmail)); the console log logs the user's email perfectly fine, but for some reason when i try to do AsyncStorage.getItem("email").then((res) => { this.setState({username: res })}); It seems that the AsyncStorage with the item name of "email" is empty.as it does not return anything if i console.log this.state.username. Thanks in advance, <PERSON>
1e150ffa614e0360bdb24481f4799914d10ea6bddea055695b3405b757e88ce2
['1895f08a75304ac2994e4d93bb1b20ec']
I'm trying to redirect the login to another page. Right now it's redirecting to '/' even though in the login controller it says '/welcome'. (Using default authentication of laravel). It looks like it completely ignores the login controller. LoginController.php <?php namespace App\Http\Controllers\Auth; use App\Http\Controllers\Controller; use Illuminate\Foundation\Auth\AuthenticatesUsers; class LoginController extends Controller { /* |-------------------------------------------------------------------------- | Login Controller |-------------------------------------------------------------------------- | | This controller handles authenticating users for the application and | redirecting them to your home screen. The controller uses a trait | to conveniently provide its functionality to your applications. | */ use AuthenticatesUsers; /** * Where to redirect users after login. * * @var string */ protected $redirectTo = '/welcome'; /** * Create a new controller instance. * * @return void */ public function __construct() { $this->middleware('guest', ['except' => 'logout']); } } As it seems like it's completely ignoring the login controller, i'm confused on how it's even possible to login.
75bcc919fbec11e05f6f63120fc250963fd37c006bc22088443567803f180331
['18a287d2025541c990cc580ebdef6300']
Props are used to pass data down in the component hierarchy. If you want to get data from an API and pass it to several components I would suggest getting the list of Localite's in a parent component and then pass it via props. A rule of thumb is to have more logic in parent components and less logic in child components. Example: <template> <div> <localite :localite="listOfLocalites" /> </div> </template> Then you can in your localite component get the the prop via props: ["localite"]
f3e46249c6197a17a10ca9c538ac3d6ed1e79baccd350702e2b30f10c45ef051
['18a287d2025541c990cc580ebdef6300']
I can't write regex so I really need your help trying to match the requirements. I have been so close but it always fail on small things. This was the latest regex i tried: /^\\{2}[-\w]+\\(([^"*/:?|<>\\,;[\]+=.\x00-\x20]|\.[.\x20]*[^"*/:?|<>\\,;[\]+=.\x00-\x20])([^"*/:?|<>\\,;[\]+=\x00-\x1F]*[^"*/:?|<>\\,;[\]+=\x00-\x20])?)\\([^"*/:?|<>\\.\x00-\x20]([^"*/:?|<>\\\x00-\x1F]*[^"*/:?|<>\\.\x00-\x20])?\\)*$/ But it ended up with not allowing me to put dots in server name. I need this to be accepted: \\servername.withdot\alowing spaces\<IP_ADDRESS>\under_scores\andNotEndWithBackslash I will take any help I can get, Thanks
3834d76aaee8d67c4616962275c9da39651b6f1f83aabdc04388c9687f31201e
['18a8e327abc542eb9ac197b3dc583293']
I am building an ASP.NET Web Forms web site using .NET 4.5. The error ... The type 'System.ComponentModel.DataAnnotations.Schema.ForeignKeyAttribute' exists in both 'f:\Projects\web sites\RC1Iteration05\packages\EntityFramework.5.0.0\lib\net40\EntityFramework.dll' and 'c:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.ComponentModel.DataAnnotations.dll' I have tried to alias the libraries using ... csc /r:EF_DataAnnotations="f:\Projects\web sites\RC1Iteration05\packages\EntityFramework.5.0.0\lib\net40\EntityFramework.dll" /r:CM_DataAnnotations="c:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.ComponentModel.DataAnnotations.dll" but this only resulted in "No Source File specified" which is equally confusing since the source files were specified as directed (here & here). I did notice that the error was referencing the EF dll in the net40 folder rather than the net45 folder. I figure if I used the net45 version the problem would resolve itself, however I do not know how to change that reference. I changed the "targetFramework" attribute to the EntityFramework package in the packages.config file, but that did not make any difference. I am a bit stuck since both of the solutions did not seem to do anything. I looked around and found a number of posts here where folks have dealt with similar issues but have received no responses. I am hoping that there is someone out there who can help! Thanks <PERSON>
623233eead7323fb37cdc230e105c3111015165d3369e3f27fab28eaf77b0b15
['18a8e327abc542eb9ac197b3dc583293']
I am trying to prevent a record from being inserted when two fields are not defined. If either one is defined but not the other than that is acceptable, BOTH cannot be left NULL however. I am using the following CONSTRAINT ... CONSTRAINT [CK_person_institution] CHECK (person_id IS NOT NULL AND institution_id IS NOT NULL) This constraint prevents me from inserting a record if EITHER field is left undefined (NULL).
2cfc65aa99874c2e4ae124af78aaa605915fa504e7fac518458c9990a61033be
['18c2e3fabb974df2b0684e0ad24107a5']
I'm developing an application using phonegap, my app, capture an image from camera or gallery, i move to a specific folder and after that i want to upload it to a server. I upload some data too from a form. My problem is that everything works if i use an image from the gallery but it doesn't work if i capture it from camera. Here is my code js. var pictureSource; // picture source var destinationType; // sets the format of returned value document.addEventListener("deviceready",onDeviceReady,false); function onDeviceReady() { pictureSource=navigator.camera.PictureSourceType; destinationType=navigator.camera.DestinationType; } function onPhotoDataSuccess(imageURI) { var Image = document.getElementById('Image'); var form = document.getElementById('up'); var b1 = document.getElementById('b1'); var b2 = document.getElementById('b2'); Image.style.display = 'block'; form.style.display = 'block'; b1.style.display = 'none'; b2.style.display = 'none'; Image.src = imageURI; movePic(imageURI); } function capturePhoto() { // Take picture using device camera and retrieve image navigator.camera.getPicture(onPhotoDataSuccess, onFail, { quality: 50, destinationType: destinationType.FILE_URI, }); } function getPhoto(source) { navigator.camera.getPicture(onPhotoDataSuccess, onFail, { quality: 50, destinationType: destinationType.FILE_URI, sourceType: source }); } function onFail(message) { alert('Failed because: ' + message); } /*****************save*****************/ function movePic(file){ window.resolveLocalFileSystemURI(file, resolveOnSuccess, resOnError); } //Callback function when the file system uri has been resolved function resolveOnSuccess(entry){ var d = new Date(); var n = d.getTime(); var newFileName = n + ".jpg"; var myFolderApp = "folder"; window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, function(fileSys) { //creo la cartella geofolder <PERSON> foto scattate fileSys.root.getDirectory(myFolderApp, {create:true, exclusive: false}, function(myFolderApp) { entry.moveTo(myFolderApp, newFileName, successMove, resOnError); document.forms['up'].foto.value = newFileName; }, resOnError); }, resOnError); return newFileName; } //Callback function when the file has been moved successfully function successMove(entry) { //Store imagepath in session for future use // like to store it in database sessionStorage.setItem('imagepath', entry.fullPath); } function resOnError() { alert(error.code); } ////upload/// $("#upload").click(function(){ //some variable uploadimage(foto); $.ajax({ type: "POST", url: "http://x.org/upload.php", data: {//some data from the form}, success: function(responce){ if(responce=='success') { alert('ok'); } else { alert("errore"); } } }); return false;}); function uploadimage(foto) { var Image = document.getElementById('Image').getAttribute("src"); var options = new FileUploadOptions(); options.fileKey="file"; options.fileName=foto; options.mimeType="image/jpeg"; var params = new Object(); params.nome = "test"; options.params = params; options.chunkedMode = false; var ft = new FileTransfer(); ft.upload(Image, "http://x.org/uploadphoto.php", win, fail, options); } function win() { alert("ok bro"); } function fail() { alert("not bro"); }
6f268ce2c4476b772e0ad26ef2c493e9503f49daa951139d0e1e86fc494f6e53
['18c2e3fabb974df2b0684e0ad24107a5']
Apparently I manage to solve it, I modified the function that extract the frame. void estraiframe(string path, string vidName, string output){ string vidPath(path + vidName); VideoCapture cap(vidPath); if( !cap.isOpened()){ cout << "Cannot open the video file" << endl; return; } double rate = cap.get(CV_CAP_PROP_FPS); int counter = 0; Mat frame; int i=1; while(1) { cap.read ( frame); if( frame.empty()) break; counter++; if (counter == rate*5*i){ i++; string nomeframe = to_string(counter) + "-frame_from"+vidName+".jpg"; string percorso (output+nomeframe); imwrite(percorso, frame); } char key = waitKey(10); if ( key == 27) break; } }
004eb26900b6a345d4e4316c80cfb7d27c6773347e6a2d6d4965d339cc7fe482
['18c654cb511042c38a3f13297e477d59']
The problem is that you are trying to take the image from a not secure website, so glide blocks you. To solve this issue you can create a custom trust manager but is very dangerous because you get exposed to man in the middle attack. If you want to follow this route i suggest you to read this Trust Anchor not found for Android SSL Connection Another work around solution, that i suggest could be download the image and host it on your server or on a free service (you can found a lot of them) like https://imgur.com/upload or everyone else
0f17aeeb3ca5970e9bf81310c8c0bd2773a951b449d581b9ab38af318433bb09
['18c654cb511042c38a3f13297e477d59']
Unfortunately you cannot modify QML checkbox by accessing the property but here there are 2 possibles solutions -1 you can work via stylesheet like that: @QCheckBox<IP_ADDRESS>indicator{ background-color: #0000FF; } @ -2 you can copy the qml implementation of the checkbox and change de property like here ApplicationWindow { id: window title: "Stack" visible: true width: 300 CheckBox { id: control indicator: Rectangle { implicitWidth: 28 implicitHeight: 28 x: control.mirrored ? control.leftPadding : control.width - width - control.rightPadding y: control.topPadding + (control.availableHeight - height) / 2 color: control.down ? control.palette.light : control.palette.base border.width: control.visualFocus ? 2 : 1 border.color: control.visualFocus ? control.palette.highlight : control.palette.mid ColorImage { x: (parent.width - width) / 2 y: (parent.height - height) / 2 defaultColor: "#<PHONE_NUMBER>" color: "blue" // you can add your color here source: "qrc:/qt-project.org/imports/QtQuick/Controls.2/images/check.png" visible: control.checkState === Qt.Checked } Rectangle { x: (parent.width - width) / 2 y: (parent.height - height) / 2 width: 16 height: 3 color: control.palette.text visible: control.checkState === Qt.PartiallyChecked } } } } hope it helps , bye
7e0bd8b94b561014598e678df3410ee52af975e531b1d0b342250d83b56e1b97
['18ca9b36fa214d1abd4e4ceec3200145']
Here is feed for commits made in jquery project. http://github.com/feeds/jquery/commits/jquery/master This feed does not contain all the changes made in the source code. It just contains the commit title. How do I get feed so that I could see the code diff in my feed reader rather than coming to github for each and every commit.
3a77cc39ace48e2645d471a4e2ebc5371c1e9e4a9cb64d9cc6cbe3b146a6da5b
['18ca9b36fa214d1abd4e4ceec3200145']
I am building a chat system using EventMachine and ruby on rails. It's for learning purpose. This is how client is connecting to server. c = TCPSocket.open(ip_address, port) data = {:user_id => 2, :message => 'hello world'} c.send(data) response = c.gets c.close It works. However the problem is that I can't get the list of people who are currently chatting in the room because as I shown above, client is constantly opening and closing the connection. An alternative plan is to run an EventMachine client for each connected user. I am planning to store the client connection in session for each user. In this way I will be using the same question for each user. When the user logs out then I will close the connection. However if the user walks out then how do I self close the client connection. Any thoughts.
d4cc6804732cafd0025ddfc4fa76f21387a4404880a6ffded4ae243afc61363d
['18e05e799794466db5917ba7fe454631']
@user253751 I don't quite have a schematic for this; just been prototyping on a breadboard. The 5V line from the console goes into the VIN pin on the microcontroller, with a diode so the battery won't backpower the console. The 5V from the charge circuit goes into the VIN pin of the microcontroller as well. Nothing else is currently attached, save for ground pins.
aa3dc260dc52bb9d5d8ece2ab3f895b3958debb9f83fb1ca487d716a2dc84c27
['18e05e799794466db5917ba7fe454631']
Both the console voltage and the battery are 5V, not two separate voltages. The console voltage is only there to power the microcontroller long enough to wake up the battery. But I'm looking for an answer to the question of if the project will use the battery more than the console, thus not burning up the console.
a3c68c155f30abdfdda5e8ad3394e380773e506ccf24a272d40faf0dbbe01bbd
['19080a689457407c895cce113e80f920']
As you didn't tell more about the circuit . That must be a noise problem mostly could be a ripple problem you have to stop ripples from being amplified by choosing the right capacitor values . <IP_ADDRESS>.2 Adjust Terminal Bypass Capacitor The adjust terminal can be bypassed to ground with a bypass capacitor (CADJ) to improve ripple rejection. This bypass capacitor prevents ripple from being amplified as the output voltage is increased. At any ripple frequency, the impedance of the CADJ should be less than R1 to prevent the ripple from being amplified: 1/(2π × fRIPPLE × CADJ) < R1 (1) The R1 is the resistor between the output and the adjust pin. Its value is normally in the range of 100-200Ω. For example, with R1 = 124Ω and fRIPPLE = 120Hz, the CADJ should be > 11µF. source : Data sheet You could watch video about how ripples can affect the output here
03cdceda41f42bc45faf538bc4b5c2d94e634e49c4acc13640961b0c6847227f
['19080a689457407c895cce113e80f920']
So it doesn't matter at all what the shape of the pipe is, it just matters what the cross section of the exit is? Something about that just doesn't seem right. Air might not compress easily, but it swirls around and creates eddies when it moves and creates lower pressure as it moves faster, and if it's not compressible that means the backed up portion is going to push away from itself a lot more quickly when it does become compressed into a smaller exit.
c345683df82661197321a0599533501b1c5ac15e66d8e34e7369961300c816cf
['190c2da543334e25be39a2d32f4635d4']
Another possibility, e.g. if You don't have an empty hold register, could be: sed '/pattern/{p;s/.*//}' file Explanation: /pattern/{...} = apply sequence of commands, if line with pattern found, p = print the current line, ; = separator between commands, s/.*// = replace anything with nothing in the pattern register, then automatically print the empty pattern register as additional line)
2c9b036be2aede0884cea5f3b25d937a17923e8e9cadc5b9f22e8d1d8a9663af
['190c2da543334e25be39a2d32f4635d4']
For the following intended mysql/mariadb query: SELECT * FROM aktfv f LEFT JOIN (SELECT * FROM ( SELECT * FROM labor1a WHERE pat_id = f.pat_id UNION SELECT * FROM labor2a WHERE pat_id = f.pat_id) i ) i ON i.pat_id = f.pat_id; I get error 1054: Unknown column 'f.pat_id' in 'where clause', apparently because of the limitation to refer to an outer table parameter only over 1 level. I wanted to apply the 'where' clause because otherwise the 'union select' takes very very long. Can anybody give me a hint for a workaround?
f7b93a66fbef0f4de03ebf389fcd616ae4939f68cf990001f085f372829950aa
['190c7f3623274f0fb392bfc0d419e158']
So, I would be able to say, in theory, that if I arrived at a density function of the form of f(y) above, then I arrived at the density for an inverted Gamma distribution and could conclude that the integral of that function over its support is 1 since it is a valid pdf?
f2c04593c5e3fba7bcdc8e35af9532d7f4410153b3138d712647d5685d4b42ac
['190c7f3623274f0fb392bfc0d419e158']
The property is readable and writable by default, meaning it can be changed anywhere, which is dangerous for the property being used. So modify the property to read-only, but sometimes you need to update the property value, this time I want to provide an updated method. This seems to be the same as the default readable and writable, I also feel a bit strange
953f13f36b87e54030e779eed33ac32db35809b5875f62a586163f7e5dc7b639
['19123d78b2e94961be3b0a0db08df067']
I have this pretty simple C# code: static void Main(string[] args) { int i, pcm, maxm = 0; for (i = 1; i <= 3; i++) { Console.WriteLine("Please enter your computer marks"); pcm = int.Parse(Console.ReadLine()); } Console.ReadKey(); } I would like to get max value for the var pcm, how could I do it?
4b74bc6c5b3b7a7ce59819788132ebb287fb5ffe99a2176c3f5999523670c375
['19123d78b2e94961be3b0a0db08df067']
I have this very simple slideshow here: http://jsfiddle.net/Jtec5/ Here's the codes: HTML: <div id="slideshow"> <div> <img src="http://farm6.static.flickr.com/5224/5658667829_2bb7d42a9c_m.jpg"> </div> <div> <img src="http://farm6.static.flickr.com/5230/<PHONE_NUMBER>_a791e4f819_m.jpg"> </div> <div> <img src="http://gillespaquette.ca/images/stack-icon.png"> </div> </div> CSS: #slideshow { margin: 50px auto; position: relative; width: 240px; height: 240px; padding: 10px; box-shadow: 0 0 20px rgba(0,0,0,0.4); } #slideshow > div { position: absolute; top: 10px; left: 10px; right: 10px; bottom: 10px; } Jquery: $("#slideshow > div:gt(0)").hide(); setInterval(function() { $('#slideshow > div:first') .fadeOut(1000) .next() .fadeIn(1000) .end() .appendTo('#slideshow'); }, 3000); You can see in the slideshow there's buttons that tells me in which photo I am, I'm trying to relate every button with its photo so when I click it it takes me to its photo, if changing the whole code of the button is needed it will be better because I didn't like my code, I think it's too long.
72ab382c11f66ae414a328162caa47e04dd79aa69e759bf63ed54c294f923a7a
['19245ada44794973818afbd396aa2516']
I like Cereal Killer's approach for its simplicity, but unfortunately it exhibits a problem for me. When the browser navigates to another route, it restarts the Ember application. As of Ember 2.6, the following simple approach does the trick: <span {{action 'closeNavigationMenu'}}> {{#link-to 'home' preventDefault=false}} Go Home {{/link-to}} </span> This achieves the following: navigates to route 'home' action 'closeNavigationMenu' is invoked on mouseover, browser displays link that will be followed (for SEO and better UX) browser navigation does not result in reboot of Ember app
19a17e7e6ee07de73c7d328e1f6c20b40bfb183f42c9bb6bdeb7e6c493bb333d
['19245ada44794973818afbd396aa2516']
This is an observation: I use the end 2016 Macbook pro (15 inch), and run Virtualbox on it. As guest system, I have Win 7 and Linux Mint. Both show poor performance, which seems to be related to the graphics. My observation: If I use an external screen (27 inch, resolution 2560 x 1440). The VBox guests are as smooth as you would expect. Even moving the VBox window from the Macbook screen to the external screen and back shows that on the external screen, it is fast immediately, on the built-in screen it is slow -- even for non fullscreen mode.
c891d8d4505b358bb9f0a834b5b76b4c7fa78986727528be8da4418a57ba2891
['1931711c47d5482c99351462b4745cbc']
In your fragment onCreate() method write setRetainInstance(true); In the Activity that creates the fragment you should do something like this @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); if (savedInstanceState == null) { // Display the fragment as the main content. getFragmentManager().beginTransaction() .replace(android.R.id.content, CameraFragment.newInstance()) .commit(); } } The android.R.id.content can be different in your case. This is where you want to load your fragment.
71c4bb47a86726c633bee464fcf71301adb4b00adfefa26a27c2514e08e105ce
['1931711c47d5482c99351462b4745cbc']
You can create a xml file in your drawable folder (with name selector_imageview for example) with the following content <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:drawable="@drawable/shirtactive" android:state_pressed="true" /> <item android:drawable="@drawable/shirtactive" android:state_selected="true" /> <item android:drawable="@drawable/shirt"/> </selector> And set in your ImageView <ImageView android:id="@+id/shirtImage" android:layout_width="75dp" android:layout_height="75dp" android:layout_alignParentLeft="true" android:layout_alignParentStart="true" android:layout_centerVertical="true" android:layout_gravity="center" android:layout_marginLeft="30dp" android:layout_marginStart="30dp" android:alpha="0.8" android:src="@drawable/selector_imageview" />
d8757319bdec72cf31926c9314f26b06110bfd6a46448c57fa7fe2453a75f882
['19413922a55a4be4884278cabe5cd874']
Libgdx, in my opinion, is the way to go. Even Cornell University use it for their game programming courses. See here for their advice on the matter http://www.cs.cornell.edu/courses/cs4152/2014sp/materials/android.php And, here is a link to get you going http://www.kilobolt.com/zombie-bird-tutorial-flappy-bird-remake.html It uses libgdx extensively.
7b37445875b86890376261f3d22010465f56f9e53416ac18b1929d3288c58cc4
['19413922a55a4be4884278cabe5cd874']
I have simple builder example to illustrate the question "How can I stop a builder parameter from being set twice?" SimpleVehicle kia = new SimpleVehicle.Builder().setPrice(100).setType("Kia").setPrice(120).build(); System.out.println(kia.toString()); The price has been set to 100 and then again to 120. Is it possible to prevent this? The print returns - SimpleVehicle{price=120, type='Kia'} which is what the builder was asked to do. The SimpleVehicle class is public class SimpleVehicle { private long price; private String type; private SimpleVehicle(Builder builder) { this.price = builder.price; this.type = builder.type; } @Override public String toString() { return "SimpleVehicle{" + "price=" + price + ", type='" + type + '\'' + '}'; } public static class Builder { private long price; private String type; public Builder(){ } public Builder setPrice(long value) { this.price = value; return this; } public Builder setType(String value) { this.type = value; return this; } public SimpleVehicle build() { return new SimpleVehicle(this); } } }
8cf7c566b2984a897a97a3f32dad89f8d0098bc4012f35f22dab7fed4fc45929
['194eae9cba1b48c4bab2d6e37d13edaa']
By using pheatmap function in pheatmap package, you can generate heatmap with clusters based on your dissimilarity matrix. Assuming data is your dataset and hclust.object is hclust object produced based on dissimilarity matrix; library(pheatmap) pheatmap(data, cluster_rows = hclust.object, cutree_rows = 4) should give you heatmap, which is clustered based on hclust object, which is generated by your dissimilarity matrix. You can also use other parameters in pheatmap function as you like. For further information, use ?pheatmap.
0e4dadd7e9c87714458a7d09ddef7f67369e2c9e848cf9740a31c906dc65d54c
['194eae9cba1b48c4bab2d6e37d13edaa']
First, generate a replica data frame of sdata to add additional column. new.sdata <- sdata new.sdata$category <- "Supplier" You can then use lapply and pmatch function: cdata$category <- lapply(cdata$LegDigitsDialed, function(x) new.sdata$category[pmatch(x, sdata$SavedPhone)]) cdata$su_name <- lapply(cdata$LegDigitsDialed, function(x) sdata$sushortname[pmatch(x, sdata$SavedPhone)]) cdata$category[is.na(cdata$category)] = "Customer" cdata$su_name[is.na(cdata$su_name)] = "Null" lapply is for iteration for all elements, while pmatch does partial matching. Please let me know the result.
0a4634fa743695e01897bad9ddbc35558c8cc9ec513f88a889caca86baa6e007
['196a31c68fa24dd284a40fed7901a69d']
I believe this is only my second post, so here it goes. I'm working on an HTML form that manages credit cards. The form has a javascript page that does all the validation and such for it when submitted. The zip code field on the Form has an onblur action that queries a database for the zip code to populate the city/country fields. In the database, there can be more than one location set up for a zip code, in which a floating div appears to let the user select which address they would like to use. When it's run, it first disables all the fields on the form with this function piece: for(f=0;f<document.forms.length;f++) { for(i=0;i<document.forms[f].elements.length;i++) { if (document.forms[f].elements[i].disabled==true) keepDisabled += document.forms[f].name + document.forms[f].elements[i].name + "^"; document.forms[f].elements[i].disabled=true; } } Then when the user selects an address, it enables all the fields with this piece: for(f=0;f<document.forms.length;f++) { for(i=0;i<document.forms[f].elements.length;i++) { if (keepDisabled.indexOf("^"+document.forms[f].name+document.forms[f].elements[i].name+"^") == -1) document.forms[f].elements[i].disbaled=true; } } So the disabled = true should be skipped over for any elements in the keepDisabled variable. The odd thing is that it works fine in FireFox/Chrome, but in IE, it sorta half-enables the fields. The disables fields lose the grey-out, the input/text field can't be edited, which is still good, and the select only activates on a double click. I've also tried using these disabling codes: document.forms[f].elements[i].prop("disabled", "disabled"); document.forms[f].elements[i].attribute("disabled, "disabled"); Any suggestions? Thanks.
5b081ce1d7ffeaa3306b41acbc0ef7289f73f2754e12feaea4c7f7ae4b50a184
['196a31c68fa24dd284a40fed7901a69d']
I'm running into some trouble in OpenEdge on trying to connect a database on a test server to the database on the live server. I have opened a successful appserver connection using the following code: connection-result = happsrv:connect ("-AppService " + v-application_service + " -H " + v-name_server_address + " -S " + v-name_server_port ) no-error. I'm trying to load data into the test database from the live database, so in order to do that, I need to connect to the the live database(I only have the appserver connection currently). I'm using the following command to try and connect to the live database: connect value("-db /live/db/live.db -ld live"). However it can't find the live database. Any ideas on how to fix this, or of another way to do it? It has to be done with OpenEdge code, so none of the tools or anything. Thanks
08e2b13b2128a8f1526a6b21f0bfdaedb1e7654cd6504d47680d9d55c4e7e6de
['19740cddd73a4247acb928bd10259a92']
I am using spring framework 3.0.5. I have a form: <form:form method="POST" modelAttribute="postedEntry"> Category: <form:select path="category" items="${menus}" itemValue="id" itemLabel="menuName"/><form:errors path="category"/> <br/>Title: <form:input path="title"/><form:errors path="title"/> <br/>Short Description: <form:textarea path="shortDesc"/><form:errors path="shortDesc"/> <br/>Body: <form:textarea path="body"/><form:errors path="body"/> <br/><input type="submit" value="POST IT!11"/> </form:form> And a domain class Entry: public class Entry { private int id; private int category; private String title; private String shortDesc; private String body; private Date date; //getters and setters } And a controller: @RequestMapping(value="/entryPost",method=RequestMethod.POST) public String entryPost(@ModelAttribute("postedEntry") Entry entry,BindingResult result){ entryValidator.validate(entry, result); if(result.hasErrors()){ return "entryPost"; }else{ rusService.postEntry(entry); return "redirect:entryPost"; } } And in my service object: public void postEntry(final Entry entry){ String sql = "INSERT INTO entries (category,title,shortDesc,body,date) VALUES(?,?,?,?,?)"; jdbcTemplate.update(sql,new Object[]{entry.getCategory(),entry.getTitle(),entry.getShortDesc(),entry.getBody(),entry.getDate()}); } And a validator: public class EntryValidator implements Validator{ public boolean supports(Class clazz){ return Entry.class.isAssignableFrom(clazz); } public void validate(Object target,Errors errors){ ValidationUtils.rejectIfEmptyOrWhitespace(errors, "category", "required.category","Category is required!"); ValidationUtils.rejectIfEmptyOrWhitespace(errors, "title", "required.title", "Title is required!"); ValidationUtils.rejectIfEmptyOrWhitespace(errors, "shortDesc","required.shortDesc", "Short description is required!"); ValidationUtils.rejectIfEmptyOrWhitespace(errors, "body", "required.body", "Body is required!"); Entry entry = (Entry) target; entry.setDate(new Date()); } } If somebody sends the string value of a category, not integer, it will type near the form: Failed to convert property value of type java.lang.String to required type int for property category; nested exception is org.springframework.core.convert.ConversionFailedException: Unable to convert value "h" from type java.lang.String to type int; nested exception is java.lang.NumberFormatException: For input string: "h" But I don't want that it typed this. How can I somehow validate this value and throw my own message? I tried to check it in my validator by adding: int cat = entry.getCatrgory(); if(cat.equals("0")) errors.reject("invalid.category","The category is invalid!"); But it didn't work - it still threw ConversionFailedException exception.
2426782f803029db30895a66790ac273c9ce20985eed0007ae7044c127a85071
['19740cddd73a4247acb928bd10259a92']
I've found http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/mvc.html#mvc-static-resources So now my rus-servlet.xml looks like this: <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd"> <context:component-scan base-package="rus.web"/> <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver"> <property name="prefix" value="/WEB-INF/jsp/"/> <property name="suffix" value=".jsp"/> </bean> <mvc:annotation-driven/> <mvc:resources mapping="/resources/**" location="/resources/"/> </beans> But this in JSP still doesn't work! <link rel="stylesheet" type="text/css" href="resources/styles/styles.css" /> And i have 3.0.5 version of my spring framework.
70249b2db47a8d09fac7f504d40afc543b6516b0de0002d8c99a3179c7241347
['197daf32e9ab4fc793af35866c1bc05e']
Respecto al link, no lo había visto, aunque no veo claro que pueda servirme. También busqué información en inglés, y probé todo lo que pude encontrar. Me decanté por preguntar en este foro en español porque el modelo SII es específico en España, y tenía la muy diluida esperanza de que alguien se encontrara con algo similar en este mismo escenario del SII
6d91df288e60790ceb5949cef053b592308ba50d7ad41dc2dfde3ad4a2739220
['197daf32e9ab4fc793af35866c1bc05e']
Como inicializar contenido es un tema que no tiene que ver con la duda que planteé, aunque agradezco el esfuerzo. Saliendo de mi tema, te comento que puedes saber el tipo de control de una manera más elegante. Puedes usar `me.ActiveControl.ControlType`, y compararlo con `acComboBox`, `acListBox` o `acTextBox`. O también puedes usar: `If typeof me.activecontrol is ComboBox/ListBox/TextBox then`
7bebc72786ac19637071ebff2c07cb06d3ae5eba6847c221979f78287f395b89
['1985fe2db0be45a8ad51484fa45a0a26']
Thanks. This question is not the same as mine, but the blog post is very similar. After reading that I still hold the opinion that it's not really that useful. If you really care about lost passwords - go for two factors authentication. If you don't - you'd get more or less the same security with no password expiration.
ae6ddc5c804f7cb8ca18accef5e8430e9cc018eb51ca8e617e7787ecae663956
['1985fe2db0be45a8ad51484fa45a0a26']
On desktops, when web browsing you typically right click on an image and choose an item from a contextual menu to display/copy the image URL. In iOS, when you tap and hold down an image, an action sheet displays asking if you want to save the image, copy to the clipboard, etc. But what if you just want the URL? If safari doesn't offer this functionality, is there a 3rd party browser that does? Specifically, one that works on the iPad.
a04a578e90a21a2dce9d81f3f65f997f3335041b224188c28483a00b876c007d
['1986f3bb27654a02abb2ced535e16a47']
I'm trying to search an array of objects by a key that contains nested object id for populating. My object { service: 'user', isModerator: true, isAdmin: true, carts: [ { _id: 5e1344dcd4c94a1554ae0191, qty: 1, product: 5e09e4e0fcda6f268cefef3f, user: 5e0dda6d6853702038da60f0, expireAt: 2020-01-06T14:31:56.708Z, __v: 0 }, { _id: 5e13455306a54b31fc71b371, qty: 1, product: 5e09e507fcda6f268cefef40,// object ID user: 5e0dda6d6853702038da60f0, expireAt: 2020-01-06T14:33:55.573Z, __v: 0 }, ], I want to match if carts array, contains cart with a product that user is adding, to not add it the second time but instead increment qty of the existing one. My code const itemId = req.body._id; const userId = req.user._id; const { qty } = req.body; try { const producto = await Product.findById(itemId); const user = await User.findById(userId).populate({ path: 'carts', }); const result = user.carts.find((o) => { console.log(typeof o.product) // returns object console.log(typeof producto._id); // returns object return o.product === producto._id }); console.log(result); // returns undefined if (result !== undefined) { const foundCart = await Cart.findById(result._id); foundCart.qty += qty; await foundCart.save(); return res.json({ message: 1 }); } const newCart = new Cart({ qty, product: producto, user, }); const cart = await newCart.save(); user.carts.push(cart); await user.save(); return res.json({ message: 1 }); } catch (error) { return console.log(error); }
822ececf26c9941f1f188f9204314f6cc503693fb6862ad3da63f88e09c61c00
['1986f3bb27654a02abb2ced535e16a47']
So the problem was not with the form but with the formidable configuration; I just needed to add form.multiples = true; to the formidablePromise function. function formidablePromise(req, opts) { return new Promise(((resolve, reject) => { const form = new formidable.IncomingForm(opts); form.multiples = true; form.parse(req, (err, fields, files) => { if (err) return reject(err); resolve({ fields, files }); }); })); }
ea4706d1ba5fc6da81a02240d572d8002112885e7a4688d98747694191990f79
['19884a90b327436e8997bf5f94bdc3ff']
<PERSON>, many thanks thanks. I have removed the second code. I believed they were not in conflicts. Now there is any more overlayer with those elements. Very good result. It remains that YouTube video embedded goes out of mobile small devices as smartphones. It is not reformatted on little displays. This is the actual argument.
245b5c14400958127431266cd49899fd3e26d675d6f3bd14b3379cddfdf90329
['19884a90b327436e8997bf5f94bdc3ff']
I have had some troubles in finding the right css file. Try now. Even if my Firefox gives to me (I have already purged the browser cache) an old version of style.css and some trouble in viewing the video, Chrome gives to my the right css. It seems more responsive than before but video is not responsive.
6c8d315b1a3fc8cd3618116cb6d380c9c18e74ea9eacaa1a2f3c722fc74fa283
['198cd75883b7447aa7e25c3e5d6b45d5']
I was reading OnSemi's AN8173 app note and couldn't understand why input common mode voltage of AC coupled line is equal to VTERM. My thought was each input of the receiver, D and \D, will swing between VTERM and VTERM-400mV, thus the common mode would be VTERM-200mV. Indeed, when I simulated the circuit with LTSpice, input of CML receiver, D and \D, initially swing between VTERM and VTERM-400mV and input common mode voltage is VTERM-200mV. However the common mode starts to drift to final value of VTERM, D and \D swinging between VTERM+200mV and VTERM-200mV. Why is that so? Thank you.
6a8e6bc376ad26886039d2617290119acb9d067c94193c2d4bc40924011300d9
['198cd75883b7447aa7e25c3e5d6b45d5']
I am trying to decide location of AC coupling capacitors between FPGA and PHY SGMII interface and datasheets of neither part has any useful information. I've read some notes, like this one from Dr. <PERSON> and posts here on StackExchange where people providing pros of placing AC coupling caps near a transmitter. However I've also seen many other app notes such as this one from TI, SCAA059C that have AC coupling caps located near a receiver but not providing any reason for it. Electrically is there any benefit or reason to place AC coupling caps near a receiver? Also, I've seen some designs where caps are placed like below. If caps on transmitter side (or receiver side) is better , why would one design like below? Could there be any practical reason why below locations might provide more benefits? .
d98b72b9b1c55598d9688ee5f9a3e49b38c5d84a9e5034bf89003e1aa5afe379
['1994b01400244ea5b858f067c0077a69']
@PyRulez: Nope. What's involved here is surface energy. To create new surface area, you need to supply this energy to the material by doing work on it. As the blade thins out, the closer the work you expend becomes to the minimum surface energy. That's asymptotic behavior with asymptote most definitely *not* at zero.
40aae592ac05b3006a14672467f6316b93efece88d435d37fa597abe45b5e444
['1994b01400244ea5b858f067c0077a69']
@user972014 `w` is normal to `B` and `A` both - as I understand, that's a property of the cross product in non-degenerate cases. If you can provide an example where `w` wouldn't be "normal" - I'll certainly reconsider! A vector is normal to some other object, such as another vector or a plane, so you'd have to mention that - otherwise what you say has no useful meaning. And just to be explicit: a plane is uniquely normal to either of a pair of opposite vectors, and any vector on that plane will also be normal to both. An infinite set of unit vectors is normal to any given unit vector.
ed5cf6fcf6acf8372250486e2f040e506701c540af9e0031114724994eeac7cb
['19992f5214534e0f92b7c871bcd302f6']
I managed to make it work. I removed the enlarge y limits. Apparently, it was making it overlay on top of each other. \begin{tikzpicture} \begin{axis} [ xbar, xmin=0, xmax=8, width=7cm, height=10cm, xlabel={Closeness to the base firm}, symbolic y coords={ \includegraphics[scale=0.022]{Logo/intellogo.png}, \includegraphics[scale=0.02]{Logo/HPlogo.png}, \includegraphics[scale=0.02]{Logo/nvidialogo.png}, \includegraphics[scale=0.03]{Logo/broadcomlogo.png}, \includegraphics[scale=0.035]{Logo/texasinstrumentslogo.png}, \includegraphics[scale=0.055]{Logo/googlelogo.png}, \includegraphics[scale=0.14]{Logo/microsoftlogo4.png} }, ytick=data, nodes near coords, nodes near coords align={horizontal}] \addplot[xbar,fill={rgb:red,0;green,47;blue,135}] coordinates { (8,\includegraphics[scale=0.022]{Logo/intellogo.png}) (7,\includegraphics[scale=0.02]{Logo/HPlogo.png}) (6,\includegraphics[scale=0.02]{Logo/nvidialogo.png}) (5,\includegraphics[scale=0.03]{Logo/broadcomlogo.png}) (4,\includegraphics[scale=0.035]{Logo/texasinstrumentslogo.png}) (3,\includegraphics[scale=0.055]{Logo/googlelogo.png}) (2,\includegraphics[scale=0.14]{Logo/microsoftlogo4.png}) }; \end{axis} \end{tikzpicture} Now it looks properly:
59e4b7a9ba4a855b841757590a01b07e3af2280f81918a110630a772b8bd164d
['19992f5214534e0f92b7c871bcd302f6']
<PERSON> It worked perfectly. It seems a bit weird to me that it works like that... To get this right, the table contains only the information about the data points, therefore, the name of the path must always be added to the plot. The table is only "importing" the data values, right? Again, thank you so much for your help!
05524ac01681fe92a453c41c3bd0994d8c554020398a7f1a33f55f7f9db08f22
['19a5b72ba6ad4064ad9455b0df937002']
I am getting following output while cycling using a smart trainer which is attached to Bluetooth sensor which gives cycling speed and cadence values: flutter: [0, 23, 19, 9, 20, 20, 22, 14, 28, 24, 227, 13, 31, 22, 236, 104, 18, 29, 34, 10] flutter: [64, 24, 10, 19, 10, 7, 30, 22, 24, 20, 245, 26, 38, 22, 241, 16, 22, 23, 34, 15] flutter: [128, 27, 20, 30, 17, 113, 17, 32, 13, 16, 20, 221, 21, 12, 15, 10, 18, 14, 35, 238] flutter: [192, 26, 29, 20, 251, 100, 9, 24, 16, 20, 2, 22, 32, 242, 19, 17, 14, 20, 35, 9] flutter: [0, 23, 19, 9, 20, 20, 22, 14, 28, 24, 227, 13, 31, 22, 236, 104, 18, 29, 34, 10] flutter: [64, 24, 10, 19, 10, 7, 30, 22, 25, 20, 245, 26, 234, 22, 113, 16, 22, 23, 34, 15] flutter: [128, 27, 20, 30, 17, 113, 17, 32, 13, 16, 20, 221, 21, 12, 15, 10, 18, 14, 35, 238] flutter: [192, 26, 29, 20, 251, 100, 9, 24, 16, 20, 2, 22, 32, 242, 19, 17, 14, 20, 35, 9] flutter: [0, 23, 19, 9, 20, 20, 22, 14, 28, 24, 227, 13, 31, 22, 236, 104, 18, 29, 34, 10] flutter: [64, 24, 10, 19, 10, 7, 30, 22, 25, 20, 245, 26, 234, 22, 113, 16, 22, 23, 34, 15] flutter: [128, 27, 20, 30, 17, 113, 17, 32, 13, 16, 20, 221, 21, 12, 15, 10, 18, 14, 35, 238] flutter: [192, 26, 29, 20, 251, 100, 9, 24, 16, 20, 2, 22, 32, 242, 19, 17, 14, 20, 35, 9] flutter: [0, 23, 19, 9, 20, 20, 22, 14, 28, 24, 227, 13, 31, 22, 236, 104, 18, 29, 34, 10] flutter: [64, 24, 10, 19, 10, 7, 30, 22, 25, 20, 245, 26, 239, 22, 113, 16, 22, 23, 34, 15] flutter: [128, 27, 20, 30, 17, 113, 17, 32, 13, 16, 20, 223, 21, 12, 15, 10, 18, 14, 35, 238] flutter: [192, 26, 29, 20, 251, 100, 9, 24, 16, 20, 2, 22, 32, 242, 19, 17, 14, 20, 35, 9] flutter: [0, 23, 19, 9, 20, 20, 22, 14, 28, 24, 227, 13, 31, 22, 236, 104, 18, 29, 34, 10] flutter: [64, 24, 10, 19, 10, 7, 30, 22, 25, 20, 245, 26, 236, 22, 113, 16, 22, 23, 34, 15] flutter: [128, 27, 20, 30, 17, 113, 17, 32, 13, 16, 20, 219, 21, 12, 15, 10, 18, 14, 35, 238] flutter: [192, 26, 29, 20, 251, 100, 9, 24, 16, 20, 2, 22, 32, 249, 19, 17, 14, 20, 35, 9] flutter: [0, 23, 19, 9, 20, 20, 22, 14, 28, 24, 227, 13, 31, 22, 233, 104, 18, 29, 34, 10] flutter: [64, 24, 10, 19, 10, 7, 30, 22, 25, 20, 245, 16, 237, 29, 113, 16, 149, 23, 34, 15] flutter: [128, 27, 151, 30, 102, 113, 27, 32, 13, 97, 20, 217, 21, 12, 15, 6, 25, 14, 35, 238] flutter: [192, 72, 29, 146, 251, 100, 5, 24, 16, 20, 17, 22, 32, 254, 98, 17, 14, 20, 35, 126] flutter: [0, 145, 65, 31, 20, 20, 5, 14, 28, 24, 227, 113, 31, 22, 226, 104, 9, 29, 34, 10] flutter: [64, 100, 10, 19, 10, 7, 8, 22, 25, 20, 245, 120, 252, 12, 113, 16, 151, 23, 57, 15] flutter: [128, 27, 149, 30, 111, 113, 115, 32, 13, 135, 20, 201, 21, 12, 15, 28, 8, 14, 35, 238] flutter: [192, 199, 29, 111, 251, 100, 31, 24, 16, 20, 21, 13, 32, 225, 132, 17, 14, 20, 35, 119] flutter: [0, 108, 206, 19, 50, 20, 1, 14, 28, 24, 227, 115, 31, 22, 245, 104, 74, 29, 34, 10] flutter: [64, 102, 10, 19, 10, 7, 4, 22, 25, 20, 245, 17, 254, 13, 113, 54, 151, 23, 122, 15] flutter: [128, 27, 149, 30, 111, 113, 26, 32, 13, 187, 20, 203, 21, 12, 15, 29, 9, 14, 35, 238] flutter: [192, 33, 29, 107, 251, 100, 30, 24, 16, 20, 26, 63, 32, 230, 184, 17, 14, 20, 35, 119] flutter: [0, 104, 40, 20, 61, 20, 14, 14, 28, 24, 227, 115, 31, 22, 248, 104, 17, 29, 34, 10] flutter: [64, 102, 10, 19, 10, 7, 3, 22, 25, 20, 245, 60, 244, 52, 113, 30, 105, 23, 33, 15] flutter: [128, 27, 107, 16, 111, 113, 55, 32, 13, 200, 20, 200, 21, 12, 15, 43, 48, 14, 35, 238] flutter: [192, 29, 29, 107, 251, 100, 40, 24, 16, 20, 31, 22, 32, 230, 203, 17, 14, 20, 35, 119] flutter: [0, 104, 20, 19, 20, 20, 11, 14, 28, 24, 227, 114, 31, 22, 247, 104, 175, 29, 34, 10] flutter: [64, 103, 10, 19, 10, 7, 4, 22, 25, 20, 245, 175, 249, 0, 113, 16, 108, 23, 159, 15] flutter: [128, 27, 110, 30, 110, 113, 164, 32, 13, 12, 20, 211, 21, 12, 15, 25, 4, 14, 35, 238] flutter: [192, 5, 29, 105, 251, 100, 26, 24, 16, 20, 19, 22, 32, 254, 15, 17, 14, 20, 35, 118] flutter: [0, 106, 12, 25, 20, 20, 7, 14, 28, 24, 227, 114, 31, 22, 253, 104, 197, 29, 34, 10] flutter: [64, 103, 10, 19, 10, 7, 14, 22, 25, 20, 245, 94, 224, 24, 113, 16, 104, 23, 245, 15] flutter: [128, 27, 106, 30, 147, 113, 85, 32, 13, 108, 20, 213, 21, 12, 15, 7, 28, 14, 35, 238] flutter: [192, 234, 29, 98, 251, 100, 4, 24, 16, 20, 9, 22, 32, 252, 111, 17, 14, 20, 35, 139] flutter: [0, 97, 227, 2, 20, 20, 29, 14, 28, 24, 227, 142, 31, 22, 234, 104, 177, 29, 34, 10] flutter: [64, 155, 10, 19, 10, 7, 21, 22, 25, 20, 245, 170, 227, 31, 113, 16, 110, 23, 129, 15] flutter: [128, 27, 108, 30, 103, 113, 161, 32, 13, 157, 20, 214, 21, 12, 15, 2, 27, 14, 35, 238] flutter: [192, 67, 29, 10, 251, 100, 1, 24, 16, 20, 0, 22, 32, 251, 158, 17, 14, 20, 35, 127] flutter: [0, 9, 74, 8, 20, 20, 20, 14, 28, 24, 227, 29, 31, 22, 229, 104, 28, 29, 34, 10] flutter: [64, 8, 10, 19, 10, 7, 31, 22, 25, 20, 245, 26, 227, 22, 113, 16, 22, 23, 44, 15] flutter: [128, 27, 20, 30, 17, 113, 17, 32, 13, 16, 20, 218, 21, 12, 15, 10, 18, 14, 35, 238] flutter: [192, 26, 29, 20, 251, 100, 9, 24, 16, 20, 2, 22, 32, 247, 19, 17, 14, 20, 35, 9] flutter: [0, 23, 19, 9, 20, 20, 22, 14, 28, 24, 227, 13, 31, 22, 239, 104, 18, 29, 34, 10] flutter: [64, 24, 10, 19, 10, 7, 30, 22, 25, 20, 245, 26, 238, 22, 113, 16, 22, 23, 34, 15] flutter: [128, 27, 20, 30, 17, 113, 17, 32, 13, 16, 20, 223, 21, 12, 15, 10, 18, 14, 35, 238] flutter: [192, 26, 29, 20, 251, 100, 9, 24, 16, 20, 2, 22, 32, 241, 19, 17, 14, 20, 35, 9] flutter: [0, 23, 19, 9, 20, 20, 22, 14, 28, 24, 227, 13, 31, 22, 238, 104, 18, 29, 34, 10] flutter: [64, 24, 10, 19, 10, 7, 30, 22, 25, 20, 245, 26, 234, 22, 113, 16, 22, 23, 34, 15] flutter: [128, 27, 20, 30, 17, 113, 17, 32, 13, 16, 20, 222, 21, 12, 15, 10, 18, 14, 35, 238] flutter: [192, 26, 29, 20, 251, 100, 9, 24, 16, 20, 2, 22, 32, 242, 19, 17, 14, 20, 35, 9] flutter: [0, 23, 19, 9, 20, 20, 22, 14, 28, 24, 227, 13, 31, 22, 239, 104, 18, 29, 34, 10] flutter: [64, 24, 10, 19, 10, 7, 30, 22, 25, 20, 245, 26, 234, 22, 113, 16, 22, 23, 34, 15] Can somebody help me in decoding this data or at least understand how to get the speed and cadence data from it?
4c6c419a18b9e8133d85cd97f97e269f9e3776b7f10f3b5261263fbcc17bf75c
['19a5b72ba6ad4064ad9455b0df937002']
I am currently using flutter_blue package (https://pub.dev/packages/flutter_blue) and I want to understand how to listen for services and characteristics like Cycling Power (which is on 0x1818) and Cycling Speed and Cadence (which is on 0x1816) using flutter? I am currently using Kinetic Road Machine Smart Fluid Trainer.
242e9459d49b64430c0b3e4daa0b2d0bdbbcc680df644ddf342025ac2d016b30
['19b9ed2b5f3f44fdaae59376acf0e651']
I created ubuntu distro and while i installing that ubuntu distro selected options of Erase disk and install Ubuntu with other options of Encrypt the new Ubuntu installtion for security and Use LVM with the new Ubuntu installation. In next screen entered security key and click on Install now, Now it is showing the message of Some of the partitions you created are too small. Please make the partitions atlease this large /boot 276 MB If you do not go back to the partitioner and increase the size of these partitions, the installation may fail.
afe81bb0c41c528bf89ee18cd026c6a067273bf5d2096f3bd7ea7c40d50c0409
['19b9ed2b5f3f44fdaae59376acf0e651']
Is kernel version should be same as mentioned in article or Is it supports for updated kernel also. In article SEP 14.X supports for Ubuntu 14.04 with kernel version 3.13.0-63-generic or 3.13.0-139-generic (Added for 14 RU1 MP2) but my kernel version is 3.19.0-80-generic.
f7e0e9266a53e9ae1aa78c82951119fb2d52b674a3bcdc19dec352d5cc352eb2
['19cd8e8f48a742fb82ceafe75b360f88']
Don't Panic is rigth above. I did a similar solution. The following is what i did. I used pdo->quote() to escape my quotations. Should get around your problem. $databasehost = "your database host"; $databasename = "your database name"; $databasetable = "table name"; $databaseusername = "database username"; $databasepassword = "database password"; $fieldseparator = ","; $lineseparator = "\r\n"; $enclosedby = '\"'; // notice that we escape the double quotation mark $csvfile = "your_csv_file_name.csv"; // this is your $list of csv files... replace as $list = array(); and array_push into list. // check to see if you have the file in the first place if(!file_exists( $csvfile )) { die( "File not found. Make sure you specified the correct path." ); } try { $pdo = new PDO( "mysql:host=$databasehost;dbname=$databasename", $databaseusername, $databasepassword, array( PDO<IP_ADDRESS>MYSQL_ATTR_LOCAL_INFILE => true, PDO<IP_ADDRESS>ATTR_ERRMODE => PDO<IP_ADDRESS>ERRMODE_EXCEPTION ) ); } catch ( PDOException $e ) { die("database connection failed: ".$e->getMessage()); } // Load your file into the database table, notice the quote() function, protects you from dangerous quotes $qry = $pdo->exec( " LOAD DATA LOCAL INFILE " . $pdo->quote( $csvfile ) . " INTO TABLE $databasetable FIELDS TERMINATED BY " . $pdo->quote( $fieldseparator ) . " OPTIONALLY ENCLOSED BY " . $pdo->quote( $enclosedby ) . " LINES TERMINATED BY " . $pdo->quote( $lineseparator ) );
39b4c126336a143b376019400e6e2bce7ea5c27fa9955b6a18b2320b59df1dbc
['19cd8e8f48a742fb82ceafe75b360f88']
I agree with @Dark FlameS, in fact we are using the autocomplete widget for some of our students to add types of trees in the biology lab and they tag each with the scientific name. And since we dont know these scientific terms, we let them add taxonomy terms to the list. Slight difference however, we use the module Autocomplete Deluxe. Works like magic for us. You are able to see what taxonomy terms are already available by clicking into the text area. And as you type a taxonomy term, you will see what other terms are similar. If a tag is new, it will be added. one thing, dont allow them to delete your tags. We learned this the hard way. See the image below on what it looks like as you add a tag. Above is what you will see when you are adding the taxonomy field in your content type, this is after you install the Autocomplete Deluxe module Above is What the user sees when they add or select a taxonomy tag.
187bafb076f995b179521f0013063c23c4d7b8b057682eb64f33f0c7ce2987e7
['19d98b98a1c44f2e9f5538c77981b779']
You will need to return a new object (unless you already have a model set up which includes the "Count" property). Something like this: var query = (from c in context.Clients join o in context.Optics on c.id equals o.client_id where o.r_sph == 12 group new { c, o } by new { c.Id } into g select new {Id = g.Key.id, // other properties from "Client", Count = g.Count()} ).ToList();
24b4cedb454fb282a6187ebfa4ac063710b4e1f44df75de371462a104f3f0d9b
['19d98b98a1c44f2e9f5538c77981b779']
I know that this is late, but I believe it is because you are not calling close on your spreadsheet document after you are finished with it. Make sure you close the document before returning the memory stream to commit all underlying streams used by the document. // code omitted for clarity... workbookpart.Workbook.Save(); spreadsheetDocument.Close(); return mem.ToArray() http://msdn.microsoft.com/en-gb/library/documentformat.openxml.packaging.spreadsheetdocument(v=office.14).aspx
4ccbd55d4be6eb267dedfe87df534a3ee22fa2e7f88ac493b93780bcf2ba16a9
['19e366d88a86440fa82cf7668cc9f352']
Struggling with fitting a table on a beamer slide. Why is there so much spave between columns?! \begin{frame} \frametitle{Recovering GR} \begin{table} \centering \renewcommand{\arraystretch}{1.3} \begin{tabular}{ l l} \midrule \makecell[l]{Dependent spin \\connection} & $\MyLeftColumn{\omega_\mu{}^{ab}} = 2 e^{\lambda[a} \partial_{[\lambda}e_{\mu]}{}^{b]} - e_{\mu}{}^c e^{\rho a} e^{\sigma b} \partial_{[\rho} e_{\sigma]c}$ \\ \midrule Metric & $\MyLeftColumn{g_{\mu\nu} } = e_{\mu}{}^a e_\nu{}^b \eta_{ab}$ \\ \midrule \makecell[l]{Christoffel \\ connection} & $\MyLeftColumn{\Gamma^\nu_{\mu\lambda}} = e^\nu{}_a ( \partial_\mu e_\lambda{}^a + \omega_\mu{}^a{}_b e_\lambda{}^a)$ \\ \midrule Zero torsion & $\begin{aligned} \MyLeftColumn{T_{\mu\lambda}{}^\nu} &= 2 \Gamma_{[\mu\lambda]}^\nu \\ &= 2 e^\nu{}_a ( \partial_{[\mu} e_{\lambda]}{}^a + \omega_{[\mu}{}^a{}_b e_{\lambda]}{}^a = R_{\mu\lambda}{}^a(e)=0) \\ &= 0 \end{aligned}$ \\ \midrule On-shell & $\MyLeftColumn{R_{\mu\nu}} = e^\mu{}_a R_{\mu\nu}{}^{ab}(\omega) = 0$ \\ \midrule Action & $\begin{aligned}\MyLeftColumn{S} &= \int d^4x \text{det}(e_\mu{}^a) R(\omega)\\ \MyLeftColumn{R(\omega)} &= e^\mu{}^a e^\mu{}_b R_{\mu\nu}{}^{ab}(\omega) \end{aligned}$ \\ \midrule \end{tabular} \end{table} \end{frame} my preamble \documentclass[notes]{beamer} \usetheme{Singapore} \usepackage[utf8]{inputenc} \usepackage[export]{adjustbox} \usepackage{amssymb,amsmath,tabu} \usepackage{booktabs} \usepackage{eqparbox} \newcommand\MyLeftColumn[1]{\eqmakebox[A][r]{$#1$}} \usepackage{array} \usepackage{float} \usepackage{subcaption} \usepackage{makecell} \usepackage{amsfonts} \usepackage[czech]{babel} \usepackage{amsthm} \usepackage{amssymb,graphicx} \usepackage{hyphenat} \usepackage[font={small}]{caption} \usepackage{float} I am using this table formatting after <PERSON>'s cat's answer here multine line array in table cell
1c2385b0c57ce482e4d27e316f6d51a3d672b91767d3bf768571ab3c0a1a54f4
['19e366d88a86440fa82cf7668cc9f352']
Thanks for the comments. Actually, I am interested to know what will happen below 9.5 MHz for the mentioned value of inductor and capacitors. If it is a single L-C low pass filter I can understand it will attenuate high-frequency components over 9.5 MHz. However, I am not clear about how the chain L-C network will work below 9.5 MHz in this case. If I need to pass a signal from generator with a frequency below 9.5 MHz to a 50-ohm antenna what parameters should I consider to modify? I need to keep the L-C ladder network which is a constraint for me while ensuring signal transfer to load/antenna
be8b839b8a6532e1e2bd5ecc179c9d27dfbd42a73745c5c3874e60ed49dfaa5d
['19fc52c2de5e4f35bf81e735694864dd']
First you need to initialize your string array attendence. string[] attendence; private void setAttendence(List<String> studentList) { int j=1; for(String attList: studentList){ if(attList != null){ attendence[j]= attList; // getting null pointer exception } j++; } } public static void main(String[] args) { String sampleInput = "S0032124, Tan ah cat, ICT310-FT02, no, yes, yes, no, yes, yes, yes, yes, no, yes, 43, 55, 12, 53"; ArrayList<String> studentList = new ArrayList<String>(); for (String s : sampleInput.split(",")) { studentList.add(s); } attendence = new string[36]; newStudent.setAttendence(studentList.subList(3, 12)); } Otherwise you can not reach a value from attendence because it is just a pointer indicates null. If you are familliar with lower level programming languages, arrays are pointers and they need to show beginning of allocated memory space. By saying new string[n] you allocate n*sizeof(string) bytes memory space. So if you say attendence[1] you will reach location of &attendence + sizeof(string). By the way string is a char array so you actually get pointer of pointer. I mean sizeof(string) = 1 word..
86756ddf10ea1841573432da08e7bccf465a62cb492bdd5ab24b059ab3c23070
['19fc52c2de5e4f35bf81e735694864dd']
If you enter a maze and pick only one side(left wall or right wall) and follow that path it will take you to exit. Obviously it will not give you the shortest path. But only the pixels you walk over twice are makes the path longer so just get rid off them. I hope this will be helpful.
df6782dcee04f369a11bc62fd93622c6c376f1c016810c400746e86fe08c9b9f
['1a006250a4c8416aade6059f1d20c6fb']
The question that I asked was not that well posed. Stream functions are used for two dimensional fluid velocity fields, where their is a zero component for the fluid velocity in the third spatial dimension. According to a possibly less than accessible reference, that I have found, ANY two dimensional solenoidal flow field $\mathbf{u}$ can be derived from a scalar stream function $\psi$. For a two dimensional solenoidal flow $\mathbf{u}$ which hence obeys , \begin{align} \mathbf{\nabla\cdot u}&= 0\\ \text{or } \frac {\partial u_1 } {\partial x } + \frac{\partial u_2 } { \partial y }&=0 \end{align} we can have $\mathbf{u}$ given in terms of a stream function $\psi$, as \begin{align} u_1&= \frac {\partial \psi } {\partial y } \\ u_2&= -\frac{\partial \psi } { \partial x } \end{align} For the following quote, see Reference 1 ( a margin note on pg.15 ) it can be shown that the equation $\mathbf{\nabla\cdot u= 0}$ guarantees the existence of such a $\psi$ Reference 1: Mathematical Methods and Fluid Mechanics, Unit 5 Kinematics of fluids, The Open University, Walton Hall, Milton Keynes, (1984). Reprinted 1992.
7a80ef61a42f5bb69e0f2195a4012885f473ebe5095f6dd5016562f1278db18a
['1a006250a4c8416aade6059f1d20c6fb']
comments.php <?php $args=array( 'type'=> 'comment', 'callback'=>'my_comment_list', ); ?> <ol class="comments-list"> <?php wp_list_comments($args) ?> </ol> function.php function my_comment_list($comment,$arg,$depth){ } When trying to create a callback function called my_comment_list, it looks like I need three types of arguments for the callback function, $ comment, $ arg, $ depth, My question is: How do you know you need these arguments for callback function? and Where do you get detailed explanations of arguments, etc.? I usually refer to the below link in Wordpress template tags and functions, but It was not there... Wordpress Developer Resource
53bf76668098c0dfa210bace56936edfbafbe78a6ad15c86d87234d5f2ae9798
['1a0c659f81af4386925f96eeefd4ed35']
I'm having trouble with the following problem: It gives a hint to specify the vectors with formulas involving a, b, this is where I have gotten to: v1(a+b) = z v2(a+b) = z v1(a+b) - v2(a+b) = 0 (v1 - v2)(a+b) = 0 Now the above equation is a heterogeneous vector space, therefore [0,0,0] must be one of the vectors. Then I get stuck, what do I need to do next, am I even on the right track?
28a85f227ff0dd4454b0fcc1426a4906a87c305168894d11acca8b355f2fba97
['1a0c659f81af4386925f96eeefd4ed35']
press this keys '''Ctrl + Alt + F2''' you will see a screen asking for username and password. if not try pressing the same keys but change from F2 to F3 and try it. after entering your username and password try this GUI command '''startx'''. Now you should be able to use your OS. if this doesn't work then it is better to reinstall it.
5c688395e5b695b655a1d5d3d2fd3e395002a1c66cc68979a8c79c3eed93205e
['1a1263e569494b0bb3f76997be6f56bb']
You can instruct Google test to use its own implementation of tr1<IP_ADDRESS>tuple In cmake I use the following line to compile with "old" compilers: add_definitions(-DGTEST_HAS_TR1_TUPLE=0) I'm sure you can add it to your build system, it's a simple preprocessor definition. You can look at include/gtest/internal/gtest-port.h for more options. GTEST_USE_OWN_TR1_TUPLE may be useful. Most of the parameters are correct with default values.
97e31f37dcfbe9fd4d9f38ec3bdf9a8135bfb1e914314754b84fcb1d7f2583b5
['1a1263e569494b0bb3f76997be6f56bb']
You can use ::testing<IP_ADDRESS>StaticAssertTypeEq(); with std<IP_ADDRESS>result_of. You can also use typed tests. Complete example: #include <type_traits> template<class T> T foo(int) {...} ///Boilerplate code for using several types template <typename T> class ResultTest : public testing<IP_ADDRESS>Test {} typedef ::testing<IP_ADDRESS>Types<float, double, int, char*, float**> MyTypes; //Types tested! TYPED_TEST_CASE(ResultTest , MyTypes); ///Real test TYPED_TEST(ResultTest , ResultTypeComprobation) { //It will be checked at compile-time. ::testing<IP_ADDRESS>StaticAssertTypeEq<TypeParam, std<IP_ADDRESS><IP_ADDRESS>testing::StaticAssertTypeEq(); with std::result_of. You can also use typed tests. Complete example: #include <type_traits> template<class T> T foo(int) {...} ///Boilerplate code for using several types template <typename T> class ResultTest : public testing::Test {} typedef <IP_ADDRESS>testing::Types<float, double, int, char*, float**> MyTypes; //Types tested! TYPED_TEST_CASE(ResultTest , MyTypes); ///Real test TYPED_TEST(ResultTest , ResultTypeComprobation) { //It will be checked at compile-time. <IP_ADDRESS>testing::StaticAssertTypeEq<TypeParam, std::result_of(foo<TypeParam>)>(); } However, test will be instanced and run at run-time without doing anything. Weird, but I couldn't find anything better.
c16eeafa95492fc619b27c53a0695f00f16f86e5dd706b7981e1b8da6c239ac2
['1a20c6a18269484e8bd66dd3a3076f36']
You can try this: $('form').serialize() With this example: <form> <input type="radio" name="foo" value="1" checked="checked" /> <input type="radio" name="foo" value="0" /> <input name="bar" value="xxx" /> <select name="this"> <option value="hi" selected="selected">Hi</option> <option value="ho">Ho</option> </form> this produces: "foo=1&bar=xxx&this=hi"
63f1fbd51b40305cdc5fba04c5e9a88c0cf69a33dd1e45b4da2b894e4170147d
['1a20c6a18269484e8bd66dd3a3076f36']
As <PERSON> mentioned it is really hard to estimate. If you need this feature, you could use old data to estimate new zip. For example: You want to create a backup of your assets folder. You can track your creation time and save this result. After that, you know your first run took (let's say) 1.5minutes. Then you could estimate next run in relation to your growth of data you want to compress. Maybe +10% or +20% Hope this helps
c33be2b2e5ccb8b9cbcd27022b5db19c2ba41d3d24613cbc1ab2501d4aec5e69
['1a22b6a713d8485cad9a8cc6748f3401']
I have a file: route camel component, which uses an aggregationStrategy with completionFromBatchConsumer as the stop condition. My aggregator implements CompletionAwareAggregationStrategy The route itself works fine. I'm currently trying to define a readLock=changed strategy to skip files which are being written by another process, which works fine too. The problem is, when a file gets skipped due to readLock, it seems that the batch size is not updated, and hence the onCompletion method of the aggregator is never called resulting in an dead route. Shouldn't camel check the readLock before calculating the size of the batch? is there any way to achieve this or any equivalent solution? TKS
f71854755071d008591bf1d6d3fba92d8eaf1b9eb16f6aa5130132632e24f15c
['1a22b6a713d8485cad9a8cc6748f3401']
I'm trying to create a custom gitlab-runner to run a docker process, following: https://github.com/gitlabhq/gitlabhq/blob/master/doc/ci/docker/using_docker_build.md I tried the second approach in which I registered a runner using: sudo gitlab-runner register -n \ --url https://gitlab.com/ \ --registration-token xxx \ --executor docker \ --description "My Docker Runner" \ --docker-image "docker:stable" \ --docker-volumes /var/run/docker.sock:/var/run/docker.sock However,at gitlab, whenever the pipeline starts I'm facing the following error: ERROR: Failed to create container volume for /builds/xxx Unable to load image: gitlab-runner-prebuilt: "open /var/lib/gitlab-runner/gitlab-runner-prebuilt.tar.xz: no such file or directory" I can't find much information online, any help appreciated.
47eedb805bd199cde6ca99c4a3109901a6dddac8621bf47122cf17ee9d3f0675
['1a236c9ffbef48fe87b61a452f11c252']
I know that the magnetism is just electricity and due to length contraction and the change in charge density moving charges experience what we call magnetic force. so my question is can we calculate that force using electricity stuff (like electric field and the permittivity of free space) instead of using magnetic field?
e6e95cc709e59161bba7be9b268208c8db660036ec001f3c2abc692b76223407
['1a236c9ffbef48fe87b61a452f11c252']
the way it works is much simpler then you might think, instead of pre-loading say a game level it only loads a single screen, one or a few atoms per pixel on your screen, nothing more, the game/engine then predicts what the next frames are and that's the only thing loaded, only the part of the object visible is rendered, not the entire object itself. PROS: as much definition and resolution your monitor can handle, low memory usage CONS: read rate from disk is fairly large and could lead to low frame rate.
53befdf26a71d6b98d6e5384242b0abd400144b798454827cea11dcf4d9cb49b
['1a23f5f4810d4a368af5dd82135e103d']
There is padding around the <a> elements, the green part in the screenshot below: If you want the right side of "Contact Us" and the "Log in" button to line up, add padding-right: 0; to the <a> for "Contact Us" <li class="nav-item"> <a class="nav-link" href="#" style="padding-right:0;">Contact Us</a> </li>
6d0c134029ebd3e87c8a2ff51caedac543f22e086f9d7c012c3c30ab826c57a7
['1a23f5f4810d4a368af5dd82135e103d']
You are stopping the event propagation when it reaches the outer collapse. You should stop it on the inner collapses. In this codepen, the first inner collapse's collapse event will bubble while the second is stopped. $('#collapseInnerB').on('show.bs.collapse', function( event ) { event.stopPropagation(); }) $('#collapseInnerB').on('hide.bs.collapse', function( event ) { event.stopPropagation(); })
537e7d7584384eff866d7cb7ef12d432af15257c17afa7b9168d2cabdf8f6046
['1a2e8d3b55a44907a2cdb68898453812']
I was trying to install a package after add some languages to my system and it's seems like impossible. I tried to fix it with sudo dpkg-reconfigure locales that helped me when my terminal prompt wasn't opening but it looks like it doesn't fix all the problems. The complete error is this: (mintSources.py:5884): Gtk-WARNING **: 07:00:48.932: Locale not supported by C library. Using the fallback 'C' locale. Traceback (most recent call last): File "/usr/lib/linuxmint/mintSources/mintSources.py", line <PHONE_NUMBER>, in <module> add_repository_via_cli(ppa_line, codename, options.forceYes, use_ppas) File "/usr/lib/linuxmint/mintSources/mintSources.py", line 141, in add_repository_via_cli print(_("You are about to add the following PPA:")) UnicodeEncodeError: 'ascii' codec can't encode character '\xe5' in position 17: ordinal not in range(128) And when I write locale the answer is this one: locale: Cannot set LC_CTYPE to default locale: No such file or directory locale: Cannot set LC_MESSAGES to default locale: No such file or directory locale: Cannot set LC_ALL to default locale: No such file or directory LANG=nb_no.utf8 LANGUAGE=nb_NO LC_CTYPE="nb_no.utf8" LC_NUMERIC=es_AR.UTF-8 LC_TIME=en_US.UTF-8 LC_COLLATE="nb_no.utf8" LC_MONETARY=es_AR.UTF-8 LC_MESSAGES="nb_no.utf8" LC_PAPER=es_AR.UTF-8 LC_NAME=es_AR.UTF-8 LC_ADDRESS=es_AR.UTF-8 LC_TELEPHONE=es_AR.UTF-8 LC_MEASUREMENT=es_AR.UTF-8 LC_IDENTIFICATION=es_AR.UTF-8 LC_ALL= I've three languages installed, seems like Norwegian is the one who's working strange ls -lah total 24K drwxr-xr-x 2 root root 4.0K Feb 4 00:49 <font color="#729FCF"><b>.</b></font> drwxr-xr-x 3 root root 4.0K Dec 17 10:26 <font color="#729FCF"><b>..</b></font> -rw-r--r-- 1 root root 294 Jul 17 2018 en -rw-r--r-- 1 root root 372 Jul 17 2018 es -rw-r--r-- 1 root root 780 Feb 4 00:40 mintlocale -rw-r--r-- 1 root root 24 Feb 5 06:48 nb
b64d21f01098980a0a03c114d59bfbca98d23aa75c6d42d10a8ba95c2541b31c
['1a2e8d3b55a44907a2cdb68898453812']
I've seen here that it was a dividing topic to use "should" as a prefix for a boolean because it could mean that we're unsure. Then how would you prefix a boolean such as "myButton.shouldShow"? I feel indeed that it's a little bit weird so I was hoping to find another solution.
c73656ce8ded76f1e6b3c07939056c7ab51348909e319064b67b5337802bfb56
['1a32cd5e82514ec6943f66f63cb29190']
Is there an easy way to include all possible two-way interactions in a model in R? Given this model: lm(a~b+c+d) What syntax would be used so that the model would include b, c, d, bc, bd, and cd as explanatory variables, were bc is the interaction term of main effects b and c.
82ebf10a9bbdeeddd2b5e132b70279b02e0537d57e93d52ca69f78b5e7ba8205
['1a32cd5e82514ec6943f66f63cb29190']
I have a linear model in R in which I include all possible 2-way interactions. One of the variables included in the model is JobAfter18: > levels(AcademicData$JobAfter18) [1] "No" "Yes, one job" "Yes, two jobs" "Yes, more than two jobs" This variable has these 4 factor levels when viewed here. However, in the summary of the fit, it comes up as follows: AcademicData$JobAfter18.L 34.<PHONE_NUMBER>.857406 1.005 0.31725 AcademicData$JobAfter18.Q -43.296277 20.763852 -<PHONE_NUMBER> * AcademicData$JobAfter18.C -14.816135 8.309894 -1.783 0.07782 . Where are the L,Q, and C coming from, and what do they mean? I realize that factor variabels will include n-1 factor levels in the output, as the one not included is the baseline to which the others are compared. I am just not following why the levels are coming up with these letters rather than being written out, as they are for other variables, such as seen here with the "Sex" factor variable, which has levels "Male" and "Female": AcademicData$SexMale 19.421651 12.331565 1.575 0.11863
bfeac6cd435f1ae5ee8527815f021153e54996da42467b9f980d29417412d621
['1a3694b095f34071aa7fa75068b79eb5']
I have an existing .net core 3.0 preview 7 web application. My application is mainly razor-pages organized into areas eg. Admin, Sales, etc. I am able to successfully use a blazor component if I put it at the root of the application, however, if I move the component to an RCL I can access the component but it is not responsive (clicking the button for the counter example does not increment the count). I want to be able to go localhost/Admin/RazorPageContainingBlazorComponent or localhost/Sales/AnotherRazorPageContainingBlazorComponent I get this error in chrome dev tools: ''' Error: Failed to complete negotiation with the server: Error https://localhost:5000/myfeature/_blazor/negotiate 404 ''' I believe this is caused by the signalR hub being mapped to https://localhost:5000/, but I not sure how to add additional blazor hub mappings or how to change blazor.server.js to to use the root hub.
cf8a3c1da49c33054f8fa00a28a8a1a34169bfbb4c3656631db318b9d64a5e28
['1a3694b095f34071aa7fa75068b79eb5']
After digging though both signalR documentation and the blazor.server.js file I was able to come up with a solution. Adding the code below to you're layout file configures the signalR hub to use an absolute path instead of a relative path. <script src="~/_framework/blazor.server.js" autostart="false"></script> <script> Blazor.start({ configureSignalR: function (builder) { builder.withUrl("/_blazor"); } }); </script> This allows razor components to be used directly in a razor class library, using area routing.
53915156f6b27c09662ff5baa38c1b66305985068495b120a549d555723c447e
['1a3ce6449b4b441f91b7e6c3ff5ebba4']
Frankly, AS3 is not hard to learn if you already know OOP. It will take a week or so. If you don't like all the frames stuff in Flash, you can create a single frame app and then manage everything from your custom AS classes. I'm also a .NET developer, and I had no trouble learning AS3.0. Of course, one week is not enough to become an expert (it takes years to become an expert in any field). But if you simply need to create video or mp3 players, create drag and drop basic games/apps to add to an ASP.NET page, it's worth spending 20 or 30 hours on AS3. There are great video trainings out there . Seven or 8 hours training should take the 20 to 30 hours I mentioned. I went for AS3.0 a few years ago, rather than SL, simply because everybody has Flash plugin installed. AS3.0 is typed (simple types like Number, String etc), but at least it's typed. There are plenty of functions, classes and methods allowing to implement hit tests, drag/drop, event listening (mouse events, keyboard events etc). Really cool and fun language. Take care.
0adb887f3a50c22dd71e25a680e1856540f510ece7415eb69f9397471aab7f7f
['1a3ce6449b4b441f91b7e6c3ff5ebba4']
I think what you are getting confused is with degree and radians. Now, as we know angles can be expressed in degree as well as radians. When in any equations we use angles in degree what we get is degree related value. Whereas radians outputs only number. There is no unit to attach with the answer. Lets take an example:- $f(x) = \frac {\sin x}{x}$ , for $x \in \mathbb R$ thereby $f(x)\in\mathbb R$ Now if we take $x = 30^\circ $. The answer is $f(30^\circ)=0.0167\ degree^-1$ Now if we take $x=30\ radians\ or\ only\ 30$. The answer is $f(30)=-0.988$ The reason behind it is we assume radians as unit less, calculations using radians give pure numbers. But with degree we have to associate it with the answer. Another prominent Example would be Angular Velocity. $V = \dot \theta = \frac{d\theta}{dt} $ If we used $degrees\ as\ unit\ of\ \theta,\ then\ the\ unit\ of\ V\ is\ degree.s^-1, But\ if\ radians\ is\ used\ then\ radians.s^-1\ or \ simply\ s^-1 $ And also the radians is defined as: $1\ radians$ is defined as the angles subtended by an arc such that the arc length is same as the radius. As we can see its a ratio, an unit less substance.
d173738d4f57db4be629dca1ba951f5ad445be67633ecf807903fcf55ad5e2b4
['1a418bd9a86f4f3682e096a8d39db411']
from a speed perspective, it is probably not an advantage. However, it looks like a HashMap's capacity is always a power of 2 (even specifying the capacity in the constructor results in a call to Collections.roundUpToPowerOfTwo(capacity)), so notating it in the form 1 << x ensures this restriction trivially, even if you were to change x. the other forms would be easier to mess up when changing if you weren't aware of the restriction
56a2b2b5bb1967c5b3a3d03d701c64597fda5ee303f6417c77d33ca17a602f63
['1a418bd9a86f4f3682e096a8d39db411']
I know this question is old, but for the benefit of anyone coming here from Google: I was getting this exact InflateException (line # and everything) on my API 21 emulator but not my API 26 emulator. trying some things from the answers on this similar question led me to setting the title on the DatePickerDialog, which stopped it from crashing DatePickerDialog datePickerDialog = new DatePickerDialog(this, new DatePickerDialog.OnDateSetListener() { @Override public void onDateSet(DatePicker view, int year, int monthOfYear, int dayOfMonth) { startDateEt.setText(dayOfMonth + "-" + (monthOfYear + 1) + "-" + year); } }, mYear, mMonth, mDay); datePickerDialog.setTitle(""); //ADDED THIS LINE datePickerDialog.show();
b1f9fd486dfdf3e0c5bfaeb3e8c86cc29feb7ff53894462e9026891e7dbf11f4
['1a45dde30fbd43aabb1b2249abf6ddf8']
My problem was related, but slightly different. The storage class used by the field can change based on settings: the default locally, remote storage in production. I implemented a subclass of FileField that ignores the storage kwarg when deconstructing the field for migration generation. from django.db.models import FileField class VariableStorageFileField(FileField): """ Disregard the storage kwarg when creating migrations for this field """ def deconstruct(self): name, path, args, kwargs = super(VariableStorageFileField, self).deconstruct() kwargs.pop('storage', None) return name, path, args, kwargs It can be used like this: class MyModel(models.Model): storage = get_storage_class(getattr(settings, 'LARGE_FILE_STORAGE', None))() file = VariableStorageFileField(blank=True, null=True, storage=storage)
9757838671967f26344c004c26e43309e1241aa293e6e28af99bf4af8ea69d3e
['1a45dde30fbd43aabb1b2249abf6ddf8']
There's a few things wrong with the code in your pen that will bring about the problem you are having. The first step is to use the development versions of the libraries, in order to get better error messages. Use https://cdnjs.cloudflare.com/ajax/libs/react/15.4.1/react-with-addons.js instead of https://cdnjs.cloudflare.com/ajax/libs/react/15.4.1/react-with-addons.min.js. Second, loading several versions of React can cause the issue your are having. Remove https://cdnjs.cloudflare.com/ajax/libs/react/<PHONE_NUMBER>/umd/react.production.min.js from the list of external scripts you are loading. Thirdly, there is a typo when you specify the leave timeout of the animation. You have written transtionLeaveTimeout, where it should be transitionLeaveTimeout. With this type, the transition library will complain about a missing property. This CodePen summarizes the changes you need to make.
d8b3a72f6b20f111531f6645a73e994117df9f46fc7a4f5d151fdd57e5e774c5
['1a4e8513773645ab8cd3dbb8e4f8a534']
Given a right triangle, if I know two of its legs are $a = 3,5$ and $b = 5,5$, is it possible to solve the triangle with this info? This is, can I determine all of its sides and all of its angles with just this two sides? Now, obviously I can determine all of the triangle's sides using <PERSON>'s theorem. But I'm struggling with the angles. I am supposed to use trigonometry, so to find the angle $\beta$ opposing the side $b$ I do this: $$ \tan{\beta} = \frac{Op. Leg}{Adj. Leg} = \frac{b}{a} = \frac{5,5}{3,5} = 1,5714 \dots$$ Then I would do $$ \beta = \tan^{-1} {\left( \tan{\beta} \right)} = \tan^{-1} {\left( 1,5714 \dots \right)} \approx 57,53^{\circ}.$$ The problem is that this last step was done using a calculator, which is not allowed by my professor. So my question is this: is there a way to obtain the angles of this triangle without the aid of a calculator?
0a94b8fd5828f5891b6eeed13c0d431a40ee5971a0c207441d211273af0d4bd2
['1a4e8513773645ab8cd3dbb8e4f8a534']
Your approach can't always look back far enough There are sequences a simple state machine can detect which your approach cannot. For example, a 1, followed by any even number of 0s, followed by a 1. Your approach could detect 1001, 100001, 10000001, but it can't do the general case. This is because you can only examine a finite amount of history. While you can (at a cost) make that amount as large as you want, it's still finite.