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
e276e53d3fa1f12440997f821ff42640ddf64a12f5235d12d9345eaea04daa10
['d3055d172a6d411ba2fbdbf59670ae79']
I'm having trouble getting my GUI to contain any of my JButtons or JTextField. I have two classes One "SnowballFight" class that contains my main method and frame constructor. Then I also have "GameBoard" which sets up my GUI. My problem is that my GUI appears, but appears empty. "SnowballFight" class: package snowballfight; import java.awt.BorderLayout; import javax.swing.JFrame; import javax.swing.JButton; import javax.swing.JTextField; import javax.swing.JPanel; import java.awt.Color; import java.awt.GridLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; public class SnowballFight extends JFrame implements ActionListener{ public SnowballFight(){ setLayout(new BorderLayout(1,2)); } public static void main(String[] args) { SnowballFight frame = new SnowballFight(); GameBoard game = new GameBoard(frame); } public void actionPerformed(ActionEvent event) { } } "GameBoard" class: package snowballfight; import java.awt.BorderLayout; import javax.swing.JFrame; import javax.swing.JButton; import javax.swing.JTextField; import javax.swing.JPanel; import java.awt.Color; import java.awt.GridLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; public class GameBoard extends JFrame implements ActionListener{ private JButton[][] game = new JButton[10][10]; private JTextField display = new JTextField("Welcome to the SnowBall fight!"); private Opponent[] opponents = new Opponent[4]; public GameBoard(SnowballFight frame){ JPanel panel = new JPanel(); panel.setLayout(new GridLayout( 10, 10)); for (int row = 0; row < game.length; row++) { for (int col = 0; col < game[row].length; col++) { game[row][col] = new JButton(); game[row][col].setBackground(Color.gray); game[row][col].addActionListener(this); panel.add(game[row][col]); } } add(display, BorderLayout.NORTH); add(panel, BorderLayout.SOUTH); frame.setTitle("Snowball Fight"); frame.setSize(200, 150); frame.setLocationRelativeTo(null); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setVisible(true); } public boolean isGameOver(){ for (int opponent = 0; opponent < opponents.length; opponent++) { if(opponents[opponent].isSoaked() == false ){ return false; } } return true; } public void actionPerformed(ActionEvent event) { } }
251d460e6c4d49b232af004ef79725b78805d7663c3e02efeb3ad2d320fd09a2
['d3055d172a6d411ba2fbdbf59670ae79']
Using my code below gcc creates an un-executable file. Also when I include my sort.h header file I get an error. Thanks to anyone willing to proof read my code. The intended function of the program is to open the provided file and then sort it. file_sorter.c: #include <stdio.h> #include <stdlib.h> //#include <sort.h> #include <string.h> int main(int argc, char **argv){ if(argc != 2) { printf("usage: file_sorter <filename>\n"); exit (EXIT_FAILURE); } char *out = "sorted.txt"; //declares the name of output file FILE *fp, *fileOUT; //Pointer to sort output data fp = fopen(*argv, "r"); if(fp = NULL){ //checks that the file opened exit (EXIT_FAILURE); } char *line = NULL; //Grabs the total amount of lines from the file size_t len = 0; int totalLines = getline(&line, &len, fp); char **array = (char**)malloc(totalLines * sizeof(char*)); char singleline[totalLines]; //initial memory allocation for the file int i = 0; while(fgets(singleline, totalLines, fp) != NULL){ array[i] = (char*) malloc (totalLines * sizeof(char)); singleline[totalLines] = '\0'; strcpy(array[i], singleline); i++; }//loading the file, and allocating memory as we go printf("unsorted file:\n");//prints the unsorted array for(i=0; i<totalLines; i++){ printf("%s\n", array[i]); } fileOUT = fopen(out, "w");//opens the out file if(!fileOUT){ exit (EXIT_FAILURE); } printf("sorted file:\n");//prints out the sorted file for(i=0; i<totalLines; i++){ fprintf(fileOUT, "%s", array[i]); } fclose(fp);//close the files fclose(fileOUT); for(i=0; i<totalLines; i++){//anti memory leak free(array[i]); } free(array); return 0; } sort.c: #include <stdio.h> #include <stddef.h> #include <stdlib.h> void quick(int *a, int n){ if(n < 2){ return; } int p = a[n /2]; int *l = a; int *r = a + n -1; while( l <= r ){ if( *l < p ){ l++; } else if ( *r > p ){ r--; } else { int t = *l; *l = *r; *r = t; l++; r--; } } quick( a, r - a + 1 ); quick( l, a + n - l ); } void insertion(int *a, const size_t n) { size_t i, j; int value; for (i = 1; i < n; i++) { value = a[i]; for (j = i; j > 0 && value < a[j - 1]; j--) { a[j] = a[j - 1]; } a[j] = value; } } sort.h: #ifndef SORT_H #define SORT_H #include <stddef.h> void quick(int *a, int n); void insertion(int *a, const size_t n); void readFile(char *a, char *b) #endif /*SORT_H*/ makefile: all: file_sorter.o sort.o gcc -Wall -o file_sorter file_sorter.o sort.o file_sorter.o: file_sorter.c sort.h gcc -c file_sorter.c sort.o: sort.c sort.h gcc -c sort.c clean: rm -rf sort *.o
3f598a1577e3357292cac3fc9b91369d062ecfef731f153662613b56b93c1b38
['d30a8c054b0647f89396a8299a10ae86']
I have a Spring-Boot (1.5.3) application running on a Tomcat 8.5. Within it, i have a RestController with a single parameter. This parameter is decoded automatically - which is fine for all other controllers within my application, but for this one, i need the raw request data, since they will be used within another request. Please note that i wold like to only disable the auto-decoding for this Controller/request and keep the normal behaviour everywhere else. @RestController @RequestMapping("/rest/test") public class TestController { @RequestMapping("/test") public ResponseEntity<String> test(@RequestParam final String test){ return ResponseEntity.ok("Requested: " + test); } } Now, if i send access it with curl localhost/rest/test/test?test=%C3%B6%20%C3%A4 I receive the output: Requested: ö ä I would like to have Requested: %C3%B6%20%C3%A4 Any Ideas?
8cd7e03b9206f3dc2990294abc9320177ab7ce80654e4d0fe88028bd70e993ff
['d30a8c054b0647f89396a8299a10ae86']
I ended up ensuring, that the received data was did not contain invalid characters. private static final String VALID_URL_CHARACTER_PATTERN = "^[A-Za-z0-9-._~:/?#\\[\\]@!$&'()*+,;=`.]+$"; private static final String ensureEncoding(final Object obj) { if (obj == null) { return null; } String val = obj.toString(); if (!val.matches(VALID_URL_CHARACTER_PATTERN)) { try { val = URLEncoder.encode(val, "UTF-8"); } catch (UnsupportedEncodingException e) { log.error("Unexpected encoding Problem on value: " + val, e); } } return val; }
7f3905d5232ffe14884f2b82288e3cc9e4961b13055078e0bdff4250f7f50f91
['d31bbb914629449bb0e7587cb15acb6d']
To change the URL once the page has already loaded, you will need to use javascript, as you won't be able to do this using Laravel/PHP because you need access to the dates, which are only selected after the page has loaded. If your form is similar to: <form id="dateForm" onsubmit="return submitDateForm()"> <input type="text" id="from_date" name="from_date"> <input type="text" id="to_date" name="to_date"> </form> Assuming you are using POST for the form submission, and have already imported jQuery, then insert into your view (or a separate .js file which you import) the following jQuery: function submitDateForm() { var from_date = $( '#from_date' ).val(); var to_date = $( '#to_date' ).val(); //Send the request var request = $.post("../from_date/" + from_date + "/to_date/" + to_date); //prevent the form from submitting itself normally return false; }
7dc62508f914a92ff4129f0d2000e15938411905546f57576505f7178fd4a31a
['d31bbb914629449bb0e7587cb15acb6d']
This is not possible out-of-the-box with the current build tools and configurations that V8 provides. As suggested in the comments, using a VM might be the quickest way to get this working for you. If it is very important for you long-term, or for other developers as well, you could look at submitting patches to V8 to make this possible, but I don't have a good sense of how much work that would be.
f50628b0fb60da07175108529c174b388a2bb9cff64e3f28444d81718da33c93
['d31c16639a5d44bb9be91c921cf34d8e']
I have a problem that has the following table: Movie Studio Year Rating The Shining Warner 1999 8.4 The Pianist Warner 2002 8.6 The LOTR Dreamworks 2004 8.7 License to Kill Dreamworks 2001 8.3 Complicated HP 2005 7.7 Django Unchained HP 2003 8.8 Diamonds <PERSON> 1997 6.7 How do you find all movies that have higher rating than all previously released movies by the same movie studio? So the output, I guess, should be: The pianist because it was released later than the other movie the shining, by the same studio and has a higher rating. The LOTR for the same reason as above. Django Unchained because although Complicated was released later it has lower rating than Complcated. It also happens to be the oldest movie from that studio so I don't know how to handle this. Finally, Diamonds should be returned as it is the only movie from that studio and there is nothing to compare to.
2068052e64c10b685e33ce7a689a5c58f9f14471fae81708975480b200a4d3c6
['d31c16639a5d44bb9be91c921cf34d8e']
So I have a table excerpt that looks like this: Title Type Year Rating ------------------------- Interstellar DVD 2014 8.4 Interstellar HD 2014 8.4 12 Angry Men DVD 1969 8.9 The Pianist HD 2001 8.1 The Pianist DVD 2001 8.1 Dragon Ball Z HD 2011 8.4 Dragon Ball Z DVD 1999 8.3 I want to retrieve all titles that have a DVD and HD released in the same year. So, I would want to get Interstellar, The Pianist but not Dragon Ball Z since it's HD and DVD version were released on different years. I managed to do it by joining tables but is it possible to do it without any joins?
3984532a9a2bc639b466e04d60b2f22a4dd25554ea970cfc9384fb9d5af3da6b
['d31e9faabd934aa086f20fa93772f3f1']
Based on <PERSON> answer there is wp function to escape square brackets for using text in shortcode parameters: function my_esc_brackets($text = ''){ return str_replace( [ "[" , "]" ] , [ "&#91;" , "&#93;" ] , $text ); } Often people suggest using shortcode's $content for text parameters, but there are cases when the shortcode has many such text parameters.
20b4ca57e2c9ba906adc1fefe0b1da4c1d75c3f7b08ddaa4c63ca4f396c7e18a
['d31e9faabd934aa086f20fa93772f3f1']
Okay <PERSON> it seem that you need to rephrase your questions into: What do you want to have? Going from general (A running server os) to specific (/usr should be on a partition on its own). I guess you just want a running system with CentOS. So I would recommend you to keep everything on one partition, especially since your HDD is quite small anyways.
741ca5661b8be405bc1614c0ff59f0cfdfd79d5b3657d597d4f1efa9fbf4f300
['d32409213cdf4016a5ff13ae628a65d1']
If you already have a class defined for this table you can use code as below var products = new List<Products>(grid.SelectedRows.Count); for(int index = 0; index < grid.SelectedRows.Count; index++) { var selectedRow = grid.SelectedRows[index]; var product = (Products)selectedRow.DataBoundItem; products.Add(prduct); } or if you don't have a class definition you can use dynamic keyword var products = new List<dynamic>(grid.SelectedRows.Count); for(int index = 0; index < grid.SelectedRows.Count; index++) { var selectedRow = grid.SelectedRows[index]; var product = (dynamic)selectedRow.DataBoundItem; products.Add(prduct); }
ed02fe3d4e9197ee051bed5d57599ff407f25eab060df615f118c5feb7e0919a
['d32409213cdf4016a5ff13ae628a65d1']
Well the code looks fine but playing sound really depend on the environment that you are working on For example your are doing this code on a windows server (let say 2012) then in-order to play play sound you need to enable media feature from control panel / add or remove feature or you need proper access rights(resx will help). there are certain thing that you can 1.You can try to play some other audio files in the production environment to mark sure that the production environment can make some noise. In other words, mark sure that the production environment can emit sound. 2.You can try to use the Windows Media Player to play the .wav file in the production environment to check if the .wav file is a bad file or not. You can try to run the app in other computer, such as other desktop and other computer with same environment with the “production environment” you have tested. 3.You can try to add some log info and “try…catch…” statement in the code your app to check if there are some exceptions occurs when you are running the app in the production environment.
fa5935da359a6a4d81359aac5a94dd8257e23f78b16d96ab722db8af0cdfeb20
['d3282496f7e74905839a96c4104a5529']
Using pure javascript, with the onclick function in HTML code in menu items: enter cod<div id='etiquette-center-nav'><!-- .goToTop-lg in javascript: --><!-- Sticky window script resides in <head> of etiquette.php page. ID's are referenced in there! --> <nav id='navigation-etiquette'><!-- role='navigation' can be omitted here. It is only required for the mobile view because of conflict with the main page navigation when cookies are turned on with minification of php files. --> <div id='navigation-etiquette-shadow'></div> <ul class='nav' itemscope itemtype="http://www.schema.org/SiteNavigationElement"><!-- no 'navbar-nav' class. --> <li id='etiquette-main-buttons' class='dropdown1'><a><span>Etiquette General Concepts</span></a><!--id='etiquette-main-buttons' used in script below to hide menu. See line 48 in index.css --> <ul id='etiquette-dropdown-menu' class='dropdown-menu'> <li itemprop="name"><a onclick="toggleHide()" itemprop="url" href='#header-container'><span>Introduction (back to top)</span></a></li><!-- #header-container is inside file: includes/header-start.php --> <li itemprop="name"><a onclick="toggleHide()" itemprop="url" href='#general-concepts'><span>General Concepts</span></a></li><!-- Target: #systems-collapse --><!-- Black-Cat-Kenpo -->e here Then put this script immediately after the close tag for the dropdown-menu: <script> function toggleHide() { var element = document.getElementById("etiquette-dropdown-menu"); element.classList.add("hidden", "hide"); element.onmouseleave = function(){ element.classList.remove("hidden", "hide"); } } </script>
0d32862eddc7b3d5f61bb720ef35aa08c7e11af85c612f0fea9f45704c49cd9a
['d3282496f7e74905839a96c4104a5529']
The javascript's first function is to "clear" any class previously set by clicking on .dropdown-menu li a. When you hover over {.dropdown1 la a} (or .dropdown la a), it applies bootstrap's '.hide' class to the .dropdown-menu. <nav id='navigation-lineage' role='navigation'> <div id='navigation-lineage-shadow'></div> <div class='navbar-header'> <button id='lineage-xs-button' type="button" class='navbar-toggle' data-toggle="collapse" data-target="#collapse-me"> </button> </div><!-- END '#navbar-header' ---> <ul class='nav'><!-- no 'navbar-nav' class. --> <li class='dropdown1'><a><span>Martial Arts History</span> </a><!-- see NOTES below. href tag is omitted only for desktop view (no toggle). --> <ul class='dropdown-menu'> <li><a href='#lineage-introduction'><span>Introduction (back to top)</span></a></li> <li><a href='#martial-arts-history'><span>Ancient martial arts history</span></a></li> </ul> </li> </li> <li class='dropdown1'><a href="#lineage-1955-present"><span><PERSON>..U.S.A. (1955-present)</span></a> </li> <li class='dropdown1 navbar-collapse'><a><span>Systems descended from <PERSON> see NOTES below. href tag is omitted only for desktop view (no toggle). --> <ul class='dropdown-menu'> <li><a href='#listing-of-systems'><span>Listing of Systems</span></a></li> <li><a href='#Black-Cat-Kenpo'><span>Black Cat Kenpo Karate Federation</span></a></li><!-- Target: #systems-collapse --><!-- Black-Cat-Kenpo --> <li><a href="#American-Combat-Karate"><span>American Combat Karate System</span></a></li> <li><a href='#American-Tae-Kwon-Do'><span>American <PERSON> <PERSON> -<br>Federation</span></a></li> <li><a href='#Norwegian-Branch'><span>Norwegian Branch: <PERSON> -<br><PERSON>> <li><a href='#Tonji-System'><span>Tonji System</span></a></li> <li><a href='#Hard-Soft-System'><span>Hard/Soft system</span></a></li> </ul> <script> $(document).ready(function () { $(".dropdown1").hover(function(event) { //hover on main menu item.. $('.dropdown-menu').removeClass('hide'); //clear previous 'hide' class applied to dropdown-menu. }); $(".dropdown-menu li a").click(function(event) { $('.dropdown-menu').addClass('hide'); //On click, apply bootstrap's class 'hide'. }); }); </script> </li> </ul> </nav><!-- END '#navigation-lineage --->
9238f9b8ead8334be596f4f08cb77c3ae4514c9c5c9b00b21c439d70e3d36abe
['d348fa22472c4c528089aaa90317a757']
You can integrate over $\mathbf{s}$, but you also have to impose the constraint that $\|\boldsymbol{s}\|=1$, which does not seem to be presented in your partition function:$Z=\int \mathrm{d}\mathbf{s}\; e^{-\beta H(\mathbf{s})}$. For example, you can probably add the constraint using the Dirac delta function like $Z=\int \mathrm{d}\mathbf{s}\; \delta(\mathbf{s}^2-1) e^{-\beta H(\mathbf{s})}$, but I wouldn't bother to do that. With the constraint, for the spin it ends up with only one degree of freedom which is the angle, so the integral over angle is correct.
3199537b35a7d7bfb673888590a3429fa7a1a2c5a8a508ce9885ef97ce511164
['d348fa22472c4c528089aaa90317a757']
Speaking of symmetry and anti-symmetry, you might want to consider using the center of mass of H and C separately as a "generalized" coordinates: Center-of-mass of H: $q_1 = \dfrac{x_1 + x_4}{2}$. Center-of-mass of C: $q_2 = \dfrac{x_2 + x_3}{2}$. Correspondingly, since we want four generalized coordinates, so we also need two more, which naturally come from the COMs above: $$ q_3 = \dfrac{x_2 - x_3}{2},\quad q_4 = \dfrac{x_1 - x_4}{2} $$ With this transformation, you can simplify the kinetic terms and harmonic potential terms.
f15e851b7846f7b35bde5be19b1f94164f61e99967e73af031df781a489bda34
['d349c1d9b1124585a3d1b83c5e3bbe71']
You should add inner scrollview on outer scrollview, but inner scrollview 'y' position should be content off set of outer scrollview like... innerScrollView.frame = CGRectMake(10, outerScrollView.contentSize.height, 300, 440); After this you can add any view on this innerScrollView, you can set contentOffset etc for innerScrollView. Finally you should increase the contentSize for outer scrollview. outerScrollView.contentSize = CGSizeMake(320, innerScrollView.frame.size.height+actualContentSizeOfOuterScroolView); I think it helps for you!
43b9edd1df110aea9898f927fc19441c8996766f695b534695c36b0f2d8dce75
['d349c1d9b1124585a3d1b83c5e3bbe71']
The above code is working fine, they are making three individual lines (the starting point is same for all(502, 530)). I think you are giving ending position for two points (like x3,y3 or x4,y4) are same directions, that is why you are getting two lines only, if you want to differentiate those lines you can make the lines in different color like... int x2, y2, x3, y3,x4, y4; x2 = 100; y2 = 100; x3 = 200; y3 = 200; x4 = 200; y4 = 50; CGContextRef context = UIGraphicsGetCurrentContext(); CGContextSetLineWidth(context, 10); // line 1 CGContextSetStrokeColorWithColor(context, [UIColor yellowColor].CGColor); CGContextMoveToPoint(context, 502,530); CGContextAddLineToPoint(context, x2, y2); CGContextStrokePath(context); // line 2 CGContextSetStrokeColorWithColor(context, [UIColor blueColor].CGColor); CGContextMoveToPoint(context, 502, 530); CGContextAddLineToPoint(context, x3, y3); CGContextStrokePath(context); // line 3 CGContextSetStrokeColorWithColor(context, [UIColor redColor].CGColor); CGContextMoveToPoint(context, 502, 530); CGContextAddLineToPoint(context, x4, y4); CGContextStrokePath(context); NSLog(@"%d,%d--%d,%d--%d,%d",x2,y2,x3,y3,x4,y4);
22f7f06b348aea440dcef002b38b024bd18efae7ba5f98b9afa91ac7a198adae
['d350013c06cc4d85a6880725ba7109f4']
I have already answered this here. Turns out the Tensorflow 2.0 module is very large (more than 500MB, the limit for Heroku) because of its GPU support. Since Heroku doesn't support GPU, it doesn't make sense to install the module with GPU support. Solution: Simply replace tensorflow with tensorflow-cpu in your requirements. This worked for me, hope it works for you too!
17500aa274ca9a17d936f3d695196230e69be3caf7777ec4b5ed7379d596c9f8
['d350013c06cc4d85a6880725ba7109f4']
Turns out the Tensorflow 2.0 module is very large (more than 500MB, the limit for Heroku) because of its GPU support. Since Heroku doesn't support GPU, it doesn't make sense to install the module with GPU support. Solution: Simply replace tensorflow with tensorflow-cpu in your requirements. This worked for me, hope it works for you too!
892abc4d66ad8ec3c54e0b234be9b01e0e7400abd16f39e2f35ce88c3023c438
['d35a7cefd2db46febf372f701ed4a43b']
If it's only happening with a regular Ubuntu (X11) session, then try looking in the file `.xsession-errors` for errors. There are links to do so findable in Google or AskUbuntu. This problem may not be directly related to your graphics drivers, but rather something in your X11 configuration. That log should be illuminating.
7a895931317f9b0d65c131c664fa61a54a4889d826b8fd2e97c5b543b5c752a3
['d35a7cefd2db46febf372f701ed4a43b']
Okay, in that case then please remove the `nvidia` binary drivers with: `$ sudo dpkg -P $(dpkg -l | grep nvidia-driver | awk '{print $2}')` and `$ sudo apt autoremove`, then ensure nouveau userspace drivers are there with `$ sudo apt install xserver-xorg-video-nouveau`. You will want to boot with `nouveau.modeset=0` kernel parameter set until a Linux 5.8 kernel is used, to address a known bug with the NVIDIA Pasal-family of mobile GPUs which ship in the Dell XPS 9560.
083da94f6aa0589c23696296d2205b7d8be25211c135fe7fd540e15d36d99da6
['d36e41e986554670a229029bc9b622ab']
It seems to me that in the DBUtils code, you are wrapping both saves in an outer transaction, whereas in the Utils code, you have them in two completely separate transactions without an outer one. Depending on your cascading, Hibernate has to figure out which objects need to be saved. When you run the Utils code, with two separate transactions, it will save the Order first. Since you're cascading all, this means it will save the Order first, then the Customer. However, you've created the SAME Order for both the Customer and Employee. Therefore, the Employee also gets saved in the first transaction (due to cascading). The second transaction, since it is separate, will not be aware of this and save another Employee. On the other hand, if you wrap them in an outer transaction, Hibernate can figure out the identities of all the objects and save them properly.
076c654260caf581b83f2855eb6a54e11224c82f75f3903660f789e65a1619f5
['d36e41e986554670a229029bc9b622ab']
In Java, static methods belong to the class rather than the instance. This means that you cannot call other instance methods from static methods unless they are called in an instance that you have initialized in that method. Here's something you might want to do: public class Foo { public void fee() { //do stuff } public static void main (String[]arg) { Foo foo = new Foo(); foo.fee(); } } Notice that you are running an instance method from an instance that you've instantiated. You can't just call call a class instance method directly from a static method because there is no instance related to that static method.
eedb37bf0995842e587da056ad0e990003c7029340fd27ad00fd1a137a396209
['d37006aa84ec4fb8bc14cce3d153d186']
Hey I am using https://github.com/drewm/mailchimp-api mailchimp api and it is super easy It can be done as simple as this: require_once 'class/MailChimp.php'; $MailChimp = new MailChimp($mc{'key'}); $result = $MailChimp->post("lists/$AddToListId/members", [ 'email_address' =>$email, 'status' => 'subscribed' ]); BTW in the library u are using only the first two parameters are necessary and they can be omitted rather than passed as dummies
56f50f9b22ed5bff3d81fe87f932ee64c341c584f1c548402d0401503568fc7a
['d37006aa84ec4fb8bc14cce3d153d186']
I have been using SectionedRecyclerViewAdapter from https://github.com/luizgrp/SectionedRecyclerViewAdapter. It is working great. I would like to start adding some animations. I downloaded and installed the test/example app, and inspected the code for the animation example. I cannot understand what part of the code for the example makes the animations work as they do. Can anyone explain it?
9a9f602714de0f10d531b8cf9f442ff0b7570fb566bbd4608ca9838e9af0056d
['d37a23e6fc3140a4966ec6d943433fdc']
Ironically, right around the time I'm working on an Authentication Provider, articles like this start popping up. So now I'm wondering - what is a new provider to do? The Auth provider I'm working on will mostly used across a stack of internal apps for now. So far I quickly got a prototype working using some example OAuth 2.0 provider Rails setups, and custom built an omni-auth connector to access the provider on a client. So really I guess the question is - do I push through the crap and make it work, and work well? If so, what can I do to secure it correctly? Are there any good sources on securing something like this? If I shouldn't be even trying with OAuth 2.0 what else should I be considering as an option? Thanks for any suggestions
f9f0c3629af166508f5492ce8878370569c93c6638dc100be856f4a08522ac23
['d37a23e6fc3140a4966ec6d943433fdc']
What types of algorithms would work the quickest for a search of just what's being searched? I realize this is getting quite close to asking how Google-instant search works, but I'm no Algorithms expert and I've been becoming increasingly interested in them. Is a search like this done using suffix trees or something similar? I guess I'm just interested in querying little strings as opposed to lots of crawled data the way Google does. Thanks much for any input!
540e28697668aa9891eed857dcb910754a0a6b70c802246c26f70daf571de7a5
['d38943b0eee740dab691f2e5b68eafb5']
I don't know whether this is intentional, but apparently @restaurant.name is returning a number (as you clarified, you're getting a TypeError: no implicit conversion of Fixnum into String). Calling @restaurant.name.to_s will solve that. As <PERSON> mentioned in another answer, string interpolation like "...Confirmation for #{@restaurant.name}" works too, since it calls #to_s for you automatically. I'm putting the solution into an answer, since we found it while clarifying in the comments.
8975aa903be622c5eedfd37f0984753e9b664ac9d29970d88f3925e837c6d077
['d38943b0eee740dab691f2e5b68eafb5']
With the constraints you've described, it sounds like live rebuilding from zero cannot be part of your plans. You could instead have an A/B setup, playing through the events on a new system that is offline at that point, and then switching over to the new system once it has caught up. The key is that both the old and new systems can tune in to the event stream at the same time. If you have varied systems subscribed to subsets of the events, it may be that you only need to replay events for one of those subsystems, and your synchronization/sequence needs can still be met without that subsystem in play. You can prevent acting on obsolete information by including event sequence numbers in the data and having the sequence-dependent service defer processing if it hasn't seen that event yet.
ebeb7728f97a606366a1d324669d71bfb0f8477312937c404bd993b15122bbf1
['d3967cff18bf4de8b0175411adbea132']
I have a background image that is covering my content but without (background-size: cover;) it doesn't take up the space. I am working on a bootstrap project, and all my content is stacked at the top of the page in the banner area. I've tried adding height to the page to move content. I've tried adding a div around it and moving around in the body tag. I have been working on the for about 3 hours. @import url('https://fonts.googleapis.com/css?family=Oswald|Rambla|Staatliches&display=swap'); body{ margin: 0; padding: 0; } :root{ --color-black: #000000; --color-white: #ffffff; --color-border: #ffffff34; --font-staat: 'Staatliches', cursive; --font-os: 'Oswald', sans-serif; --font-ram: 'Rambla', sans-serif; } /* global classes */ .font-staat{ font: normal 400 18px var(--font-staat); } .font-os{ font: normal 300 18px var(--font-os); } .font-ram{ font: normal bold 18px var(--font-ram); } .font-size-40{ font-size: 40px; } .font-size-34{ font-size: 34px; } .font-size-27{ font-size: 27px; } .font-size-20{ font-size: 20px; } .font-size-16{ font-size: 16px; } .bgcolor-black{ background-color: var(--color-black); } /* #global classes */ #header{ position: fixed; top: 0; left: 0; width: 100%; z-index:1; transition: left .5s ease; } #header nav{ height: 100vh; } #header .site-title .navbar-brand{ letter-spacing: 2px; color: var(--color-secondary); } #header .nav-link{ margin: .7rem 1rem; border-bottom: 1px solid var(--color-border); text-transform: uppercase; } #header .nav-link:hover{ color: var(--color-white) !important; } #header .toggle-button{ background: none; color: var(--color-black); position: fixed; top: 25px; right: 20px; border: 1px solid var(--color-border); } .toggle-left{ left: 0 !important; width: 1000px !important; } /* site-main */ .site-banner .banner-area{ background: url(https://i.pinimg.com/736x/2a/a1/da/2aa1da060c0dfad146354e0cc06560c2.jpg) no-repeat; background-size: cover; width: 100%; height: 100vh; position: relative; } .site-banner .banner-area .author{ margin: 0; position: absolute; top: 45%; left: 50%; transform: translate(-50%, -50%); } .site-banner .banner-area .author .author-img{ width: 250px; height: 250px; border-radius: 50%; margin: auto; background: url(./20200507_023239272_iOS.jpg) no-repeat; background-size: 115%; background-position: 15% 20%; } @media screen and (min-width: 768px){ .toggle-button{ display: none; } #header{ z-index:0; } } /* #site-main */ <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Kaija Dunklin</title> <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous"> <link rel="stylesheet" href="./style.css"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"> </head> <body> <!-- header area --> <header id="header"> <div class="row m-0"> <div class="col-3 bgcolor-black"> <nav class="primary-nav navbar-expand-md"> <div class="site-title text-center text-light py-5"> <a href="#" class="navbar-brand font-staat font-size-40">Kaykay</a> <p class="description text-uppercase font-os"> Kaija Dunklin</p> </div> <div class="d-flex flex-column"> <a href="#home" class="nav-item nav-link text-white-50 font-os font-size-16 active">Home</a> <a href="#skills" class="nav-item nav-link text-white-50 font-os font-size-16 active">Skills</a> <a href="#projects" class="nav-item nav-link text-white-50 font-os font-size-16 active">projects</a> <a href="#education" class="nav-item nav-link text-white-50 font-os font-size-16 active">Education</a> <a href="#experience" class="nav-item nav-link text-white-50 font-os font-size-16 active">Experience</a> <a href="#resume" class="nav-item nav-link text-white-50 font-os font-size-16 active">Resume</a> <a href="#contact" class="nav-item nav-link text-white-50 font-os font-size-16 active">Contact</a> </div> </nav> </div> </div> <button class="toggle-button"><span class="fas fa-bars fa-2x"></span></button> <div class="social"> <span class="mr-3"><i class="fab fa-linkedin"></i></span> <span class="mr-3"><i class="fab fa-github"></i></span> </div> </header> <!-- #header area --> <main id="site-main"> <div class="row m-0"> <div class="col-md-9 offset-md-3 px-0"> <!-- site-banner area --> <section class="site-banner" id="home"> <div class="banner-area"> <div class="author text-center"> <div class="author-img"></div> <h1 class="text-white font-staat font-size-40 text-uppercase py-3">Kaija Dunklin</h1> </div> </div> </section> <section id="skills"> <i class="fab fa-github-square" ><a href="https://github.com/kaidunklin23">GitHub</a></i> </section> <!-- #site-banner area --> <section id="projects"> <div> </div> </section> </div> </div> <div> </div> </main> <script src="https://code.jquery.com/jquery-3.4.1.slim.min.js" integrity="sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n" crossorigin="anonymous"></script> <script src="https://<EMAIL_ADDRESS><PERSON>', cursive; --font-os: '<PERSON>', sans-serif; --font-ram: '<PERSON>', sans-serif; } /* global classes */ .font-staat{ font: normal 400 18px var(--font-staat); } .font-os{ font: normal 300 18px var(--font-os); } .font-ram{ font: normal bold 18px var(--font-ram); } .font-size-40{ font-size: 40px; } .font-size-34{ font-size: 34px; } .font-size-27{ font-size: 27px; } .font-size-20{ font-size: 20px; } .font-size-16{ font-size: 16px; } .bgcolor-black{ background-color: var(--color-black); } /* #global classes */ #header{ position: fixed; top: 0; left: 0; width: 100%; z-index:1; transition: left .5s ease; } #header nav{ height: 100vh; } #header .site-title .navbar-brand{ letter-spacing: 2px; color: var(--color-secondary); } #header .nav-link{ margin: .7rem 1rem; border-bottom: 1px solid var(--color-border); text-transform: uppercase; } #header .nav-link:hover{ color: var(--color-white) !important; } #header .toggle-button{ background: none; color: var(--color-black); position: fixed; top: 25px; right: 20px; border: 1px solid var(--color-border); } .toggle-left{ left: 0 !important; width: 1000px !important; } /* site-main */ .site-banner .banner-area{ background: url(https://i.pinimg.com/736x/2a/a1/da/2aa1da060c0dfad146354e0cc06560c2.jpg) no-repeat; background-size: cover; width: 100%; height: 100vh; position: relative; } .site-banner .banner-area .author{ margin: 0; position: absolute; top: 45%; left: 50%; transform: translate(-50%, -50%); } .site-banner .banner-area .author .author-img{ width: 250px; height: 250px; border-radius: 50%; margin: auto; background: url(./20200507_023239272_iOS.jpg) no-repeat; background-size: 115%; background-position: 15% 20%; } @media screen and (min-width: 768px){ .toggle-button{ display: none; } #header{ z-index:0; } } /* #site-main */ <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title><PERSON>> <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous"> <link rel="stylesheet" href="./style.css"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"> </head> <body> <!-- header area --> <header id="header"> <div class="row m-0"> <div class="col-3 bgcolor-black"> <nav class="primary-nav navbar-expand-md"> <div class="site-title text-center text-light py-5"> <a href="#" class="navbar-brand font-staat font-size-40">Kaykay</a> <p class="description text-uppercase font-os"> <PERSON><PHONE_NUMBER>_iOS.jpg) no-repeat; background-size: 115%; background-position: 15% 20%; } @media screen and (min-width: 768px){ .toggle-button{ display: none; } #header{ z-index:0; } } /* #site-main */ <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Kaija Dunklin</title> <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous"> <link rel="stylesheet" href="./style.css"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"> </head> <body> <!-- header area --> <header id="header"> <div class="row m-0"> <div class="col-3 bgcolor-black"> <nav class="primary-nav navbar-expand-md"> <div class="site-title text-center text-light py-5"> <a href="#" class="navbar-brand font-staat font-size-40">Kaykay</a> <p class="description text-uppercase font-os"> Kaija Dunklin</p> </div> <div class="d-flex flex-column"> <a href="#home" class="nav-item nav-link text-white-50 font-os font-size-16 active">Home</a> <a href="#skills" class="nav-item nav-link text-white-50 font-os font-size-16 active">Skills</a> <a href="#projects" class="nav-item nav-link text-white-50 font-os font-size-16 active">projects</a> <a href="#education" class="nav-item nav-link text-white-50 font-os font-size-16 active">Education</a> <a href="#experience" class="nav-item nav-link text-white-50 font-os font-size-16 active">Experience</a> <a href="#resume" class="nav-item nav-link text-white-50 font-os font-size-16 active">Resume</a> <a href="#contact" class="nav-item nav-link text-white-50 font-os font-size-16 active">Contact</a> </div> </nav> </div> </div> <button class="toggle-button"><span class="fas fa-bars fa-2x"></span></button> <div class="social"> <span class="mr-3"><i class="fab fa-linkedin"></i></span> <span class="mr-3"><i class="fab fa-github"></i></span> </div> </header> <!-- #header area --> <main id="site-main"> <div class="row m-0"> <div class="col-md-9 offset-md-3 px-0"> <!-- site-banner area --> <section class="site-banner" id="home"> <div class="banner-area"> <div class="author text-center"> <div class="author-img"></div> <h1 class="text-white font-staat font-size-40 text-uppercase py-3">Kaija Dunklin</h1> </div> </div> </section> <section id="skills"> <i class="fab fa-github-square" ><a href="https://github.com/kaidunklin23">GitHub</a></i> </section> <!-- #site-banner area --> <section id="projects"> <div> </div> </section> </div> </div> <div> </div> </main> <script src="https://code.jquery.com/jquery-3.4.1.slim.min.js" integrity="sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n" crossorigin="anonymous"></script> <script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script> <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js" integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6" crossorigin="anonymous"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/js/all.min.js" integrity="sha256-MAgcygDRahs+F/Nk5Vz387whB4kSK9NXlDN3w58LLq0=" crossorigin="anonymous"></script> <script src="./vendor/typed/typed.min.js"></script> <script src="./index.js"></script> </body> </html>
128f85db7d0f0c57c696740c9f0c5960e7f08a17495c1b145bec4095e4f6ffbe
['d3967cff18bf4de8b0175411adbea132']
I want to change the color on my submit button but not the words. There is no button-color option in css. This is for my personal about me page for coding camp. Having trouble finding answers. Here is my code. #sub{ color: black; } <form action="/action_page.php"> <input type="checkbox" id="vehicle1" name="vehicle1" value="summer"> <label for="vehicle1"> I like summer.</label><br> <input type="checkbox" id="vehicle2" name="vehicle2" value="phone"> <label for="vehicle2"> I have a phone.</label><br> <input type="checkbox" id="vehicle3" name="vehicle3" value="bugs"> <label for="vehicle3"> I dont like bugs.</label><br><br> <input type="submit" value="Submit"id="sub"> </form>
3acc19072d3d34edfe4c01eb0ba5ad350cbb2e50ae5d3aa877ee49f96eb72071
['d39c69e90f804f8b8669d31e1cdd8452']
I have a powershell script that I am trying to send an email. The problem is that I want to be able to call the script and pass in some parameters including smtp server, email address, user name and password. The problem is that the powershell script does not like taking the password in on the command line. I have to hard code the password. Is there any way around this? One more bit of information is that sometimes this works. The problem is that when I hit the database from this script, that is when the password gets in the way. But I don't use the password in the database at all. Can anyone shed any light on this? $smtpServer = $args[0] $EmailTo = $args[1] $UserName = $args[2] $Password = $args[3] $Subject = "Some Subject" $EmailFrom = "<EMAIL_ADDRESS>" $Body = "Bunch of data here" $SMTPClient = New-Object Net.Mail.SmtpClient($SmtpServer, 587) $SMTPClient.EnableSsl = $true $SMTPClient.Credentials = New-Object System.Net.NetworkCredential("MyUserName", "MyPassword") #$SMTPClient.Credentials = New-Object System.Net.NetworkCredential("MyUserName", "MyPassword") --this won't work $SMTPClient.Send($EmailFrom, $EmailTo, $Subject, $Body)
5705ec29390c3f2ceea460d60a59ed08eea77cb912136f002fac251805aad703
['d39c69e90f804f8b8669d31e1cdd8452']
I have an MVC 4 app that I am trying to use Membership to manage Roles and Authentication. The problem I am seeing is that when I open the ASP Configuration app, I add users and I see them show up in the aspnet_users table. But when I go to the mvc app and register a user, it gets saved in the userprofile table. There is obviously a lot that I don't understand here. When I go to my project in Visual Studio 2012 Express and select the Project Menu and then Configure asp.net, where is the configuration for that app? It seems as though I need to look at the configuration and make sure the connection string is working and that I have the correct provider specified. Any advice would be appreciated.
ba9e295059fbd1de9ea1e8821605b508a90960445d0d32860ee5e4291fb793db
['d3b3a55b04f8442da91dfbcf77dae0a4']
You can Develop your own style first : add custom push receiver in manifest Like blew : <receiver android:name=".CustomPushReceiver" android:exported="false"> <intent-filter> <action android:name="android.intent.action.BOOT_COMPLETED"/> <action android:name="android.intent.action.USER_PRESENT"/> <action android:name="com.parse.push.intent.RECEIVE"/> <action android:name="com.parse.push.intent.DELETE"/> <action android:name="com.parse.push.intent.OPEN"/> </intent-filter> CustomPushReceiver: import android.content.Context; import android.content.Intent; import android.util.Log; import android.widget.Toast; import com.parse.ParsePushBroadcastReceiver; import mainViews.MainPage; import org.json.JSONException; import org.json.JSONObject; /** * Created by SadSad on 01/06/15. */ public class CustomPushReceiver extends ParsePushBroadcastReceiver { private final String TAG = CustomPushReceiver.class.getSimpleName(); private NotificationUtils notificationUtils; private Intent parseIntent; public CustomPushReceiver() { super(); } @Override protected void onPushReceive(Context context, Intent intent) { super.onPushReceive(context, intent); System.out.println(intent.getExtras().getString("com.parse.Data")); if (intent == null) return; try { JSONObject json = new JSONObject(intent.getExtras().getString("com.parse.Data")); System.out.println(json ); Log.e(TAG, "Push received: " + json); parseIntent = intent; parsePushJson(context, json); } catch (JSONException e) { Log.e(TAG, "Push message json exception: " + e.getMessage()); } } @Override protected void onPushDismiss(Context context, Intent intent) { super.onPushDismiss(context, intent); } @Override protected void onPushOpen(Context context, Intent intent) { super.onPushOpen(context, intent); } /** * Parses the push notification json * * @param context * @param json */ private void parsePushJson(Context context, JSONObject json) { try { System.out.println(json); boolean isBackground = json.getBoolean("is_background"); JSONObject data = json.getJSONObject("data"); String title = data.getString("title"); String message = data.getString("message"); if (!isBackground) { Intent resultIntent = new Intent(context, MainPage.class); showNotificationMessage(context, title, message, resultIntent); } } catch (JSONException e) { Log.e(TAG, "Push message json exception: " + e.getMessage()); } } /** * Shows the notification message in the notification bar * If the app is in background, launches the app * * @param context * @param title * @param message * @param intent */ private void showNotificationMessage(Context context, String title, String message, Intent intent) { // you can use custom notification notificationUtils = new NotificationUtils(context); intent.putExtras(parseIntent.getExtras()); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK); notificationUtils.showNotificationMessage(title, message, intent); } } Custom Notification: This link is useful for custom notification
abbdad86260b4781e6e2c7f22b5c5b9465a11324d4b4043d454d6d7fb2dd31d0
['d3b3a55b04f8442da91dfbcf77dae0a4']
This works for me. Parse.enableLocalDatastore(this); // Add your initialization code here Parse.initialize(this, APP_ID, CL_ID); ParseInstallation.getCurrentInstallation().saveInBackground(); ParseUser.enableAutomaticUser(); ParseACL defaultACL = new ParseACL(); // Optionally enable public read access. // defaultACL.setPublicReadAccess(true); ParseACL.setDefaultACL(defaultACL, true); // IF NEEADED String topic ="YOUR_TOPIC"; System.out.println(topic); ParsePush.subscribeInBackground(topic, new SaveCallback() { @Override public void done(ParseException e) { if (e == null) { Log.d("com.parse.push", "successfully subscribed "); } else { Log.e("com.parse.push", "failed ", e); } } });
0c2b371d0270c630bc02639d4fd40ca91c21685edf5757713a73c352a3b52183
['d3bf2f033e4d44af86e81398373c8999']
Below is my code : #include <stdio.h> #include <stdlib.h> #include <stdbool.h> struct NodeTag { int value; struct NodeTag *next; }; typedef struct NodeTag Node; typedef struct { Node *head; int length; } List; void insertAtHead( List *list, int val ) { Node **link = &( list->head ); Node *n = NULL; n = (Node *) malloc(sizeof(Node)); n->next = (Node *) malloc(sizeof(Node)); n->value = val; n->next->value = (*link)->value; list->head = &n; list->length++; } void insertAtTail( List *list, int val ) { Node **link = &( list->head ); while ((*link)->next != NULL){ (*link) = (*link)->next; } Node n; n.value = val; n.next = NULL; (*link)->next = &n; list->length++; } void insertSorted( List *list, int val ) { Node **link = &( list->head ); while ((*link)->next != NULL){ (*link) = (*link)->next; } Node n; n.value = val; n.next = (*link)->next; (*link)->next = &n; list->length++; } /** Print out the size and contents of the given list. */ void printList( List *list ) { printf( "%d elements :", list->length ); for ( Node *n = list->head; n; n = n->next ) printf( " %d", n->value ); printf( "\n" ); } void freeList( List *list ) { while ( list->head ) { Node *n = list->head; list->head = n->next; free( n ); } list->head = NULL; list->length = 0; } int main( int argc, char *argv[] ) { FILE *fp; if ( argc != 2 || ( fp = fopen( "input.txt", "r" ) ) == NULL ) { printf( "Can't open file: %s\n", argv[ 1 ] ); exit( EXIT_FAILURE ); } { List list = { NULL, 0 }; int val; while ( fscanf( fp, "%d", &val ) == 1 ) insertAtHead( &list, val ); printList( &list ); freeList( &list ); } fseek( fp, SEEK_SET, 0 ); { List list = { NULL, 0 }; int val; while ( fscanf( fp, "%d", &val ) == 1 ) insertAtTail( &list, val ); printList( &list ); freeList( &list ); } fseek( fp, SEEK_SET, 0 ); { List list = { NULL, 0 }; int val; while ( fscanf( fp, "%d", &val ) == 1 ) insertSorted( &list, val ); printList( &list ); freeList( &list ); } fclose( fp ); return EXIT_SUCCESS; } and the following line is giving me ECX_BAD_ACCESS error when debugging: n->next->value = (*link)->value; To my knowledge I am mallocing the current node and the next node for it so I am not sure why the error is showing. Does anybody have any idea? Am I supposed to have a for loop to iterate through entire linked list and malloc each node?
c1eb517aeda39f4a26a870c7dab44a1ce34c5b64cfc7518609e7327ed427b26f
['d3bf2f033e4d44af86e81398373c8999']
I am trying to create a neural network that predicts the price of a house based on the number of bedrooms and bathrooms in the house. Below is the "realestate.csv" file. beds baths price 0 2 1 59222 1 3 <PHONE_NUMBER> 2 2 <PHONE_NUMBER> 3 2 <PHONE_NUMBER> 4 2 1 81900 .. ... ... ... 980 4 3 232425 981 3 2 234000 982 3 2 235000 983 4 2 235301 984 3 2 235738 [985 rows x 3 columns] Below is my code in python import pandas as pd import numpy as np import matplotlib.pyplot as plt train_bed_bath = np.array(pd.read_csv('realestate.csv',usecols=['beds', 'baths']), dtype='int')[0:984] train_price = np.array(pd.read_csv('realestate.csv',usecols=['price']),dtype='int')[0:984] test_bed_bath = np.array(pd.read_csv('realestate.csv',usecols=['beds', 'baths']), dtype='int')[984:985] predicted_outputs = [] class Neural_Network(object): def __init__(self): #parameters self.inputSize = 2 self.hiddenSize = 3 self.outputSize = 1 #weights self.W1 = np.random.randn(2, 3) # (3x2) weight matrix from input to hidden layer self.W2 = np.random.randn(self.hiddenSize, self.outputSize) # (3x1) weight matrix from hidden to output layer def forward(self, X): #forward propagation through our network self.z = np.dot(X, self.W1) # dot product of X (input) and first set of 3x2 weights self.z2 = self.sigmoid(self.z) # activation function self.z3 = np.dot(self.z2, self.W2) # dot product of hidden layer (z2) and second set of 3x1 weights self.o = self.sigmoid(self.z3) # final activation function return self.o def sigmoid(self, s): # activation function return .5 * (1 + np.tanh(.5 * s)) def sigmoidPrime(self, s): #derivative of sigmoid return s * (1 - s) def backward(self, X, y, o): # backward propagate through the network self.o_error = y - o # error in output self.o_delta = self.o_error*self.sigmoidPrime(o) # applying derivative of sigmoid to error self.z2_error = self.o_delta.dot(self.W2.T) # z2 error: how much our hidden layer weights contributed to error self.z2_delta = self.z2_error*self.sigmoidPrime(self.z2) # applying derivative of sigmoid to z2 error self.W1 += X.T.dot(self.z2_delta) # adjusting first set (input --> hidden) weights self.W2 += self.z2.T.dot(self.o_delta) # adjusting second set (hidden --> output) weights def train(self, X, y): self.o = self.forward(X) self.backward(X, y, self.o) NN = Neural_Network() for i in range(1000): NN.train(train_bed_bath, train_price) for i in range(5): for j in range (5): print(NN.forward([i,j])) It prints out the following output [1.] [1.] [1.] [1.] [1.] [1.] [1.] [1.] [1.] [1.] [1.] [1.] [1.] [1.] [1.] [1.] [1.] [1.] [1.] [1.] [1.] [1.] [1.] [1.] [1.] I am not sure why it is doing that. Any help would be greatly appreciated.
f03d35d9b9cadd69ca2030fef2d496b1d6fa18bd147f2cf63a23591f963ef8f0
['d3c29883f0484ca2a8ed03b74a90599d']
As you can see, there is just 2.2 version of Zabbix (agent, server, proxy, etc.) in that repository. It seems Zabbix 2.2 (LTS) is the latest version supported by OpenSUSE using its repositories. By the way, you can install older versions of Zabbix-agent (like 2.2) sending data correctly to newer server/proxy versions (like 3.0 or even 3.2). I think the major item you will miss with using zabbix-agent older than 3.X is encryption. Other major features work very good.
c31d4ea92817fa6c841d7e8f8dee826eb8926d8d4cb07774cc6f7e7245629179
['d3c29883f0484ca2a8ed03b74a90599d']
I accidentally committed and pushed some binary files to origin/master. I figured out my mistake and git rm -f MASSIVE.FILES and commit/push ed again. Now, for cloning a 5KB project, it needs to download few hundred mega bytes because those deleted files are still in history. The question is, how can I remove those massive files completely from history (.git)? I already tried this answer, this one and this but none of them helped me.
5f77134e7a491b012cc5a62d5e47e21ecdf29bebfcc4f1d5ff4a96723d0fdbb7
['d3d474e2343e4438a5a329b346fbaa25']
I found that aiming lower or dead centre of the platform didn't work for me. Instead I had to aim at the guy without the flume on the right. This was the only way I could get the correct 1.5 degree call. Oddly in my game it seem that the horizontal angle mattered more then the vertical.
aed9b88be120a5b679e2dfa10d0ccccc1a91ddb5e202d7e9f5dfc62755e9f7d9
['d3d474e2343e4438a5a329b346fbaa25']
just got new iMac 27 5k :) Setting up PHP environment but having trouble. I am getting Forbidden message when trying to access http://localhost or http://loalhost/phpmyadmin/ Here are some configuration details. Since I learn there is not Sites folder in user directory so by following the tutorial I have setup everything as below. Sites Directory: ~/Sites/ Default WebServer /Library/WebServer/ phpMyAdmin Location /Library/WebServer/Documents/phpMyAdmin (I don't know if it is the right place or not but installed by following the tutorial) httpd-userdir.conf /private/etc/apache2/extra/httpd-userdir.conf UserDir Sites # # Control access to UserDir directories. The following is an example # for a site where these directories are restricted to read-only. # Include /private/etc/apache2/users/*.conf <IfModule bonjour_module> RegisterUserSite customized-users </IfModule> username.conf /private/etc/apache2/users/myusername.conf <Directory "/Users/myusername/Sites/"> Options All MultiviewsMatch Any AllowOverride All Require all granted </Directory> httpd.conf /private/etc/apache2/httpd.conf # # This is the main Apache HTTP server configuration file. It contains the # configuration directives that give the server its instructions. # See <URL:http://httpd.apache.org/docs/2.4/> for detailed information. # In particular, see # <URL:http://httpd.apache.org/docs/2.4/mod/directives.html> # for a discussion of each configuration directive. # # Do NOT simply read the instructions in here without understanding # what they do. They're here only as hints or reminders. If you are unsure # consult the online docs. You have been warned. # # Configuration and logfile names: If the filenames you specify for many # of the server's control files begin with "/" (or "drive:/" for Win32), the # server will use that explicit path. If the filenames do *not* begin # with "/", the value of ServerRoot is prepended -- so "logs/access_log" # with ServerRoot set to "/usr/local/apache2" will be interpreted by the # server as "/usr/local/apache2/logs/access_log", whereas "/logs/access_log" # will be interpreted as '/logs/access_log'. # # ServerRoot: The top of the directory tree under which the server's # configuration, error, and log files are kept. # # Do not add a slash at the end of the directory path. If you point # ServerRoot at a non-local disk, be sure to specify a local disk on the # Mutex directive, if file-based mutexes are used. If you wish to share the # same ServerRoot for multiple httpd daemons, you will need to change at # least PidFile. # ServerRoot "/usr" # # Mutex: Allows you to set the mutex mechanism and mutex file directory # for individual mutexes, or change the global defaults # # Uncomment and change the directory if mutexes are file-based and the default # mutex file directory is not on a local disk or is not appropriate for some # other reason. # # Mutex default:/private/var/run # # Listen: Allows you to bind Apache to specific IP addresses and/or # ports, instead of the default. See also the <VirtualHost> # directive. # # Change this to Listen on specific IP addresses as shown below to # prevent Apache from glomming onto all bound IP addresses. # #Listen 12.34.56.78:80 <IfDefine SERVER_APP_HAS_DEFAULT_PORTS> Listen 8080 </IfDefine> <IfDefine !SERVER_APP_HAS_DEFAULT_PORTS> Listen 80 </IfDefine> # # Dynamic Shared Object (DSO) Support # # To be able to use the functionality of a module which was built as a DSO you # have to place corresponding `LoadModule' lines at this location so the # directives contained in it are actually available _before_ they are used. # Statically compiled modules (those listed by `httpd -l') do not need # to be loaded here. # # Example: # LoadModule foo_module modules/mod_foo.so # LoadModule authn_file_module libexec/apache2/mod_authn_file.so #LoadModule authn_dbm_module libexec/apache2/mod_authn_dbm.so #LoadModule authn_anon_module libexec/apache2/mod_authn_anon.so #LoadModule authn_dbd_module libexec/apache2/mod_authn_dbd.so #LoadModule authn_socache_module libexec/apache2/mod_authn_socache.so LoadModule authn_core_module libexec/apache2/mod_authn_core.so LoadModule authz_host_module libexec/apache2/mod_authz_host.so LoadModule authz_groupfile_module libexec/apache2/mod_authz_groupfile.so LoadModule authz_user_module libexec/apache2/mod_authz_user.so #LoadModule authz_dbm_module libexec/apache2/mod_authz_dbm.so #LoadModule authz_owner_module libexec/apache2/mod_authz_owner.so #LoadModule authz_dbd_module libexec/apache2/mod_authz_dbd.so LoadModule authz_core_module libexec/apache2/mod_authz_core.so #LoadModule authnz_ldap_module libexec/apache2/mod_authnz_ldap.so LoadModule access_compat_module libexec/apache2/mod_access_compat.so LoadModule auth_basic_module libexec/apache2/mod_auth_basic.so #LoadModule auth_form_module libexec/apache2/mod_auth_form.so #LoadModule auth_digest_module libexec/apache2/mod_auth_digest.so #LoadModule allowmethods_module libexec/apache2/mod_allowmethods.so #LoadModule file_cache_module libexec/apache2/mod_file_cache.so #LoadModule cache_module libexec/apache2/mod_cache.so #LoadModule cache_disk_module libexec/apache2/mod_cache_disk.so #LoadModule cache_socache_module libexec/apache2/mod_cache_socache.so #LoadModule socache_shmcb_module libexec/apache2/mod_socache_shmcb.so #LoadModule socache_dbm_module libexec/apache2/mod_socache_dbm.so #LoadModule socache_memcache_module libexec/apache2/mod_socache_memcache.so #LoadModule watchdog_module libexec/apache2/mod_watchdog.so #LoadModule macro_module libexec/apache2/mod_macro.so #LoadModule dbd_module libexec/apache2/mod_dbd.so #LoadModule dumpio_module libexec/apache2/mod_dumpio.so #LoadModule echo_module libexec/apache2/mod_echo.so #LoadModule buffer_module libexec/apache2/mod_buffer.so #LoadModule data_module libexec/apache2/mod_data.so #LoadModule ratelimit_module libexec/apache2/mod_ratelimit.so LoadModule reqtimeout_module libexec/apache2/mod_reqtimeout.so #LoadModule ext_filter_module libexec/apache2/mod_ext_filter.so #LoadModule request_module libexec/apache2/mod_request.so LoadModule include_module libexec/apache2/mod_include.so LoadModule filter_module libexec/apache2/mod_filter.so #LoadModule reflector_module libexec/apache2/mod_reflector.so #LoadModule substitute_module libexec/apache2/mod_substitute.so #LoadModule sed_module libexec/apache2/mod_sed.so #LoadModule charset_lite_module libexec/apache2/mod_charset_lite.so #LoadModule deflate_module libexec/apache2/mod_deflate.so #LoadModule xml2enc_module libexec/apache2/mod_xml2enc.so #LoadModule proxy_html_module libexec/apache2/mod_proxy_html.so LoadModule mime_module libexec/apache2/mod_mime.so #LoadModule ldap_module libexec/apache2/mod_ldap.so LoadModule log_config_module libexec/apache2/mod_log_config.so #LoadModule log_debug_module libexec/apache2/mod_log_debug.so #LoadModule log_forensic_module libexec/apache2/mod_log_forensic.so #LoadModule logio_module libexec/apache2/mod_logio.so LoadModule env_module libexec/apache2/mod_env.so #LoadModule mime_magic_module libexec/apache2/mod_mime_magic.so #LoadModule expires_module libexec/apache2/mod_expires.so LoadModule headers_module libexec/apache2/mod_headers.so #LoadModule usertrack_module libexec/apache2/mod_usertrack.so ##LoadModule unique_id_module libexec/apache2/mod_unique_id.so LoadModule setenvif_module libexec/apache2/mod_setenvif.so LoadModule version_module libexec/apache2/mod_version.so #LoadModule remoteip_module libexec/apache2/mod_remoteip.so #LoadModule proxy_module libexec/apache2/mod_proxy.so #LoadModule proxy_connect_module libexec/apache2/mod_proxy_connect.so #LoadModule proxy_ftp_module libexec/apache2/mod_proxy_ftp.so #LoadModule proxy_http_module libexec/apache2/mod_proxy_http.so #LoadModule proxy_fcgi_module libexec/apache2/mod_proxy_fcgi.so #LoadModule proxy_scgi_module libexec/apache2/mod_proxy_scgi.so #LoadModule proxy_fdpass_module libexec/apache2/mod_proxy_fdpass.so #LoadModule proxy_wstunnel_module libexec/apache2/mod_proxy_wstunnel.so #LoadModule proxy_ajp_module libexec/apache2/mod_proxy_ajp.so #LoadModule proxy_balancer_module libexec/apache2/mod_proxy_balancer.so #LoadModule proxy_express_module libexec/apache2/mod_proxy_express.so #LoadModule proxy_hcheck_module libexec/apache2/mod_proxy_hcheck.so #LoadModule session_module libexec/apache2/mod_session.so #LoadModule session_cookie_module libexec/apache2/mod_session_cookie.so #LoadModule session_dbd_module libexec/apache2/mod_session_dbd.so LoadModule slotmem_shm_module libexec/apache2/mod_slotmem_shm.so #LoadModule slotmem_plain_module libexec/apache2/mod_slotmem_plain.so #LoadModule ssl_module libexec/apache2/mod_ssl.so #LoadModule dialup_module libexec/apache2/mod_dialup.so #LoadModule http2_module libexec/apache2/mod_http2.so #LoadModule lbmethod_byrequests_module libexec/apache2/mod_lbmethod_byrequests.so #LoadModule lbmethod_bytraffic_module libexec/apache2/mod_lbmethod_bytraffic.so #LoadModule lbmethod_bybusyness_module libexec/apache2/mod_lbmethod_bybusyness.so ##LoadModule lbmethod_heartbeat_module libexec/apache2/mod_lbmethod_heartbeat.so LoadModule unixd_module libexec/apache2/mod_unixd.so #LoadModule heartbeat_module libexec/apache2/mod_heartbeat.so #LoadModule heartmonitor_module libexec/apache2/mod_heartmonitor.so #LoadModule dav_module libexec/apache2/mod_dav.so LoadModule status_module libexec/apache2/mod_status.so LoadModule autoindex_module libexec/apache2/mod_autoindex.so #LoadModule asis_module libexec/apache2/mod_asis.so #LoadModule info_module libexec/apache2/mod_info.so #LoadModule cgi_module libexec/apache2/mod_cgi.so #LoadModule dav_fs_module libexec/apache2/mod_dav_fs.so #LoadModule dav_lock_module libexec/apache2/mod_dav_lock.so #LoadModule vhost_alias_module libexec/apache2/mod_vhost_alias.so LoadModule negotiation_module libexec/apache2/mod_negotiation.so LoadModule dir_module libexec/apache2/mod_dir.so #LoadModule imagemap_module libexec/apache2/mod_imagemap.so #LoadModule actions_module libexec/apache2/mod_actions.so #LoadModule speling_module libexec/apache2/mod_speling.so LoadModule userdir_module libexec/apache2/mod_userdir.so LoadModule alias_module libexec/apache2/mod_alias.so LoadModule rewrite_module libexec/apache2/mod_rewrite.so #LoadModule php7_module libexec/apache2/libphp7.so #LoadModule perl_module libexec/apache2/mod_perl.so LoadModule hfs_apple_module libexec/apache2/mod_hfs_apple.so <IfModule unixd_module> # # If you wish httpd to run as a different user or group, you must run # httpd as root initially and it will switch. # # User/Group: The name (or #number) of the user/group to run httpd as. # It is usually good practice to create a dedicated user and group for # running httpd, as with most system services. # User _www Group _www </IfModule> # 'Main' server configuration # # The directives in this section set up the values used by the 'main' # server, which responds to any requests that aren't handled by a # <VirtualHost> definition. These values also provide defaults for # any <VirtualHost> containers you may define later in the file. # # All of these directives may appear inside <VirtualHost> containers, # in which case these default settings will be overridden for the # virtual host being defined. # # # ServerAdmin: Your address, where problems with the server should be # e-mailed. This address appears on some server-generated pages, such # as error documents. e.g. <EMAIL_ADDRESS> # ServerAdmin <EMAIL_ADDRESS><IP_ADDRESS>:80 <IfDefine SERVER_APP_HAS_DEFAULT_PORTS> Listen 8080 </IfDefine> <IfDefine !SERVER_APP_HAS_DEFAULT_PORTS> Listen 80 </IfDefine> # # Dynamic Shared Object (DSO) Support # # To be able to use the functionality of a module which was built as a DSO you # have to place corresponding `LoadModule' lines at this location so the # directives contained in it are actually available _before_ they are used. # Statically compiled modules (those listed by `httpd -l') do not need # to be loaded here. # # Example: # LoadModule foo_module modules/mod_foo.so # LoadModule authn_file_module libexec/apache2/mod_authn_file.so #LoadModule authn_dbm_module libexec/apache2/mod_authn_dbm.so #LoadModule authn_anon_module libexec/apache2/mod_authn_anon.so #LoadModule authn_dbd_module libexec/apache2/mod_authn_dbd.so #LoadModule authn_socache_module libexec/apache2/mod_authn_socache.so LoadModule authn_core_module libexec/apache2/mod_authn_core.so LoadModule authz_host_module libexec/apache2/mod_authz_host.so LoadModule authz_groupfile_module libexec/apache2/mod_authz_groupfile.so LoadModule authz_user_module libexec/apache2/mod_authz_user.so #LoadModule authz_dbm_module libexec/apache2/mod_authz_dbm.so #LoadModule authz_owner_module libexec/apache2/mod_authz_owner.so #LoadModule authz_dbd_module libexec/apache2/mod_authz_dbd.so LoadModule authz_core_module libexec/apache2/mod_authz_core.so #LoadModule authnz_ldap_module libexec/apache2/mod_authnz_ldap.so LoadModule access_compat_module libexec/apache2/mod_access_compat.so LoadModule auth_basic_module libexec/apache2/mod_auth_basic.so #LoadModule auth_form_module libexec/apache2/mod_auth_form.so #LoadModule auth_digest_module libexec/apache2/mod_auth_digest.so #LoadModule allowmethods_module libexec/apache2/mod_allowmethods.so #LoadModule file_cache_module libexec/apache2/mod_file_cache.so #LoadModule cache_module libexec/apache2/mod_cache.so #LoadModule cache_disk_module libexec/apache2/mod_cache_disk.so #LoadModule cache_socache_module libexec/apache2/mod_cache_socache.so #LoadModule socache_shmcb_module libexec/apache2/mod_socache_shmcb.so #LoadModule socache_dbm_module libexec/apache2/mod_socache_dbm.so #LoadModule socache_memcache_module libexec/apache2/mod_socache_memcache.so #LoadModule watchdog_module libexec/apache2/mod_watchdog.so #LoadModule macro_module libexec/apache2/mod_macro.so #LoadModule dbd_module libexec/apache2/mod_dbd.so #LoadModule dumpio_module libexec/apache2/mod_dumpio.so #LoadModule echo_module libexec/apache2/mod_echo.so #LoadModule buffer_module libexec/apache2/mod_buffer.so #LoadModule data_module libexec/apache2/mod_data.so #LoadModule ratelimit_module libexec/apache2/mod_ratelimit.so LoadModule reqtimeout_module libexec/apache2/mod_reqtimeout.so #LoadModule ext_filter_module libexec/apache2/mod_ext_filter.so #LoadModule request_module libexec/apache2/mod_request.so LoadModule include_module libexec/apache2/mod_include.so LoadModule filter_module libexec/apache2/mod_filter.so #LoadModule reflector_module libexec/apache2/mod_reflector.so #LoadModule substitute_module libexec/apache2/mod_substitute.so #LoadModule sed_module libexec/apache2/mod_sed.so #LoadModule charset_lite_module libexec/apache2/mod_charset_lite.so #LoadModule deflate_module libexec/apache2/mod_deflate.so #LoadModule xml2enc_module libexec/apache2/mod_xml2enc.so #LoadModule proxy_html_module libexec/apache2/mod_proxy_html.so LoadModule mime_module libexec/apache2/mod_mime.so #LoadModule ldap_module libexec/apache2/mod_ldap.so LoadModule log_config_module libexec/apache2/mod_log_config.so #LoadModule log_debug_module libexec/apache2/mod_log_debug.so #LoadModule log_forensic_module libexec/apache2/mod_log_forensic.so #LoadModule logio_module libexec/apache2/mod_logio.so LoadModule env_module libexec/apache2/mod_env.so #LoadModule mime_magic_module libexec/apache2/mod_mime_magic.so #LoadModule expires_module libexec/apache2/mod_expires.so LoadModule headers_module libexec/apache2/mod_headers.so #LoadModule usertrack_module libexec/apache2/mod_usertrack.so ##LoadModule unique_id_module libexec/apache2/mod_unique_id.so LoadModule setenvif_module libexec/apache2/mod_setenvif.so LoadModule version_module libexec/apache2/mod_version.so #LoadModule remoteip_module libexec/apache2/mod_remoteip.so #LoadModule proxy_module libexec/apache2/mod_proxy.so #LoadModule proxy_connect_module libexec/apache2/mod_proxy_connect.so #LoadModule proxy_ftp_module libexec/apache2/mod_proxy_ftp.so #LoadModule proxy_http_module libexec/apache2/mod_proxy_http.so #LoadModule proxy_fcgi_module libexec/apache2/mod_proxy_fcgi.so #LoadModule proxy_scgi_module libexec/apache2/mod_proxy_scgi.so #LoadModule proxy_fdpass_module libexec/apache2/mod_proxy_fdpass.so #LoadModule proxy_wstunnel_module libexec/apache2/mod_proxy_wstunnel.so #LoadModule proxy_ajp_module libexec/apache2/mod_proxy_ajp.so #LoadModule proxy_balancer_module libexec/apache2/mod_proxy_balancer.so #LoadModule proxy_express_module libexec/apache2/mod_proxy_express.so #LoadModule proxy_hcheck_module libexec/apache2/mod_proxy_hcheck.so #LoadModule session_module libexec/apache2/mod_session.so #LoadModule session_cookie_module libexec/apache2/mod_session_cookie.so #LoadModule session_dbd_module libexec/apache2/mod_session_dbd.so LoadModule slotmem_shm_module libexec/apache2/mod_slotmem_shm.so #LoadModule slotmem_plain_module libexec/apache2/mod_slotmem_plain.so #LoadModule ssl_module libexec/apache2/mod_ssl.so #LoadModule dialup_module libexec/apache2/mod_dialup.so #LoadModule http2_module libexec/apache2/mod_http2.so #LoadModule lbmethod_byrequests_module libexec/apache2/mod_lbmethod_byrequests.so #LoadModule lbmethod_bytraffic_module libexec/apache2/mod_lbmethod_bytraffic.so #LoadModule lbmethod_bybusyness_module libexec/apache2/mod_lbmethod_bybusyness.so ##LoadModule lbmethod_heartbeat_module libexec/apache2/mod_lbmethod_heartbeat.so LoadModule unixd_module libexec/apache2/mod_unixd.so #LoadModule heartbeat_module libexec/apache2/mod_heartbeat.so #LoadModule heartmonitor_module libexec/apache2/mod_heartmonitor.so #LoadModule dav_module libexec/apache2/mod_dav.so LoadModule status_module libexec/apache2/mod_status.so LoadModule autoindex_module libexec/apache2/mod_autoindex.so #LoadModule asis_module libexec/apache2/mod_asis.so #LoadModule info_module libexec/apache2/mod_info.so #LoadModule cgi_module libexec/apache2/mod_cgi.so #LoadModule dav_fs_module libexec/apache2/mod_dav_fs.so #LoadModule dav_lock_module libexec/apache2/mod_dav_lock.so #LoadModule vhost_alias_module libexec/apache2/mod_vhost_alias.so LoadModule negotiation_module libexec/apache2/mod_negotiation.so LoadModule dir_module libexec/apache2/mod_dir.so #LoadModule imagemap_module libexec/apache2/mod_imagemap.so #LoadModule actions_module libexec/apache2/mod_actions.so #LoadModule speling_module libexec/apache2/mod_speling.so LoadModule userdir_module libexec/apache2/mod_userdir.so LoadModule alias_module libexec/apache2/mod_alias.so LoadModule rewrite_module libexec/apache2/mod_rewrite.so #LoadModule php7_module libexec/apache2/libphp7.so #LoadModule perl_module libexec/apache2/mod_perl.so LoadModule hfs_apple_module libexec/apache2/mod_hfs_apple.so <IfModule unixd_module> # # If you wish httpd to run as a different user or group, you must run # httpd as root initially and it will switch. # # User/Group: The name (or #number) of the user/group to run httpd as. # It is usually good practice to create a dedicated user and group for # running httpd, as with most system services. # User _www Group _www </IfModule> # 'Main' server configuration # # The directives in this section set up the values used by the 'main' # server, which responds to any requests that aren't handled by a # <VirtualHost> definition. These values also provide defaults for # any <VirtualHost> containers you may define later in the file. # # All of these directives may appear inside <VirtualHost> containers, # in which case these default settings will be overridden for the # virtual host being defined. # # # ServerAdmin: Your address, where problems with the server should be # e-mailed. This address appears on some server-generated pages, such # as error documents. e.g. admin@your-domain.com # ServerAdmin you@example.com # # ServerName gives the name and port that the server uses to identify itself. # This can often be determined automatically, but we recommend you specify # it explicitly to prevent problems during startup. # # If your host doesn't have a registered DNS name, enter its IP address here. # #ServerName www.example.com:80 # # Deny access to the entirety of your server's filesystem. You must # explicitly permit access to web content directories in other # <Directory> blocks below. # <Directory /> AllowOverride none Require all denied </Directory> # # Note that from this point forward you must specifically allow # particular features to be enabled - so if something's not working as # you might expect, make sure that you have specifically enabled it # below. # # # DocumentRoot: The directory out of which you will serve your # documents. By default, all requests are taken from this directory, but # symbolic links and aliases may be used to point to other locations. # DocumentRoot "/Users/myusername/Sites" <Directory "/Users/myusername/Sites"> #DocumentRoot "/Library/WebServer/Documents" #<Directory "/Library/WebServer/Documents"> # # Possible values for the Options directive are "None", "All", # or any combination of: # Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews # # Note that "MultiViews" must be named *explicitly* --- "Options All" # doesn't give it to you. # # The Options directive is both complicated and important. Please see # http://httpd.apache.org/docs/2.4/mod/core.html#options # for more information. # Options FollowSymLinks Multiviews MultiviewsMatch Any # # AllowOverride controls what directives may be placed in .htaccess files. # It can be "All", "None", or any combination of the keywords: # AllowOverride FileInfo AuthConfig Limit # AllowOverride All # # Controls who can get stuff from this server. # Require all granted </Directory> # # DirectoryIndex: sets the file that Apache will serve if a directory # is requested. # <IfModule dir_module> DirectoryIndex index.html </IfModule> # # The following lines prevent .htaccess and .htpasswd files from being # viewed by Web clients. # <FilesMatch "^\.([Hh][Tt]|[Dd][Ss]_[Ss])"> Require all denied </FilesMatch> # # Apple specific filesystem protection. # <Files "rsrc"> Require all denied </Files> <DirectoryMatch ".*\.\.namedfork"> Require all denied </DirectoryMatch> # # ErrorLog: The location of the error log file. # If you do not specify an ErrorLog directive within a <VirtualHost> # container, error messages relating to that virtual host will be # logged here. If you *do* define an error logfile for a <VirtualHost> # container, that host's errors will be logged there and not here. # ErrorLog "/private/var/log/apache2/error_log" # # LogLevel: Control the number of messages logged to the error_log. # Possible values include: debug, info, notice, warn, error, crit, # alert, emerg. # LogLevel warn <IfModule log_config_module> # # The following directives define some format nicknames for use with # a CustomLog directive (see below). # LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined LogFormat "%h %l %u %t \"%r\" %>s %b" common <IfModule logio_module> # You need to enable mod_logio.c to use %I and %O LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio </IfModule> # # The location and format of the access logfile (Common Logfile Format). # If you do not define any access logfiles within a <VirtualHost> # container, they will be logged here. Contrariwise, if you *do* # define per-<VirtualHost> access logfiles, transactions will be # logged therein and *not* in this file. # CustomLog "/private/var/log/apache2/access_log" common # # If you prefer a logfile with access, agent, and referer information # (Combined Logfile Format) you can use the following directive. # #CustomLog "/private/var/log/apache2/access_log" combined </IfModule> <IfModule alias_module> # # Redirect: Allows you to tell clients about documents that used to # exist in your server's namespace, but do not anymore. The client # will make a new request for the document at its new location. # Example: # Redirect permanent /foo http://www.example.com/bar # # Alias: Maps web paths into filesystem paths and is used to # access content that does not live under the DocumentRoot. # Example: # Alias /webpath /full/filesystem/path # # If you include a trailing / on /webpath then the server will # require it to be present in the URL. You will also likely # need to provide a <Directory> section to allow access to # the filesystem path. # # ScriptAlias: This controls which directories contain server scripts. # ScriptAliases are essentially the same as Aliases, except that # documents in the target directory are treated as applications and # run by the server when requested rather than as documents sent to the # client. The same rules about trailing "/" apply to ScriptAlias # directives as to Alias. # ScriptAliasMatch ^/cgi-bin/((?!(?i:webobjects)).*$) "/Library/WebServer/CGI-Executables/$1" </IfModule> <IfModule cgid_module> # # ScriptSock: On threaded servers, designate the path to the UNIX # socket used to communicate with the CGI daemon of mod_cgid. # #Scriptsock cgisock </IfModule> # # "/Library/WebServer/CGI-Executables" should be changed to whatever your ScriptAliased # CGI directory exists, if you have that configured. # <Directory "/Library/WebServer/CGI-Executables"> AllowOverride None Options None Require all granted </Directory> <IfModule headers_module> # # Avoid passing HTTP_PROXY environment to CGI's on this or any proxied # backend servers which have lingering "httpoxy" defects. # 'Proxy' request header is undefined by the IETF, not listed by IANA # RequestHeader unset Proxy early </IfModule> <IfModule mime_module> # # TypesConfig points to the file containing the list of mappings from # filename extension to MIME-type. # TypesConfig /private/etc/apache2/mime.types # # AddType allows you to add to or override the MIME configuration # file specified in TypesConfig for specific file types. # #AddType application/x-gzip .tgz # # AddEncoding allows you to have certain browsers uncompress # information on the fly. Note: Not all browsers support this. # #AddEncoding x-compress .Z #AddEncoding x-gzip .gz .tgz # # If the AddEncoding directives above are commented-out, then you # probably should define those extensions to indicate media types: # AddType application/x-compress .Z AddType application/x-gzip .gz .tgz # # AddHandler allows you to map certain file extensions to "handlers": # actions unrelated to filetype. These can be either built into the server # or added with the Action directive (see below) # # To use CGI scripts outside of ScriptAliased directories: # (You will also need to add "ExecCGI" to the "Options" directive.) # #AddHandler cgi-script .cgi # For type maps (negotiated resources): #AddHandler type-map var # # Filters allow you to process content before it is sent to the client. # # To parse .shtml files for server-side includes (SSI): # (You will also need to add "Includes" to the "Options" directive.) # #AddType text/html .shtml #AddOutputFilter INCLUDES .shtml </IfModule> # # The mod_mime_magic module allows the server to use various hints from the # contents of the file itself to determine its type. The MIMEMagicFile # directive tells the module where the hint definitions are located. # #MIMEMagicFile /private/etc/apache2/magic # # Customizable error responses come in three flavors: # 1) plain text 2) local redirects 3) external redirects # # Some examples: #ErrorDocument 500 "The server made a boo boo." #ErrorDocument 404 /missing.html #ErrorDocument 404 "/cgi-bin/missing_handler.pl" #ErrorDocument 402 http://www.example.com/subscription_info.html # # # MaxRanges: Maximum number of Ranges in a request before # returning the entire resource, or one of the special # values 'default', 'none' or 'unlimited'. # Default setting is to accept 200 Ranges. #MaxRanges unlimited # # EnableMMAP and EnableSendfile: On systems that support it, # memory-mapping or the sendfile syscall may be used to deliver # files. This usually improves server performance, but must # be turned off when serving from networked-mounted # filesystems or if support for these functions is otherwise # broken on your system. # Defaults: EnableMMAP On, EnableSendfile Off # #EnableMMAP off #EnableSendfile on TraceEnable off # Supplemental configuration # # The configuration files in the /private/etc/apache2/extra/ directory can be # included to add extra features or to modify the default configuration of # the server, or you may simply copy their contents here and change as # necessary. # Server-pool management (MPM specific) Include /private/etc/apache2/extra/httpd-mpm.conf # Multi-language error messages #Include /private/etc/apache2/extra/httpd-multilang-errordoc.conf # Fancy directory listings Include /private/etc/apache2/extra/httpd-autoindex.conf # Language settings #Include /private/etc/apache2/extra/httpd-languages.conf # User home directories Include /private/etc/apache2/extra/httpd-userdir.conf # Real-time info on requests and configuration #Include /private/etc/apache2/extra/httpd-info.conf # Virtual hosts Include /private/etc/apache2/extra/httpd-vhosts.conf # Local access to the Apache HTTP Server Manual #Include /private/etc/apache2/extra/httpd-manual.conf # Distributed authoring and versioning (WebDAV) #Include /private/etc/apache2/extra/httpd-dav.conf # Various default settings #Include /private/etc/apache2/extra/httpd-default.conf # Configure mod_proxy_html to understand HTML4/XHTML1 <IfModule proxy_html_module> Include /private/etc/apache2/extra/proxy-html.conf </IfModule> # Secure (SSL/TLS) connections #Include /private/etc/apache2/extra/httpd-ssl.conf # # Note: The following must must be present to support # starting without SSL on platforms with no /dev/random equivalent # but a statically compiled-in mod_ssl. # <IfModule ssl_module> SSLRandomSeed startup builtin SSLRandomSeed connect builtin </IfModule> Include /private/etc/apache2/other/*.conf
83ea4c798a686179599e5a9597aa222f05a4f4d98e919834790c17ea903cb1b3
['d3f0956effdf4957b9e5f92c53fb96ea']
I have an umbraco WebForms projects built on 4.11.10 that we need to upgrade to 7.3.8. We have tools such as RedGate Data Compare and RedGate Structure Compare, but without firsthand knowledge of the new structure and how that has affected the way that data is stored we're finding it impossible to upgrade the database. Does anyone know of a SQL script or tool that will upgrade just the database to the new format? Thanks in advance for your time. dotdev
00eb20da17b590df8813f88a8b572a139bd724ae00e818fde7a59f35f290f9ac
['d3f0956effdf4957b9e5f92c53fb96ea']
I have a website running on IIS that requires two SSL certificates, one for the main website domain, and one for the traffic coming through a CDN (the assets are served from a different domain name). Both use SSL. I therefore used the Server Name Indication option when creating the HTTPS bindings in IIS. The site works fine, I know that users on IE6/Windows XP may experience an issue, but we don't have any/many users visiting our site using that combination so that's not a problem. However, it is an ecommerce site that receives postbacks/callbacks from both PayPal and WorldPay. Here is where we are experiencing an issue. It would seem that neither PayPal or WorldPay's mechanism for posting back payment information understands SNI, therefore we don't get notified that a payment has been made. I'm not sure what the options are. IIS is telling me to create a default SSL site, but I can't find any instructions online regarding what I should be creating, or what benefit it serves. Am I going down the right path with this? Can anyone offer any advice on a) whether a default SSL site will fix this issue and b) how to create the default SSL site? Thanks for your time in advance. Kind regards, Dotdev
41c9812c2fc4f15dfa5178ded52012865eae43d1b4ded7ec1eaf51ac34e2b7f2
['d3f28dcd8f2f46b79e53b1f559b4b68b']
I've been working on something like that myself. With the cost of internet faxing services, it seems a whole lot cheaper to just have everything faxed from my own phone line (especially for local calls). Windows Fax & Scan can be run using COM if you have a bit of programming experience. I found this script here (use the "XP And Above" one) that I started with. The real problem is that there's very little by way of comprehensive documentation on the service that can be read through beginning to end. I'm sure everything is buried in the nest of links in the MSDN documentation, but it's a better reference than an explanation. At least I found a second example here.
6ed6c8f31ba3a064f790512df814e4d647ef01d2db1ee58364ecddcc10ae09f1
['d3f28dcd8f2f46b79e53b1f559b4b68b']
Just: journalctl -u SERVICE_NAME -e Parameter -e stands for: -e --pagerend; Immediately jump to the end of the journal inside the implied pager tool. This implies -n 1000 to guarantee that the pager will not buffer logs of unbounded size. This may be overridden with an explicit -n with some other numeric value, while -nall will disable this cap.
34dd6cc6b01637834b7bb35fd466e24351d5c98ac53d0ba852dc5d7d743d3bed
['d3fba279fe1d423c8e994bd6cd2a050d']
I have a table with a list of Jobs that have children, grandchildren, etc. There is no limit on the level of hierarchy it goes down. The table has ID, Name, and ParentID. So for example, a Job table could look like: ID Name Parent ID 1 Education null 2 IT null 3 Teacher 1 4 MS Teacher 3 5 7th Grade 4 6 Sys Admin 2 7 HS Teacher 3 8 12th Grade 7 9 IT Support 6 10 Developer 2 There is also a UserToJob table that is just the JobID and UserID. A person could be listed in more than one Job. I'm looking for the most efficient way to get all people with a specified job and all decedents, so if I want to query for Education then it returns Education, Teacher, MS Teacher, 7th Grade, HS Teacher, and 12th Grade. Right now my best attempt looks like with Closure AS ( select j.ID as AncestorID, j.ID as DescendantID, 0 as Depth from Jobs j UNION ALL select CTE.AncestorID, j.ID, CTE.Depth + 1 from Jobs j inner join Closure CTE on j.ParentID = CTE.DescendantID ), Job AS ( select j.UserID as ID from UserToJob j where j.JobID in (select DescendantID from Closure where AncestorID in (1)) ) I want it to be able to work querying more than one job at a time, for example if I wanted all Education and Sys Admins then I'd change AncestorID in (1) to AncestorID in (1, 6) in the final line of my attempt.
f8261b3f3944220beb29c60a152b0c8e6688ab7b39a0479e45c5e042c9f616c6
['d3fba279fe1d423c8e994bd6cd2a050d']
I'm trying to use datetime variables in a dynamic sql query. I've tried many queries but it never returns the right date. For example: declare @StartDate datetime = '2020-01-10' SET @sql =' select dateadd(day, 1, ' +@StartDate +')' execute sp_executesql @sql; throws an error when converting date and/or time from character string. So I tried declare @StartDate datetime = '2020-01-10' SET @sql =' select dateadd(day, 1, ' +convert(varchar(10),@StartDate, 101) +')' execute sp_executesql @sql; and that returns '1900-01-02' which is obviously not the day after '2020-01-10'. So it keeps thinking my date is 0, which is converted to '1900-01-01'. What am I doing wrong here?
37dd17281155571d54ef3d31f048c326abbaed1bc77a3e5d9404b7d2f7df4efd
['d3fd4a1845c74bb88303f286d08716a1']
I'm developing a function that would let a user select 3 points from a point cloud, generate a 3D geometry (hexahedron) that includes those 3D points and then get the volume of that geometry. The functionality I'm trying to achieve is very similar to the volume measure function from this demo. Any ideas on how do I generate that 3D geometry? Thanks.
922b3182e0be42c7c0833bdd129679b2cb2763b3db790e494d06e2e49a67c8c8
['d3fd4a1845c74bb88303f286d08716a1']
I post the answer myself, hopefully it will help somebody with the same problem I was having with Docker. I followed this guide , which basically consists on adding a parameter to the docker systemd unit file. I added the MountFlags=private line in the [service] section. It seems that the issue is related to the filesystem namespaces. With this fix, I can deploy the containers from as many hosts I want and there are 0 errors.
f065d09c824e3dfcfab3415c64810135944d2f4eef156e564900f41d00e55257
['d4046f0e53b14ce1b535519dfa090d96']
Upstart has been a valid Puppet provider since 2.7.0, I think. You should upgrade your Puppet setup (use apt.puppetlabs.com). The init.d symlink is just for convenience and not necessary for starting anything via upstart. It is weird though, that your system seems to be missing that symlink. It seems you somehow broke your installation.
94f1e395983e6b5bb0f139afcee937da66b368eebf417b88f3016a5e9fc40dd2
['d4046f0e53b14ce1b535519dfa090d96']
The fact is that in the real world there are doers and slackers; fascinating people and dullards. Usually an extraordinary person just pops up out of nowhere. No-one in their family was particularly famous or skilful. The chosen one by contrast is almost always royalty brought up as an ordinary person and their intrinsic royal qualities shine through and are eventually discovered. This is unrealistic - Royalty is inherited by birth not by ability. In time of crisis sometimes a person of extraordinary qualities will crop up, <PERSON> and <PERSON> come to mind. At other times (e.g. Brexit) no-one will rise to the occasion. Situations based on an MC where no hero appears simply don't make for good stories - unless we have a charismatic villain. A hero is simply someone who happens to be in the right place at the right time and by chance has the right character to tackle that particular situation to the benefit of others. In some cases they don't even have the perfect set of abilities and have to struggle through by sheer determination.
b3a70ed300123c8e03108fa6e9b4283f6b4e2c4c50f9e45dd32df562616873fd
['d4114226548c44eca1bc50f5b2a9492d']
I use Visio 2016 which lets me add data graphics to my shapes. For example I can add a text label and customise it to some degree. I'd like to have a text label with a red background on the left side of the shape and another with a green background on the right side, however the fill type only lets me choose between one color or no color at all. The only function I found lets me adjust the color of the shape which doesn't help much.
9a31b81e95d112d132f4d32b1cb11eee5ac3e81f00c512760646553972438093
['d4114226548c44eca1bc50f5b2a9492d']
I want to download several libraries (guzzle, pimple) and unzip them immediately after. For guzzle it works without any problems, however it refuses to unzip pimple and returns following error: Exec[unflate-pimple]/returns: change from notrun to 0 failed: tar -zvxf pimple-v1.1.1-0.tar.gz returned 2 instead of one of [0] My exec: exec { "unflate-$lib_name": cwd => "/var/www/lib/$lib_name", command => "tar -zvxf $lib_name-$lib_version_prefix$lib_version.tar.gz", path => "/usr/bin:/usr/sbin:/bin", require => Exec["download-$lib_name"] } Where $lib_name = "pimple" $lib_version_prefix = "v" $lib_version = "1.1.1-0" Unzipping it manually in the terminal when connecting through SSH works fine. I already tried unzipping and zipping it again. I feel completely lost, where is the problem?
f83a193f3d26e61b7aadd02e4bdfd35e8f00470b9f7ed6decca37677fc3ec253
['d41529674f4a453784bb1300722e0d9c']
I wrote an app on react native using native base. when I try to put margin in button it will not show the text inside the button. How can I fix it? When I delete the margin it work fine. but when i put the margin back it do not work. I search many source but no one show any solution at all. Here is the code: import React, { Component } from 'react'; import { Platform, StyleSheet, View, Image } from 'react-native'; import FloatLabelInput from './src/components/FloatLabelInput'; import {Button, Text} from 'native-base' type Props = {}; export default class App extends Component<Props> { render() { return ( <View style={styles.container}> <Image style={styles.background_Image} source={require('./media/free-blurry-background-1636594.jpg')} /> <Image source={require('./media/Save-the-Children-Logo.png')} style={{height: '10%', width: '100%'}}/> <FloatLabelInput name='Username' security='false'/> <FloatLabelInput name='Password' security='true'/> <Button block rounded danger onPress={() => console.log('my first app')} style = {styles.button_style} // accessibilityLabel="Learn more about this purple button" > <Text >LOGIN</Text> </Button> </View> ); } } const styles = StyleSheet.create({ container: { flex: 1, justifyContent: 'center', alignItems: 'center', backgroundColor: '#C0C0C0', }, welcome: { fontSize: 20, textAlign: 'center', margin: 10, }, instructions: { textAlign: 'center', color: '#<PHONE_NUMBER>', marginBottom: 5, }, background_Image: { backgroundColor: '#ccc', flex: 1, position: 'absolute', width: '100%', height: '100%', justifyContent: 'center', }, button_style: { margin: '5%' } });
a7cf814b59fe7e04a49b5f935a5e1bc8775b9208e083623dd2f04a281c7b9a59
['d41529674f4a453784bb1300722e0d9c']
class Delegatecommon : ICommand { private Action _execute; private Func<bool> _canexecute; public Delegatecommon(Action ac) : this(ac, () => true) { } public Delegatecommon(Action ac, Func<bool> fu) { if (ac == null) throw new ArgumentNullException(); else if (fu == null) throw new ArgumentNullException(); _execute = ac; _canexecute = fu; } event EventHandler ICommand.CanExecuteChanged { add { CommandManager.RequerySuggested += value; } remove { CommandManager.RequerySuggested -= value; } } public void execute() { _execute(); } public bool canexecute() { return _canexecute(); } bool ICommand.CanExecute(object parameter) { return canexecute(); } void ICommand.Execute(object parameter) { execute(); } }
3663ef26b7637873503bcb08ba1128ac8abb495e8332fb4edd1678cf81bbb9d3
['d41e98c4846d47e993207b1a112629fc']
I've created a custom repository and I want it to be registered with Spring Data Rest repository following Spring-restbucks example. @RestController public class BuildingController implements ResourceProcessor<RepositoryLinksResource> { public static final String PAGES_REL = "pages"; @Autowired(required=true) public BuildingController(BuildingRepository repository) { Assert.notNull(repository); this.repository = repository; } private final BuildingRepository repository; When I deploy this with rest of the app I get NPE in ResourceProcessorHandlerMethodReturnValueHandler ctor. During debugging I've noticed that all other Processors I have are regualr java objects and only BuildingController one is com.sun.proxy.$Proxy... So issue is in with casting to Class on JDK Proxy object. Here are the lines in ResourceProcessorHandlerMethodReturnValueHandler of code where NPE happens: TypeInformation<?> componentType = from(processor.getClass()).getSuperTypeInformation(ResourceProcessor.class) .getComponentType(); Class<?> rawType = componentType.getType(); My question is how to avoid NPE? One more thing to note is that I am trying to configure Spring with xml and Java due to the fact that I am running Application on WebLogic server which only supports servlet 2.5. Here are excerpts from my config. I guess I am doing somthing wrong here: My web.xml <context-param> <param-name>contextConfigLocation</param-name> <param-value> /WEB-INF/spring/root-context.xml /WEB-INF/spring/spring-security.xml /WEB-INF/spring/appServlet/servlet-context.xml </param-value> </context-param> <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> <servlet> <servlet-name>appServlet</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <init-param> <param-name>contextConfigLocation</param-name> <param-value>/WEB-INF/spring/appServlet/servlet-context.xml</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> servlet-context.xml <context:component-scan base-package="com.my.app, org.springframework.security"/> And then I created java configuration @Configuration @ComponentScan( "com.my.app.platform" ) @EnableWebMvc @EnableHypermediaSupport( type = EnableHypermediaSupport.HypermediaType.HAL ) public class WebMvcConfiguration extends RepositoryRestMvcConfiguration {
02fca49a46bd3d2ca471b5a360f715ab404015896fe00ba3d0dd3d3893e7a7b2
['d41e98c4846d47e993207b1a112629fc']
I figured it out. It would be great if all of the features in http://www.ryantenney.com/metrics-spring/ are documented :) But hey, that's why it is open source. <metrics:annotation-driven metric-registry="metrics" /> <!-- Monitoring the controller --> <beans:bean id="monitoringInterceptor" class="com.ryantenney.metrics.spring.TimedMethodInterceptor"> <beans:constructor-arg ref="metrics"/> <beans:constructor-arg> <beans:value type="java.lang.Class">org.myapp.controller.MyController</beans:value> </beans:constructor-arg> </beans:bean> <aop:config> <!-- name of the class or interface --> <aop:pointcut id="monitoringPointcut" expression="execution(* org.myapp.controller.MyController..*(..))"/> <aop:advisor advice-ref="monitoringInterceptor" pointcut-ref="monitoringPointcut"/> </aop:config>
dd45e9f6c9353026c7eb952d9035f3fdaed75b69598c77d435e38456f534204f
['d41f32a298cf4378842a65ec0b154833']
I think the reason you're having trouble with this is because you haven't thought of the third possible option for how to go about parsing it. [人となり(の/が)わかる]ような事 Given a different phrase (e.g. 私が分かるような事 - something I would understand), the noun before ~が分かる is certainly doing the understanding. However, here, 人となり (meaning somewhat of a combination of "the way someone is", "one's nature", and "one's character or personality") isn't the thing doing the understanding, but the thing being understood. This can be confusing if we were to think in English, because in conjunction with 分かる, が has the potential to mark both of these. Marking the actor: ・これ、一般人が分かるような文章ではないと思うんですけどね。- I just don't think a lay-person would understand this writing. ・先生は私が分かるほどゆっくり話してくれた。- My teacher spoke slowly enough for me to understand. Marking the thing being understood: ・木曜までには結果が分かるはずだ。- We should have the results by Thursday. ・貴社製品の詳細が分かるような資料などございますでしょうか? - Do you have any documents or anything that give more details regarding your company's product(s)? In the case of your example sentence, (彼女の)人となりのわかるような事 would be parsed as [(彼女の)人となり(の/が)わかる]ような事 (something that would (let me) understand her nature/character/personality/more about her) and I would translate your whole sentence as: I do suppose she's just here with me, I can't think she'd even talk about anything that would (let me) get to know her better. or more naturally, I do suppose she's just physically here with me, I have no reason to even think she'd talk about anything that would let me get to know her better.
8a798b931e925afd865cc00a1f7a653a476374e78f16edf2be88169f5bc2e15e
['d41f32a298cf4378842a65ec0b154833']
You might buy (or check out in a public library) "Effective Cycling" by <PERSON> (MIT Press). It is quite good. Unfortunately you didn't give the locale or town you are in. Most areas have a cycling club of different ways, and you could contact each one as to their advice and purpose. Often a city has general advice and maps for cyclists. Even bike shops take some care with this topic.
a87025c99fba47a9011b2ee16d1a740b8fd208fa4ffe654fe82f4042a48b4181
['d427a55bb0dc426889e53461a1cb7745']
In this code I keep getting an error, I know its how I'm saving the contact to the database. because if I take out the cdata/cdata2 and just put a string it works fine. Any help will be appreciated. How do I convert this to accept the string from the contact? switch (item.getItemId()) { case 1: //Save current contact to stash database Cursor phones2 = getContentResolver().query(ContactsContract.CommonDataKinds.Phone.CONTENT_URI,null,null,null, null); String cdata = phones2.getString(phones2.getColumnIndex(ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME)); String cdata2 = phones2.getString(phones2.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER)); ContentValues values=new ContentValues(2); values.put(DatabaseHelper.NAME, cdata); values.put(DatabaseHelper.cALUE, cdata2); db.getWritableDatabase().insert("constants", DatabaseHelper.NAME, values); constantsCursor.requery(); //Refresh contact list Intent refresh = new Intent(this, MainTab.class); startActivity(refresh); this.finish(); return(true); case 2: //uncoded option Toast.makeText(this, "here is the info", Toast.LENGTH_SHORT).show(); } ERROR: android.database.CursorIndexOutOfBoundsException: Index -1 requested, with a size of 2
76ad38d512d8850cf0f3cd306435a10e08d0525c5215e74fa59a557ad0ec3669
['d427a55bb0dc426889e53461a1cb7745']
How can I compare the bootlean to a string? I have tried to change the bootlean to a string output but I can't because of the checkemail function calls for a bootlean. The check email states that if its a valid email...which returns "true" or "false". boolean sefsd = checkemails(e.getText().toString()); if(sefsd.toString().equals("false")){ //do something}
34f2cf6c711ba9291e98c50b3aca3595ee705147ccfb4d3a8f1592f7968177d8
['d4519a0cf9a64c3390ff030641ae471c']
I am working on a web application with a medium sized team. We are versioning/collectively coding this project using Git. Between my co-worker and myself, I think we are about to run into a difficult merge, and I'd like to see if there's anything we can do better before we run into trouble. We are primarily working in Git on the develop branch: D-E-F-G My co-worker created a branch to work on a big change: A / D-E-F-G Then I pulled that branch down, fixed some bugs in it, and am about to merge it back in. Meanwhile, my co-worker started a new branch for another feature: A-B-C-D / D-E-F-G-H-I-J \ A-B-C Now, I need to create a new feature that uses styles from my co-worker's new branch, but his new branch needs a lot more work before it can be merged back into develop, so I'm branching off of his branch to take advantage of his styles and have a consistant look when his stuff gets merged back in: A-B-C-D / D-E-F-G-H-I-J \ A-B-C.. \ A But, we really also need some of the styles he developed in his other branch, so I'm thinking of rebasing develop into my branch as soon as we merge his other branch back into develop: branch 1: A-B-C-D / \ develop: D-E-F-G-H-I-J.. \ \ branch 2: A-B-C..\ \ \ branch 3: A-B.. This way, my branch that I need to work on will have the code I need from both of his branches, but will have been rebased from develop to hopefully reduce conflicts. What concerns me is that he may run into a lot of problems when he tries to merge branch 2 back into develop. Will there be a lot of conflicts for him? Is there something better we can do?
891bf1f541b76725e3853e7b4a2365f2dda426645e6131371a9dcfeccf487000
['d4519a0cf9a64c3390ff030641ae471c']
I am a web developer/aspiring web designer who looks at a lot of web design examples. While I bookmark them, text links are a pretty bad way for me to keep track of designs I like. I am planning to create my own bookmarking application which would use a Chrome extension/Firefox plugin to add a custom bookmarking button to the browser. When clicked, that button would pull up a dialogue that would allow me to take screen shots of the current web page and then upload them directly to my site, and modify the sql database there to include refrences to the new image files, a website name, website link, and list of tags. Ideally, I would like to create both a Chrome extention and a Firefox plugin to do this, since I jump between both browsers while I'm developing. Also ideally, I would love to be able to crop the screenshots as I take them within the browser window. Is it possible to create a Chrome extention / Firefox plugin which take screenshots of the current page? Can I specify the part of the page to crop the image I'm saving?
975e2d569508e65760df57414cd94fb208df63b242087feb7fd13a355bbf37af
['d45319b663844311bb8cebddda0d4f16']
My Batch reads data from one table, processes and writes to another table. I have MyBatisPagingITemReader, Custom Processor and Writer. Currently Custom Writer INSERTS the data which is converted in processor and Writer does a BATCH INSERT to the other table. Now, Reader will read some rows which has to be updated in the other table.In this case my writer should also be capable of batch updating those records. What is the best way to implement it? Here is where iam stuck My Writer public void write(final List unmodifiableItems) throws Exception { // unmodifiable items will be a list of row to be inserted..... } How will i access the list of records which needs to be UPDATED?
8b3033a2e29407a88b404050638d29166f69f66c372360f7b79511e428e6f3e7
['d45319b663844311bb8cebddda0d4f16']
My Batch job 'MyBatisPagingItemReader' is reading the same set of records. Below is the config. <job id="synchBatchJob"> <step id="simpleStep"> <tasklet> <chunk reader="synchItemReader" processor="synchBatchProcessor" writer="synchItemWriter" **commit-interval="10"**> <listeners> <listener ref="synchBatchStepListener" /> </listeners> </chunk> </tasklet> </step> </job> <bean id="synchItemReader" class="org.mybatis.spring.batch.MyBatisPagingItemReader" scope="step" > <property name="sqlSessionFactory" ref="sqlSessionFactory" /> <property name="parameterValues" ref="syncJobParams" /> <property name="queryId" value="getStagingData" /> <property **name="pageSize" value="10"** /> </bean> <util:map id="syncJobParams" scope="step"> <entry key="activityId" value="#{jobParameters['activity.id']}"/> </util:map> I have mentioned "commit-interval" in step definition & "pageSize" in MyBatisPagingItemReader as "10". I have total of 12 records in table. My reader always gives me first 10 set of records. But if i mention "pageSize" = 100, Iam getting two call to writer with 10 and 2 in each set while writing which is correct. Can anyone point me where iam going wrong?
f565e86b9c21d0b2fcdb1c669295cf217cad132f9d6471ca05183e8cf0b4363a
['d45701d7a56c411199f34f712f865128']
I figured out what I was doing wrong. I will share it here in case someone else gets stuck in the same silly way I did. In the program when I load the json file, I was supposed to load it using the resource_path function.I was using the resource_path function in the spec file previously. def resource_path(relative): return os.path.join( os.environ.get( "_MEIPASS2", os.path.abspath(".") ), relative ) json_file = open(resource_path(previously_used_path),'r')
dd60c08f5e253cb63ffb0a2ba1c91645a3126086f78aa81e6bd1588b89ac81cf
['d45701d7a56c411199f34f712f865128']
I am making a draggable point(a circle). The code works, however, while dragging, if the mouse motion is quick the point stops moving. I have taken help from this code for making this program. I will be using this point later on for other purposes. Here is my full code, from tkinter import * import sys,os,string,time class Point(): def __init__(self,canvas,x,y): self.canvas = canvas # It could be that we start dragging a widget # And release it while its on another # Hence when we land on a widget we set self.loc to 1 # And when we start dragging it we set self.dragged to 1 self.loc = self.dragged = 0 self.x = x self.y = y self.radius = 5 self.point = canvas.create_oval(self.x-self.radius,self.y-self.radius,self.x+self.radius,self.y+self.radius,fill="green",tag="Point") canvas.tag_bind("Point","<ButtonPress-1>",self.down) canvas.tag_bind("Point","<ButtonRelease-1>",self.chkup) canvas.tag_bind("Point","<Enter>",self.enter) canvas.tag_bind("Point","<Leave>",self.leave) def down(self,event): self.loc = 1 self.dragged = 0 event.widget.bind("<Motion>",self.motion) canvas.itemconfigure(self.point,fill = "red") def motion(self,event): root.config(cursor = "exchange") cnv = event.widget cnv.itemconfigure(self.point,fill = "red") self.x,self.y = cnv.canvasx(event.x), cnv.canvasy(event.y) got = canvas.coords(self.point,self.x-self.radius,self.y-self.radius,self.x+self.radius,self.y+self.radius) def enter(self,event): canvas.itemconfigure(self.point,fill="blue") self.loc = 1 if self.dragged == event.time: self.up(event) def up(self,event): event.widget.unbind("<Motion>") canvas.itemconfigure(self.point,fill="green") self.canvas.update() def chkup(self,event): event.widget.unbind("<Motion>") root.config(cursor = "") canvas.itemconfigure(self.point,fill="green") if self.loc: # is button released in the same widget as pressed self.up(event) else: self.dragged = event.time def leave(self,event): self.up(event) root = Tk() root.title("Drag and Drop") canvas = Canvas(root,width = 256, height = 256, borderwidth = 1) point = Point(canvas,128,128) canvas.pack() root.mainloop()
6620974d42ef0c4931d8268df3bb086f7bfc00deb4a2a7f8f4b69b156154b101
['d4669779c21c48fab07c6f11413af4e5']
Imagine if there is an object with the following property. var rules = { confirmedPassword: 'required|min:4|max:10', } What I want is this: rules = { rules.confirmedPassword && {...rules.confirmedPassword, rules.confirmedPassword: '|same:password'}} To yield this: rules = {confirmedPassword: 'required|min:4|max:10|same:password',} The reason being, in react I am using the event.target in a function to perform a validation later. So if a user hits the input element with name="confirmPassword" not only will it have the default of required|min:4|max:10 but in fact 'required|min:4|max:10|same:password'; validateInputs(event) { var { password, confirmPassword } = this.state; var { name, value } = event.target; var data = { password: password, confirmPassword: confirmPassword }; var rules = {}; rules[name] = 'required|min:4|max:10'; var messages = { 'password.min': 'Password is too short.', 'password.max': 'Password is too long.', 'confirmPassword.min': 'Password is too short.', 'confirmPassword.max': 'Password is too long.' }; validate(data, rules, messages) .then(feedback => console.log(feedback)) .catch(errors => console.log('foo', errors)); this.setState({ [name]: value }); } Thanks in advance!
d0b1d51540b3f2ac25c7fbcabf5bdd6ffb76f93d0b57000c43e454e5e8617075
['d4669779c21c48fab07c6f11413af4e5']
Right now I have a async function (see code snippet) which returns a JSON response; An array containing two objects. See screenshot. How could I merge the objects so I would get back : [{resultCount: 100, results: Array(100)}] I tried this: var combinedResults = jsonResponses.map((acc, item) => { acc.resultCount += item.resultCount; acc.results += item.results; return acc; }); But got this back: Yikes!! Any help will be appreciated! export function getDoorstepsSongs () { return async dispatch => { const page1 = 'https://itunes.apple.com/search?country=us&media=music&limit=50&attribute=songTerm&term=door&sort=ratingIndex' const page2 = 'https://itunes.apple.com/search?country=us&media=music&limit=50&offset=50&attribute=songTerm&term=door&sort=ratingIndex' const jsonResponses = await Promise.all([ fetchJsonP(page1), fetchJsonP(page2), ]).then(responses => { return Promise.all(responses.map(res => res.json())) }).catch(console.error) console.time('processing songs') // // jsonResponses contains the results of two API requests= // // 1. combine the results of these requests // 2. sort the results with lib/sortSongs.js // const sortedSongs = sortSongs(combinedResults) console.timeEnd('processing songs') return dispatch({ type: 'GET_DOORSTEPS_SONGS_SUCCESS', songs: sortedSongs, }) } }
737b73496184c97404e62f797ba01e81f42c6c63c579912b67b42eb68249bdf0
['d46b20ace5b04455b8583f646820da64']
I have found the reason why my row id was giving the wrong ID. Well I wouldn't really call it 'wrong' after realizing what the bug was. You see when a cursor queries data and project them in a listview, they don't actually query those data that has been deleted. My mistake was I had forgotten that dbId would not be restructured if a delete statement had been executed, the id would remain as is which in our case would remain fixed, while its' neighboring columns would be deleted. listNames.setOnItemClickListener(new AdapterView.OnItemClickListener() Cursor c = getContentResolver().query(PATH_URI, null, "_id=" + id, null, null); The snippet above is where I went wrong. I was comparing the listview id (more likely the item position on the list view) and a content provider db id. What I did was to compare a different row, more specifically a String from both my db and what is projected on my ListView, I had first set my arraylist(arNames) global. Then this: public void onItemClick(AdapterView<?> parent, View view, int position, long id) { Cursor c = getContentResolver().query(PATH_URI, null, "COLUMN_NAME= '" + arNames.get(position) + "'", null, null);
426608ca06f644e7aa915abe6b4f22fc03fe938a6f76fee7ae06539bd47cc621
['d46b20ace5b04455b8583f646820da64']
Create a global variable for song uri on your Set Alarm class. <PERSON>; On your onItemClick method change setDataAndType(uri, "*/*"); to setDataAndType(uri, "audio/*"); so the chooser may only display audio files for the user. You will also have to change startActivity(Intent.createChooser(intent, "Open"); to startActivityForResult(Intent.createChooser(intent, "Open"), 1); this will allow you to get what ever was chosen from the chooser. Override onActivityResult on the same class. Then set the songUri global variable. @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if (data != null) { songUri = data.getData(); } } finally, put extra on the Intent that is pointing to the AlarmReceiver.class intent.putExtra("song",songUri); on your Broadcast Receiver class change mp = MediaPlayer.create(context, R.raw.closer); to this try{ mp = MediaPlayer.create(context, (Uri)intent.getParcelableExtra("song")); }catch(NullPointerException e) { mp = MediaPlayer.create(context, R.raw.closer); } A NullPointerException will be triggered if no song is chosen that's because intent.getParcelableExtra("song") will be null. If a song is chosen place it on the try block and get the extra.
a3ebc4554c222890031713292029c2efdf898413aca100faa27eef34d9a1c9ad
['d474b851570f46daa1ab8067a727cb3b']
I'm not sure which Update # it was, but it's the icon with 2 silhouettes and when you click it you get the window that says "Your people - Pin contacts to your taskbar so you can talk to them whenever." It wasn't there before the update. Either this update or the Insignia Wireless Keyboard/Mouse is responsible for this.
f0c437e8102d1280b6927d22853f27da354b3495807875f9425dbc19de638ce1
['d474b851570f46daa1ab8067a727cb3b']
In Excel, if I have a Date cell which doesn't fit in a column, Excel with display the value as # until I resize the column properly. But with Text cells there is nothing to show the overflowing status. Why doesn't Excel show an ellipsis (...) or something similar? Is there a way to alert the user there's more? Sometimes it's hard to tell if the visible part ends with whitespace. In my example I'm lucky the string is truncated, but if it were "Skills/Competencies" it still wouldn't be complete because the string goes on from there, and no one would know.
1d28ad1be9968fa28ae4ee164dece07b072a875a5813eb68d740a0eb37d9d16a
['d481e6567c264dbdb9c7e9fd752f5a73']
I have a big text file like this example: example: </Attributes> FovCount,555 FovCounted,536 ScanID,1803C0555 BindingDensity,0.51 as you see some lines are empty, some are comma separated and some others have different format. I would like to open the file and look for the lines which start with these 3 words: FovCount, FovCounted and BindingDensity. if the line start with one of them I want to get the number after the comma. from the number related to FovCount and FovCounted I will make criteria and at the end the results is a list with 2 items: criteria and BD (which is the number after BindingDensity). I made the following function in python but it does not return what I want. do you know how to fix it? def QC(file): with open(file) as f: for line in f.split(","): if line.startswith("FovCount"): FC = line[1] elif line.startswith("FovCounted"): FCed = line[1] criteria = FC/FCed elif line.startswith("BindingDensity"): BD = line[1] return [criteria, BD]
5ae05ed04b48b446e961b7030c7ce5d8d7b415aa3658d57c90612f3da04332a5
['d481e6567c264dbdb9c7e9fd752f5a73']
I have a text file like this small example: small example: </Attributes> ENDI,ERT,GFTR,29 ENDI,XCV,HGJ,36 TOC,FGNH,TRYCB,3742 TOC,MVCL,KJDSFH,38799 GOF,KLJG,XZCJV,31 GOF,LKBFV,JKSDHF,18 I would like to select some rows and add the 4th column (those lines are comma separated) to a python list. the point is all the rows are not comma separated but the rows that I am interested in are comma separated.here is the expected output: TOC = [3742, 38799] GOF = [31, 18] I made the following code in python. but does not return expected output. do you know how to fix it? TOC = [] GOF = [] file = open('file.txt') as f: for line in file: if line.startswith("TOC"): TOC.append(line[3]) if line.startswith("GOF"): GOF.append(line[3])
00eacf1334dfb3102349fb126c6491d5b8df4445fccaaa0e7ae25915f4c6ce57
['d48578b2c793400a8ed2ab36e7db5240']
The time complexity of the following algorithm is reported to be O(v+e), but I cannot figure out why. Any help is appreciated. This is the problem: In a weighted (nodes and edges) directed acyclic graph, an attribute, called Rank, is computed for every vertex. It is computed by traversing the graph bottom-up. For the exit node, the Rank value is assumed to be equal to its assigned weight. For any other node in the graph, the Rank is defined as: "The Rank of the node's dominant successor" + "The wight of the edge between the node and its dominant successor" + "The node's weight" where the node's dominant successor is the one with the highest Rank value. This is what I guess the pseudocode of the algorithm is: For "every vertex" in the graph For "every immediate successor" of the selected vertex [the statements ...] End End Choosing the nodes in the right topological order, the outer loop is executed exactly v times, resulting in O(v) time complexity. The inner loop (Searching for successors) is executed at most (v-1) times (in case of using an adjacency matrix I guess), resulting in O(v) time complexity. Therefore, I compute the total time complexity O(v^2), which is not correct according to the reported value which is O(v+e).
68301c8975dd951acb152e26ca68293536922f272d013a300a15f477621495a8
['d48578b2c793400a8ed2ab36e7db5240']
Is it ok to say that the time complexity of the order O((p+1)(v^2)) is equal to O(p(v^2))? p and v are sizes of the inputs. Here is the problem: O(v^2) + O(p*(v^2)) And here is my answer: = O((p+1)(v^2)) =? O(p(v^2))
641ffcbf8582e7f5a16166a79ccae8a5786b06dd0d37d7f8b1dfca7a8fcdb872
['d48b36bd2670460bae63f6a420f3794c']
I have a JPQL query that generate that native query : SELECT ID, MODALNAMES, NAME, NUMBER, TABLE_CONFIG_ID FROM TAB_CONF_TABS WHERE (TABLE_CONFIG_ID = ?) what's wrong with it ? My db is Oracle. This is a error that appears in the console: javax.ejb.EJBTransactionRolledbackException: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.6.4.v20160829-44060b6): org.eclipse.persistence.exceptions.DatabaseException Internal Exception: java.sql.SQLSyntaxErrorException: ORA-00936: missing expression Error Code: 936 Call: SELECT ID, MODALNAMES, NAME, NUMBER, TABLE_CONFIG_ID FROM TAB_CONF_TABS WHERE (TABLE_CONFIG_ID = ?) bind => [25] Query: ReadAllQuery(name="tabs" referenceClass=TabConfig sql="SELECT ID, MODALNAMES, NAME, NUMBER, TABLE_CONFIG_ID FROM TAB_CONF_TABS WHERE (TABLE_CONFIG_ID = ?)")
c213ad3cb864c28804fe2939cac08f68cc380de4f1ccbcccb65770c50e796a64
['d48b36bd2670460bae63f6a420f3794c']
I need to use two difrent databases, with relation in entities between them. I want to have all entities in on project and use Composite Persistence Unit to manage which entity will be storen on which database. Is this possible? I found only example with one Composite Persistence Unit and Composite Persistence Unit members in difrent jars. If my idea is not possible what i need to do, to compile persistence units to jars? I need to put in this jar Entitiy classes too? What about relations between this entities?
272ce7566c07298eee664e4814286180d4a68c247f82e6f496f26bed5e808f6e
['d49d0f0d71c645bdb12f756c098aa7aa']
But even as an intuitive explanation, I don't see how it is intuitive. Like you said, if there is no maximal element then this process cannot terminate. Ok, but so what? Does this non-termination (even in a set theoretical sense) lead to some sort of a contradiction? Maybe it just simply doesn't terminate, and that's that - without there being a maximal element after all?
f141aefde41e61fe9eb182c348af731e8f0ad8564fa7aa45d43c3259175006f3
['d49d0f0d71c645bdb12f756c098aa7aa']
It is claimed that the law of excluded middle : $A \lor \neg A$, is a necessary principle for proving statements by contradiction (i.e. non constructively). However, in first order logic, at least, proofs by contradiction may go as follows : If $\{T\ \cup \ \neg p\}\vdash p$, then by the deduction theorem, $T \vdash (\neg p \rightarrow p) $, and then by the logical axiom $(\neg p \rightarrow p) \rightarrow p$ and modus ponens, $T \vdash ~p$. So it seems $A \lor \neg A$ is never used in the above. In what sense is it then needed for non constructive proofs?
1e30756a83a7567873fa380bba1dc257ee7d4df51d67c8275f21ad6d434e9367
['d4ba68f72e954e38bd22be271b9caf44']
I'm entering user input via telnet into a HashMap, then trying to display that info into a JTextArea. When I hit run, the GUI launches and the initial HashMap is posted to the GUI. But when I update the HashMap values, they don't show in the TextArea. I have a time textfield, which updates as it should and shows the current time. Where am I going wrong? Is the problem within the GUI class or is it my user input class? Here is my GUI class: public class GUI extends JFrame { private JTextArea theArea1; private JTextField theField1; private Timer theTimer; private static final int TIMER_DELAY = 1; private Scores scores; private SimpleDateFormat formatter; private long startTimeMillis; public GUI(Scores score) { this.scores = score; this.theArea1 = theArea1; this.theField1 = theField1; } public void init() { Container c = getContentPane(); setTitle("Leadrboard"); setSize(400, 400); formatter = new SimpleDateFormat("EEE, dd-MMM-yyyy HH:mm:ss"); startTimeMillis = System.currentTimeMillis(); JPanel aPanel = new JPanel( ); aPanel.setLayout(new GridLayout(2,1)); theField1 = new JTextField("", 20); aPanel.add(theField1); theField1.setEditable(false); theArea1 = new JTextArea("", 5, 20); aPanel.add(theArea1); theArea1.setEditable(false); c.add(new JScrollPane(theArea1), BorderLayout.CENTER) ; c.add(aPanel, BorderLayout.NORTH); String str = ""; theTimer = new Timer(TIMER_DELAY, new ActionListener() { @Override public void actionPerformed(ActionEvent e) { // do whatever theTimer requires Date todaysDate = new java.util.Date(); String formattedDate = formatter.format(todaysDate); theField1.setText(formattedDate); theArea1.setText(scores.toString()); } }); theTimer.start(); } } and here is my class for entering user input bellow. Once I enter score, which is the HashMap value, I print the HashMap in the cmd window, and it shows the HashMap as expected, but the GUI textField doesn't change: public class ClientRequest extends Thread { private Scores scores = new Scores(); private Socket incoming; //HashMap<String, Integer> name = new HashMap<String, Integer>(); public ClientRequest(Socket incoming) { this.incoming = incoming; } @Override public void run() { try { // set up streams for bidirectional transfer // across connection socket BufferedReader in = new BufferedReader(new InputStreamReader(incoming.getInputStream())); PrintWriter out = new PrintWriter(incoming.getOutputStream(), true /* auto flush */); out.println("You are connected to " + incoming.getLocalAddress().getHostName() + " on port " + incoming.getLocalPort() ); out.println("to manually enter players scores for each hole enter 'MANUAL."); String input = in.readLine(); if (input.trim().equals("MANUAL")) { boolean isDone = false; while (!isDone) { //scores.fillHashmap(scores.name); out.println("Enter hole number"); int holeNumber = Integer.parseInt(in.readLine()); out.println("Enter player name"); boolean check = false; String playerName = in.readLine(); out.println("Enter player name"); boolean nameExists = scores.name.containsKey(playerName); if (nameExists == false) { out.println("That is not a valid player, try again"); playerName = in.readLine(); } if (nameExists == true) { out.println("Valid player"); } out.println("Enter score for that hole"); int holeScore = Integer.parseInt(in.readLine()); scores.name.put(playerName, (scores.name.get(playerName) + holeScore)); out.println(scores.toString()); } } incoming.close(); } catch (Exception e) { System.out.println(e); } } @Override public String toString() { String str = ""; for (String key : scores.name.keySet()) { //int holeScore = Integer.parseInt(in.readLine()); scores.name.put(key, (scores.name.get(key))); str += "yeeeh" + scores.name.put(key, (scores.name.get(key))); } return str; } } Here is Scores, where the HashMap is stored: public class Scores { HashMap<String, Integer> name = new HashMap<String, Integer>(); Boolean[] garciaArray; Boolean[] furykArray; Boolean[] donaldArray; Boolean[] westwoodArray; Boolean[] mcilroyArray; public String test() { return "test"; } public Scores() { name.put("Sergio Garcia", 0); name.put("Jim Furyk", 0); name.put("Luke Donald", 0); name.put("Lee <PERSON>", 0); name.put("Rory <PERSON>", 0); } public HashMap<String, Integer> getName() { return name; } public String toString() { StringBuilder sb = new StringBuilder(); Iterator<Map.Entry<String, Integer>> iter = name.entrySet().iterator(); while (iter.hasNext()) { Map.Entry<String, Integer> entry = iter.next(); sb.append(entry.getKey()); sb.append('=').append('"'); sb.append(entry.getValue()); sb.append('"'); if (iter.hasNext()) { sb.append(',').append(' ' + "\n"); } } return sb.toString(); } }
7fd58f645ab7ef93cbb2314038e9a356c5182cf3e2bfe69ef7769412147e5142
['d4ba68f72e954e38bd22be271b9caf44']
I'm having a hard time thinking of an appropriate data structure to use to represent an adjacency matrix for an undirected graph. I want to be able to take the nodes from these graphs and insert them into random positions in arrays, and then "score" the arrays based on how well they've managed to keep the adjacent nodes apart. i.e if node A and node B are connected in my graph, and the array places them next to each other, +1 would be added to the array's score, with the lowest scoring array being the best. So what would be the best data structure to use to represent a collection of nodes, and the neighbouring nodes of each one in the collection?
caae6544081a04800c90d6afe6d95f33f2650f7bc3dec2ba57a29d9dd69d0367
['d4d6bd0895b54ac9aca243c0bc327041']
If possible avoid the '+' sign from your array items, this will make the solution alot eassier. Step 1: sort the array in descending order, it will eliminate the chance to get partial matching Step 2: Form the regex and match Step 3: return result var data = [91,92,923,912]; data.sort((a,b)=>b-a); var match = new RegExp('^\\+('+y.join("|")+')(.*)?$'); var ph = "+95458888888".match(match); if(ph) { //return ph[2] console.log(ph[2]); } else { //return false; } If you can't change the structure of Array y, you can convert your array to the given format using map method or via iteration.
5a70f382abff5ecaf4a33832ee62ace3774a801bcfe79559a58c781a367dfafb
['d4d6bd0895b54ac9aca243c0bc327041']
The question is not clear to me but I can see a bug in your code, you simply can't have two elements having the same id. Each time 'add more' button is clicked the input element with id="pPilihan" is getting repeated, which is wrong. You can solve this by using a counter to produce a dynamic id (if you need one).
ba977f7e3637d933c0cca12d9683cebfe4b49e02cc9aec89875f2b8bccff27f8
['d4dc443d56114ba492d89a62c473045c']
Additively c-approximating the intersection of two (n*2*c)-bit sets is at least as hard as computing the intersection of two n-bit sets; we reduce from the latter to the former by copying each bit 2c times and rounding the intersection size to the nearest multiple of c.
234b14e5aaa488b3f67f5d211d810154621b15cbdc43ff9317f15bf0797347a6
['d4dc443d56114ba492d89a62c473045c']
I think the answer to the question could depend on whether $k$-SAT means clauses of size $\leq k$ or precisely $ k$. In the $\leq k$ case the sequence is monotnonically non-decreasing, while it is quite likely to converge to $0$ as $k$ tends to infinity in the $= k$ case (no formal argument, just a gut feeling based on the $2^{O(k)}n$ satisfiability threshold)
4dbc7217ec316099d77c014c583dad34c99b1befaed1814a38686555ecdf27ce
['d4dd72aef6e54e71834ab6b108d766ec']
<PERSON> wrote down what He received. This means <PERSON> was responsible for the physical document (ignoring the stone tablets). So the original scroll people saw was physically produced by <PERSON>, but the words were God's. <PERSON> was simply the agent of transmission. So is <PERSON> responsible for the physical world we see? For example, the Sun and Moon were designed by God and physically "made" by <PERSON>?
0098612fedea63285e03d048b395eb4b3719a347a92b3da7b524e5b2e1514625
['d4dd72aef6e54e71834ab6b108d766ec']
Background Prior to <PERSON> being brought to <PERSON>, there were three criminals in custody awaiting execution. Since it was the custom to release one, the Romans would have been prepared to crucify the other two. It is speculation, but it is reasonable to believe the two upright pieces of those two crosses had been put in place the day before. Then, after one had been freed, the other two would carry the other piece of their cross to the place where they would be crucified. <PERSON>' was a third and unexpected crucifixion, which the Roman soldiers would not have prepared; both pieces of the cross would have to be carried out. This fits the otherwise conflicting accounts of <PERSON> making the trip to Golgotha. Regardless of the exact details, <PERSON>' crucifixion was something the Roman soldiers had to deal with "at the last minute." We know the Roman soldiers mocked <PERSON> and hailed Him as King, so it is reasonable to conclude they decided to place Him in the middle, which would have been the "position of honor." Fulfilling Scripture The Crucifixion and Resurrection are the focal point in God's plan of salvation and nothing was "by chance." On the day of Pentecost <PERSON> says as much: this <PERSON>, delivered up according to the definite plan and foreknowledge of God, you crucified and killed by the hands of lawless men. (Acts 2:23) [ESV] For example, the method of execution could not be by stoning: <PERSON> redeemed us from the curse of the law by becoming a curse for us—for it is written, “Cursed is everyone who is hanged on a tree” (Galatians 3:13) “And if a man has committed a crime punishable by death and he is put to death, and you hang him on a tree, his body shall not remain all night on the tree, but you shall bury him the same day, for a hanged man is cursed by God. You shall not defile your land that the LORD your God is giving you for an inheritance. (Deuteronomy 21:22-23) The people acted in ignorance [of God's plan (Acts 3:17)], but the course of history was guided by God so that His plan would be fulfilled, according to Scripture. Isaiah 53 describes in detail the Suffering Servant. It ends with this passage: Therefore I will divide him a portion with the many, and he shall divide the spoil with the strong, because he poured out his soul to death and was numbered with the transgressors; yet he bore the sin of many, and makes intercession for the transgressors. (53:12) He was numbered with the transgressors... "Numbered" is the Hebrew manah which <PERSON>' Lexicon says properly means "to be divided, to be divided out, to divide." In this form it can also mean to be reckoned, to be assigned. So by being placed between two transgressors, <PERSON> "divided" them; actually being "assigned" His position. This was necessary to fulfill Isaiah 53:12. Also note that <PERSON> says He "makes intercession for the transgressors. This was actually fulfilled while on the cross in the singular with the one thief who repented and in the plural: And <PERSON> said, “Father, forgive them, for they know not what they do.” (Luke 23:34) So we might say the plan of salvation was not only fulfilled; it was literally being "acted" out in real-time for the other participants. Similarly, just as <PERSON> death was a substitution for all sinners, He actually took <PERSON>' place. Finally, the Gospel of John begins with a description of the Word which was with God coming to the world and returning to God. This too follows Isaiah: 8 For my thoughts are not your thoughts, neither are your ways my ways, declares the LORD. 9 For as the heavens are higher than the earth, so are my ways higher than your ways and my thoughts than your thoughts. 10 “For as the rain and the snow come down from heaven and do not return there but water the earth, making it bring forth and sprout, giving seed to the sower and bread to the eater, 11 so shall my word be that goes out from my mouth; it shall not return to me empty, but it shall accomplish that which I purpose, and shall succeed in the thing for which I sent it. (Isaiah 55) The word ...shall not not return to me empty...." The Hebrew רֵיקָם is usually translated as empty-handed: If the God of my father, the God of <PERSON> and the Fear of <PERSON>, had not been on my side, surely now you would have sent me away empty-handed. God saw my affliction and the labor of my hands and rebuked you last night.” (Genesis 31:42) Again there is a literal fulfillment when one thief had a change of heart: 40 But the other rebuked him, saying, “Do you not fear God, since you are under the same sentence of condemnation? 41 And we indeed justly, for we are receiving the due reward of our deeds; but this man has done nothing wrong.” 42 And he said, “<PERSON>, remember me when you come into your kingdom.” 43 And he said to him, “Truly, I say to you, today you will be with me in paradise.” (Luke 23) The Word did not return "empty-handed." He brought the penitent thief. Conclusion Being crucified between two other transgressors was necessary to fulfill the prophecy of <PERSON>. Likewise, the "death bed" request from one of the thieves was necessary, or at least was an immediate fulfillment of the work of the Word as described in Isaiah 55.
ca2b4718de876b67cbd7b0a0db324713445cb6b875ae68f874587780b453701e
['d4e0048b14824442bb066af76303ccf7']
Most likely not. I have the same problem and it's because my SSH machine is not same machine as the HTTP server. Try running netstat -tulpn | grep 9080 from SSH and also through PHP from your browser. Your SSH session should obviously see port 9080 being open, but your browser should not. My temporary solution is to start my "9080" through making a request to a PHP script (so it's definitely running on the HTTP machine), which starts my "9080" server in the background (nohup /path1/path2/start9080.sh > /dev/null 2> /dev/null &). Then my PHP scripts can hit "9080". Problems with this method are that starting and stopping "9080" goes through public "api" (clearly dangerous) "9080" can't be accessed publicly (exactly what I want) "9080" sometimes gets killed (???)
4cc0e5047821bb00a687724aff98de5f89958b0314b85e37ff4155dd1c0ff103
['d4e0048b14824442bb066af76303ccf7']
Ideally your front end shouldn't need to handle 10000 records at a time, because it's hard for a user to manage a list that large and can be very slow to retrieve that many records. If possible you should make the front end directly paginated as well, in which case "top" and "skip" will be passed in from your front end and the PHP code makes 1 POST request with those parameters. But if that's not possible, you can use the search API without "skip" and "top" for the first request, and then follow the chain of nextPageParameters. Then append the value from every page into 1 array and return it to the front end. // $file = file_get_contents($url, false, $context); // without "top" and "skip" // $file = json_decode($file,true); $values = array(); while (True) { // get values from current page $values = array_merge($array, $file["value"]); // stop if there are no more pages if (!array_key_exists("@search.nextPageParameters", $file)) { break; } // get next page $postdata = $file["@search.nextPageParameters"]; $opts = array( 'http'=>array( 'method'=>"POST", 'header'=>"Content-type: application/json\r\n" . "api-key: ". $apiKey . "\r\n" . "Accept: application/json", 'content'=>$postdata ) ); $context = stream_context_create($opts); $file = file_get_contents($url, false, $context); $file = json_decode($file, true); } return $values;
55a9a39136b184c17db08cea82f614f772ad1b260d209d94201a456c2ff3488d
['d4edd6a2a81d4afbb43136c84ff59aaf']
i would try to filter the data prior to insertion in the datagridview. For example: myReader = MyDCommand.ExecuteReader While myReader.Read If Not myReader("Mfr_Id") Is DBNull.Value Then If myReader("MfrGroup") = TabControl1.SelectedTab.Text Then DataGridView2.Rows.Add(New Object() {myReader("Mfr_Id"), _ myReader("MfrName"), myReader("WebPath"), _ myReader("MfrGroup"), ""}) End If End If End While
d906aefa9fa9966083ec62e4be323aeb267c6da3f9ec3428f95fe6e28b8d0b70
['d4edd6a2a81d4afbb43136c84ff59aaf']
This script creates a frame and a grid with two rows and five columns. The fifth column is an image that can be used as a button. See the onCellSelected function to respond to the button selection. import wx import wx.grid as Grid class MyFrame(wx.Frame): def __init__(self, parent, title): super(MyFrame, self).__init__(parent, title=title, size=(400, 300)) self.panel = MyPanel(self) self.MyGrid = New_Grid(self, numRows=2, numCols=5) mainSizer = wx.BoxSizer(wx.VERTICAL) mainSizer.Add(self.MyGrid,1,wx.ALL|wx.EXPAND,0) self.SetSizer(mainSizer) class MyPanel(wx.Panel): def __init__(self, parent): super(MyPanel, self).__init__(parent) class New_Grid(Grid.Grid): def __init__(self, parent, numRows, numCols): Grid.Grid.__init__(self, parent) self.CreateGrid(numRows, numCols) self.SetRowLabelSize(35) self.AutoSizeColumns(True) # Display content self.displayContent() # ... self.handleEvents() def displayContent(self): myList = [ "Col1", "Col2", "Col3", "Col4", "Set" ] x = 0 for item in myList: self.SetColLabelValue(x, item) x += 1 self.SetColLabelSize(25) self.AutoSizeColumns(True) self.update_Grid() def handleEvents(self): self.Bind(Grid.EVT_GRID_SELECT_CELL, self.onCellSelected) def onCellSelected(self, event): col = event.GetCol() if col == 5: Selected = event.GetRow() def update_Grid(self): img = wx.Bitmap("SET.png", wx.BITMAP_TYPE_PNG) self.rd = MyImageRenderer(img) # Buttons coordinates numRows = self.GetNumberRows() for y in range(numRows): self.rd.rend_row = y self.rd.rend_col = 4 self.SetCellRenderer(self.rd.rend_row, self.rd.rend_col, self.rd) self.SetColSize(0, img.GetWidth() + 2) self.SetRowSize(0, img.GetHeight() + 3) self.SetReadOnly(self.rd.rend_row, self.rd.rend_col, True) class MyImageRenderer(wx.grid.GridCellRenderer): def __init__(self, img): wx.grid.GridCellRenderer.__init__(self) self.img = img def Draw(self, grid, attr, dc, rect, row, col, isSelected): image = wx.MemoryDC() image.SelectObject(self.img) dc.SetBackgroundMode(wx.SOLID) if isSelected: dc.SetBrush(wx.Brush(wx.BLUE, wx.SOLID)) dc.SetPen(wx.Pen(wx.BLUE, 1, wx.SOLID)) else: dc.SetBrush(wx.Brush(wx.WHITE, wx.SOLID)) dc.SetPen(wx.Pen(wx.WHITE, 1, wx.SOLID)) dc.DrawRectangle(rect) width, height = self.img.GetWidth(), self.img.GetHeight() if width > rect.width - 2: width = rect.width - 2 if height > rect.height - 2: height = rect.height - 2 dc.Blit(rect.x + 1, rect.y + 1, width, height, image, 0, 0, wx.COPY, True) def GetBestSize(self, grid, attr, dc, row, col): text = grid.GetCellValue(row, col) dc.SetFont(attr.GetFont()) w, h = dc.GetTextExtent(text) return wx.Size(w, h) class MyApp(wx.App): def OnInit(self): self.frame = MyFrame(parent=None,title="wxPython Window") self.frame.Show() return True app = MyApp() app.MainLoop() The above script output is: Table with buttons in the fifth column.
55805fe89f59965003e9f191df587bc721c572323214335d73015fb881ff3e55
['d51c31bfff4746dba9fd2fd2c36c6894']
I want to move some highlighted code from Eclipse into Microsoft Word. But whenever I try to copy the text over the colours are modified slightly (bright green is changed to a duller green, pink is changed to a lighter pink... etc...) I want to know if there is a way to allow my copied code to keep the same colours when copied. The reason I want to copy the code is because I want to adjust some sizes for certain parts and print it out (I'm making a poster but I liked the highlighting from my coloured theme in Eclipse) Is there any alternate or solution?
043e3aea22f78c08f83649a05a62075214e3883917244a9e9c26ed0fa6e9191e
['d51c31bfff4746dba9fd2fd2c36c6894']
I am trying to call a web service running on a Windows 7 machine inside of IIS 7.5. I can call the web service from the local machine using soapUI and a Java client from another machine and it works. When I try to call the web service from a remote machine using the gsoap framework in a C program, I get an HTTP 400: Bad Request. My request/response is below, any ideas? POST /MyService/AddressService.asmx HTTP/1.1 Host: thisMachine.myDomain.net User-Agent: gSOAP/2.7 Content-Type: text/xml; charset=utf-8 Content-Length: 714 Connection: close SOAPAction: "http://thisMachine.myDomain.net/MyService/AddressService.asmx/CheckAddress" <?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope> <SOAP-ENV:Body> <AddressService1:CheckAddress> <AddressService1:chkAddress> <AddressService1:chkCompanyName>Test</AddressService1:chkCompanyName> <AddressService1:chkStreet1>123 Some Rd</AddressService1:chkStreet1> <AddressService1:chkStreet2></AddressService1:chkStreet2> <AddressService1:chkCity>Columbia</AddressService1:chkCity> <AddressService1:chkState>SC</AddressService1:chkState> <AddressService1:chkZipcode5>29054</AddressService1:chkZipcode5> <AddressService1:chkZipcode4></AddressService1:chkZipcode4> <AddressService1:chkSuite></AddressService1:chkSuite> </AddressService1:chkAddress> </AddressService1:CheckAddress> </SOAP-ENV:Body> HTTP/1.1 400 Bad Request Cache-Control: private Server: Microsoft-IIS/7.5 X-AspNet-Version: 2.0.50727 X-Powered-By: ASP.NET Date: Mon, 29 Aug 2011 19:46:55 GMT Connection: close Content-Length: 0
1f3e571cb032a323a906bb39862c244b724284eeefcffc56c60d8917c57f8ec7
['d51e4ef4503141f48f466c92df028d5f']
1.Please install the pod file and always open with .xcworkspace. 2.Check if any files is deleted from the path (shown in red in workspace), please remove all red files. 3.Check whether files is set for the same target(if not please set all the files for the required targets). 4.Check the settings to add files. Hope above points resolve your problem.
674f5a75deceaee48a0e341881382be4eb106b68a537df42bad1aa917f8beef9
['d51e4ef4503141f48f466c92df028d5f']
In general, Auto Layout considers the top, left, bottom, and right edges of a view to be the visible edges. That is, if you pin a view to the left edge of its superview, you’re really pinning it to the minimum x-value of the superview’s bounds. Changing the bounds origin of the superview does not change the position of the view. The UIScrollView class scrolls its content by changing the origin of its bounds. To make this work with Auto Layout, the top, left, bottom, and right edges within a scroll view now mean the edges of its content view. The constraints on the subviews of the scroll view must result in a size to fill, which is then interpreted as the content size of the scroll view. (This should not be confused with the intrinsicContentSize method used for Auto Layout.) To size the scroll view’s frame with Auto Layout, constraints must either be explicit regarding the width and height of the scroll view, or the edges of the scroll view must be tied to views outside of its subtree. Note that you can make a subview of the scroll view appear to float (not scroll) over the other scrolling content by creating constraints between the view and a view outside the scroll view’s subtree, such as the scroll view’s superview. Here are two examples of how to configure the scroll view, first the mixed approach, and then the pure approach
20af8d84c2e0b328881a068dede9d0b4ab667b069883e58713a07265d25db1b1
['d52a5a9e2db1402488854c66955ad3e0']
you can use Media Querys of css to make a simple responsive system. <style> .row<IP_ADDRESS>after { content: ""; clear: both; display: table; } [class*="col-"] { float: left; padding: 15px; } [class*="col-"] { width: 100%; } @media only screen and (min-width: 600px) { .col-s-1 {width: 8.33%;} .col-s-2 {width: 16.66%;} .col-s-3 {width: 25%;} .col-s-4 {width: 33.33%;} .col-s-5 {width: 41.66%;} .col-s-6 {width: 50%;} .col-s-7 {width: 58.33%;} .col-s-8 {width: 66.66%;} .col-s-9 {width: 75%;} .col-s-10 {width: 83.33%;} .col-s-11 {width: 91.66%;} .col-s-12 {width: 100%;} } @media only screen and (min-width: 768px) { .col-1 {width: 8.33%;} .col-2 {width: 16.66%;} .col-3 {width: 25%;} .col-4 {width: 33.33%;} .col-5 {width: 41.66%;} .col-6 {width: 50%;} .col-7 {width: 58.33%;} .col-8 {width: 66.66%;} .col-9 {width: 75%;} .col-10 {width: 83.33%;} .col-11 {width: 91.66%;} .col-12 {width: 100%;} } </style> <div class="row"> <div class="col-3 col-s-3 menu"> </div> <div class="col-6 col-s-9"> </div> <div class="col-3 col-s-12"> </div> </div>
4a42b3a1d1232181e0456cdf305ebf2faed84fc566cd9832ec53eaad7d4dc253
['d52a5a9e2db1402488854c66955ad3e0']
This is already something that has been discussed before, simply use an inner html and grab the div element by id or class ... I will show you a simple example, you have to do this in JavaScript. /** * A little example */ function addRow(newDivId) { let mydiv = document.getElementById("divId"); //This is a global div that contains others dynamic divs. mydiv.innerHTML = `<div id='{newDivId}'>This is a new div with a diferent id</p>`; } function removeRow(idToRemove) { document.getElementById(idToRemove).remove(); }
260bdf66fb8eeb65dc463821aba42d656a7497513d77fccb69c8d953aeff07d1
['d53b4c7c97e64de286abd6f396be49b1']
I want to host my symfony 4 application online, I configure the appache server to redirect to the index.php file When I go to the server address, here is my error ( ! ) Parse error: syntax error, unexpected '?' in C:\wamp64\www\test\public\index.php on line 18 configuration virtualhost <VirtualHost *:80> ServerName domain.tld ServerAlias www.domain.tld DocumentRoot C:/wamp64/www/test/public <Directory C:/wamp64/www/test/public> AllowOverride All Order Allow,Deny Allow from All </Directory> the index.php file is the basic one generate by symfony thanks
f7fec3cfe1e857546949662120f062f522cc9663ba1e3cd565fedf26b8b6238a
['d53b4c7c97e64de286abd6f396be49b1']
dynamic: driver: %database_driver% host: %database_host% port: %database_port% dbname: %database name% user: %database_user% password: %database_password% charset: UTF8 Hi everybody I would like to connect to multiple databases dynamically. I read this tutorial http://symfony.com/doc/current/cookbook/doctrine/multiple_entity_managers.html and it works as it was explained. But my only problem is to change the value of dbname directly from my Controller to connect to all my databases. It will be 24 hours that I am on this problem. if you have ideas I really need it
d115c0e89414a72b97c10b7bba9a64fa677fad8391f9cc3138f6000f9991d54a
['d54f2313c3654ff1833d373de571a925']
Signed and unsigned bytes (or Ints or Longs) are just two different ways to interpret the same binary bits. In signed bytes the first bit from the left (most significant bit) is interpreted as the sign. 0 means positive, 1 means negative. For negative numbers, what comes after the minus sign is 256 - unsigned-value. So in your case what we get is 256 - 145 = 111. Java / Scala bitwise operators work on the underlying bits, not on the signed/unsigned representation, but of course the results, when printed are still interpreted as signed. Actually, to save on confusion, I would just work with Ints (or Shorts). But it will work just as well with bytes. For example to get the n-th bit you could do something like: def bitValue(byte: Byte, n: Byte) = { val pow2 = Math.pow(2, n - 1).toInt if((pow2 & byte) == 0) 0 else 1 } bitValue(145.byteValue, 8) res27: Int = 1
0a54d912da9ff94fa60fd83e86e4b0f09a2665ba08fbf50cb3296fc31476e02b
['d54f2313c3654ff1833d373de571a925']
You can try doing something like this (tested on PostgresQL, may require some adjustments for other DBs): select * from temp_contacts where to_char(date_created, 'MM-dd') = to_char(current_date + interval '8 day', 'MM-dd'); For each row it first maps the date_created to a string using MM-dd format, then does the same to the current date + 8 days and compares the two. This of course is not using any index, so it will not perform well on a table with large enough size. Some DBs support creating function based indices. For example PostgresQL or Oracle DB. In MySQL you can achieve the same by creating an auto generated column and indexing on it.
fc807080a2bf47cad4b6a53d31e857816c26bc520f3093f19f8bfca4427219d6
['d55c5ddc3c2c489da07dbe5d21cfad04']
I am merging three data sets ( data frames) in R as follows: Prv_mnth_so3 has state, Product_Number , Quantity_On_Hand , Category and Lc_Amount Prv_mnth_soqty <- Prv_mnth_so3 %>% filter( Category== "ESC") %>% group_by (state,Product_Number) %>% summarise(qty = sum(Quantity_On_Hand)) #arrange(state,Product_Number) Prv_mnth_so_esc_amt <- Prv_mnth_so3 %>% filter( Category== "ESC") %>% group_by (state,Product_Number) %>% summarise(esc = sum(as.numeric(Lc_Amount))) %>% arrange(state,Product_Number) Prv_mnth_so_lom_amt <- Prv_mnth_so3 %>% filter( Category== "LOM") %>% group_by (state,Product_Number) %>% summarise(lom = sum(Lc_Amount))%>% arrange(state,Product_Number) Prv_mnth_si <- merge(Prv_mnth_soqty, Prv_mnth_so_esc_amt , Prv_mnth_so_lom_amt, by.x = c("state","Product_Number") , by.y = c("state","Product_Number"), by.z = c("state","Product_Number"), all = TRUE) ``` in out come (Prv_mnth_si ) I expect 5 variables as - State, Product_number), qty, esc and lom but I am not gettig lom in outcome, though in Prv_mnth_so_lom_amt, I can see lom variables is there
ef28a2aa56565e0e6e9e2583f7952248ba3905b7b00e51f93966df357f0d7730
['d55c5ddc3c2c489da07dbe5d21cfad04']
I am uploading one csv file and to standardize the code I want to change the column names. so I am using following code: Prv_mnth_so1 <- reactive({data.frame(lapply(data_uploaded1(),trimws))}) colnames(Prv_mnth_so1()) <- c("GST_ward","Category","order_and_section","combo") but this throws an error Warning: Error in <-: invalid (NULL) left side of assignment 52: server [#12] Error in colnames(Prv_mnth_so1()) <- c("GST_ward", "Category", "order_and_section", : invalid (NULL) left side of assignment it means I can't assign () operator on right side but I am not able to fix this issue
2ebfd1f007eb166604d9d46e0833a9c3950f3854a6d510496ac90fb2b267655e
['d564964df32843b7b781c371c9804ebd']
The relevant paragraph is hidden right in the middle of the extended asm documentation: Use the & constraint modifier (see Modifiers) on all output operands that must not overlap an input. Otherwise, GCC may allocate the output operand in the same register as an unrelated input operand, on the assumption that the assembler code consumes its inputs before producing outputs. This assumption may be false if the assembler code actually consists of more than one instruction. If you had the stores before the loads, you would actually meet that assumption and everything would be fine. Since you don't, then you need to mark the outputs as earlyclobber operands, i.e. "=&l".
a1971b45e5bb98b47965de0d1e10b417aa649f651eef6bb54b7e553c45828c6d
['d564964df32843b7b781c371c9804ebd']
It's armasm's syntax for bitwise operators in expressions. For the GNU assembler, you'll want | instead of :OR:. Since armasm claims that using | as an alias is deprecated for some reason (although & for :AND: and ^ for :EOR: are apparently fine), you may need to resort to some preprocessor magic if you want to maintain compatibility with both toolchains.
64ffee6e148c9df2956c2a88c75880eaff2271e8589f5e157b54b3ad0c8b57ab
['d56769055d6048f89f59078e3fb4c029']
I need to replace a few bytes in ASN1 encoded binary file. Because of I'm completely out of ASN1 scope, I want to just replace some bytes starting at position 9 (offset) and of length 9 bytes. I was able to open a file for binary write fh = open("EmvData_3839_test.der", "r+b") fh.seek(8) fh.write(bytearray(9)) fh.close() this replace my 9 bytes with 00 00 00 .... I need to convert number e.g. 123456789012345678 to something like \x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x00\x01... so that I can put it to fh.write() method and it will replace my old values with new. it is like a split a long number to single digits, then convert them to format \xYY and make an bytearray ? ( I mean to format what file.write() can handle) Please consider that in python I cannot write even a basic loop without googling :) thanks very much
9f6c0bd5a99d9c5d1cb5b12395e0ee8ce2d9548e5dc361aaed61f3262f748a37
['d56769055d6048f89f59078e3fb4c029']
in Grafana (I have 4.0.1) there is possibility to create more organizations. When I switch among them, I always get home dashborard (I think it is loaded from this file "/usr/share/grafana/public/dashboards/home.json" there is on web browser nice Title "Home Dashboard" comming from that file above defined in HTML as <div class="text-center dashboard-header"> <span>Home Dashboard</span> </div> and I want to modify it so that it will show Organization name in from of Home dashboard" e.g. <div class="text-center dashboard-header"> <span> $orgName Home Dashboard</span> </div> $orgName would be a variable which can be get by javascript somehow. the url for getting thiss Orgname is "/api/org" which return json {"id":4,"name":"Base-medium","address": {"address1":"","address2":"","city":"","zipCode":"","state":"","country":""}} at the end it would look like <span> Base-medium Home Dashboeard </span> I have no clue how to write javascript but google search showed me it is possible :). I would appreciate a help with this. I assume I would need to modify this /usr/share/grafana/public/dashboards/home.json file to get work for each Organization switch-over. Thank you in advance
077c00cb06d94f9903a034185892e53bcbb058e6dc900e0d666583b0e105df1e
['d5750fff2b9b497a994a71d0ae68bb81']
I've updated my post, re-wording everything and providing better info. I've also started over with my Postfix configuration by purging the application from Linux, re-installing it and starting over to ensure there wasn't something wrong that I've done. I have also given my server a hostname name that prefixes my public domain as you were pointing out.
fd6fd8006bf58a26f67d81786000f4e61b0ae9da373ec506fcad8d0fe75c9236
['d5750fff2b9b497a994a71d0ae68bb81']
I think one of the coolest definitions of machine learning that I've read is from this book by <PERSON>. Easy to remember and intuitive. A computer program is said to learn from experience E with respect to some class of tasks T and performance measure P, if its performance at tasks in T, as measured by P, improves with experience E
563659cf07d9195a69b4c12e1448e402f8466693a0940ca259ffd2b9cfd40bd7
['d58c2ecdf65d4f6a88b978d99a53f321']
I have a Apache server (part of WAMP) that is open to request from the network. I have two networks that I am using (192.168.1 and 192.168.2). The Apache is listening only to the second network (192.168.2) even if it is off and I am connected to the first network. I tried to change the "listen" parameter in the httpd.conf Listen <IP_ADDRESS>:80 But then when I restart the WAMP, its color indicates that it failed.
5d38c9fd5f07c71d974e0348221d66f7b371b6e658832df3883dd59223c248a4
['d58c2ecdf65d4f6a88b978d99a53f321']
It is very strange but today, I re-entered the same facebook page. And again, clicked on the "products (+)" link. To my surprize, now I see many products in the page. I clicked on the "Facebook Login", and how I see it under the "Products". So I clicked on it, and was finally able to set the "Valid OAuth Redirect URIs" (from firebase). So basically, you just need to wait a day to do it.
3a80b18371470ad23d059337a09cef596c1cc18dd2fa3bb0d852f6a3e61cceeb
['d58c9db7ae254471937c81bfbdd6df49']
Can someone explain what will be the order of execution of following JavaScript Code: (true + false) > 2 + true I understand using + operator over two Boolean values returns the result as 0,1 or 2 depending upon the values being provided. I interpreted output of above code as 1 by breaking the execution in following order: 1) (true + false) // Outputs : 1 2) 1 > 2 // Outputs : false 3) false + true //Outputs : 1 But the actual result is: false Can anyone correct my understanding if am interpreting the code in wrong way.
2b04d5ea60b9bbb262872645cef2049dd6e78a4e03d711e1912cfdc609df707f
['d58c9db7ae254471937c81bfbdd6df49']
Can someone explain what is the difference between following two IIFE blocks: a) (f1 = function(){console.log('IIFE Block1')})() b) (var f1 = function(){console.log('IIFE Block2')})() I understand that "b)" upon execution will throw error. What is the use of defining the variable "f1" and what are its properties.
858f583f61f45918edb143b073f74f4dc9f657572e24c306a50d163a2515345f
['d595a2a3d9da4c67bdab5292f25accbd']
I have an app where clicking on different buttons in a quick succession is necessary but Cocoa seems to disallow it. I'm using the same subclass of NSButton on all the button instances and the mouseUp/mouseDown events call actions based on the button's instance tag (defined in IB). The problem is that clicking different buttons quickly triggers the click on the first button but not the current button being clicked. How do I fix this? Note: I'm using Swift 3 and targeting the latest macOS.
a743c0a44c678e68b587081ac186077fd3fe69323ec9d8bf1c56883af95f34a5
['d595a2a3d9da4c67bdab5292f25accbd']
If you are not going to built it yourself then jQuery Mobile is probably the way to go. Description from their website: A unified, HTML5-based user interface system for all popular mobile device platforms, built on the rock-solid jQuery and jQuery UI foundation. Its lightweight code is built with progressive enhancement, and has a flexible, easily themeable design.
91231cf04930ef8da94db70dcad096378971c51f9840970fafc25d938202617d
['d5980eee8b514e6c80da3cbc4fadbb14']
I frequent this site a lot, but I've come across something I haven't found that I can answer. This is similar to several other posts, here, but I have not found an answer to what I am looking for. As a note, this is part of a school course, and this is currently a standalone java class of a larger java project. Currently, I am unable to edit the .txt file, and am restricted to using ONLY the following resources: Standard JDK resources java.util.Scanner; java.io.FileInputStream; java.io.IOException; Using the following list: john.doe 108de81c31bf9c622f76876b74e9285f "dead man" user jane.doe 3e34baa4ee2ff767af8c120a496742b5 "dead woman" admin barney.rubble a584efafa8f9ea7fe5cf18442f32b07b "secret password" mod fred.flinstone 17b1b7d8a706696ed220bc414f729ad3 "R0ck3y business" user luke.skywalker 3adea92111e6307f8f2aae4721e77900 "usetheforce1234" mod leah.skywalker 0d107d09f5bbe40cade3de5c71e9e9b7 "saveme" admin Each entry is separated by a tab. The current java code that I have, is as follows: public static void main(String[] args) throws IOException { FileInputStream credFile = null; // File input Scanner inFS = null; // Scanner object final int NUM_ROWS_CRED = 6; final int NUM_COLS_CRED = 4; String[][] credArray = new String[NUM_ROWS_CRED][NUM_COLS_CRED]; int i = 0; // Index variable int j = 0; // Index variable // Import file data from file.txt credFile = new FileInputStream("file.txt"); inFS = new Scanner(credFile); // Create array of file.txt for (i = 0; i < NUM_ROWS_CRED; ++i) { for (j = 0; j < NUM_COLS_CRED; ++j) { credArray[i][j] = inFS.next(); } } // Output array to verify array stored correctly. for (i = 0; i < NUM_ROWS_CRED; ++i) { for (j = 0; j < NUM_COLS_CRED; ++j) { System.out.println(credArray[i][j] + " "); } System.out.println(""); } credFile.close(); //Closes file. } My current output looks like this: john.doe 108de81c31bf9c622f76876b74e9285f "dead man" user jane.doe 3e34baa4ee2ff767af8c120a496742b5 "dead woman" admin barney.rubble a584efafa8f9ea7fe5cf18442f32b07b "secret password" mod fred.flinstone 17b1b7d8a706696ed220bc414f729ad3 "R0ck3y business" user luke.skywalker 3adea92111e6307f8f2aae4721e77900 "usertheforce1234" mod Expected Output: john.doe 108de81c31bf9c622f76876b74e9285f "dead man" user jane.doe 3e34baa4ee2ff767af8c120a496742b5 "dead woman" admin etc... Solutions, guidance, pointers in the right direction are all welcome. Also, please remember that I am firmly restricted to not editing the .txt file, and only used the JDK and the 3 resources listed. Thank you.
f87f066c619d150642ea1f0f766a65caa61a6ff5ec54a947e77925c7542c6997
['d5980eee8b514e6c80da3cbc4fadbb14']
I figured out the solution to my own question. The issue lied with this section of code: // Create array of credentials.txt for (i = 0; i < NUM_ROWS_CRED; ++i) { for (j = 0; j < NUM_COLS_CRED; ++j) { credArray[i][j] = inFS.next(); } } I needed to correct the way the way I was reading the information from the scanner, inFS, into the array, credArray. I did it by changing the code to: // Create array of credentials.txt for (i = 0; i < NUM_ROWS_CRED; ++i) { for (j = 0; j < NUM_COLS_CRED; ++j) { credArray[i][j] = inFS.next().replaceAll("\\n", ""); } } This automatically erases any new-line code entries for lines 2-6.
8a84a62aa2417b042502a158d0f72692ec654f4e4faab438c8980da09bb4f4c0
['d5a3ea4446f14b1d80b493cb583d45ba']
Okay. Some laptops does not have the option in the bios, it's most likely to be found on the Asus' system setting when you've booted into your OS. Look around for it to see if you can find something like that. Also, I wish you luck with Asus support to help us solve one problem at hand.
5b0e3f8d7d846bf175f2af4f989094e4d26a70cac35ff5d4364004fa2e3c5702
['d5a3ea4446f14b1d80b493cb583d45ba']
To prove that your function is strongly convex with parameter $\sigma$, we must show that $X^TAX - \sigma I$ is positive semidefinite, which is equivalent to saying $$w^TX^TAXw \geq \sigma w^Tw$$ for any $w$. We can set the constraint $||w||=1$ and since $A$ is positive definite, we can set $\tilde{A}=\sqrt{A}$ to get $$w^T(\tilde{A}X)^T\tilde{A}Xw \geq \sigma,$$ which holds true for any $\sigma$ less than the smallest singular value of $(\tilde{A}X)$.
c2d51699acf729cc3c4c41d870f4fce69d8369d129d3d92027cefecafdac1642
['d5abb7a7d7c04b718f5b901b9f12810c']
Now I'm coding VHDL to make a one-shot timer module. But I don't know which code is right in two kind of code, the first or second. i used the testbench i see the different. What the right code for monostable (one-shot) ? This is the first code: library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.NUMERIC_STD.ALL; library UNISIM; use UNISIM.VComponents.all; entity oneshot is port ( clk : in STD_LOGIC; ce : in STD_LOGIC; trigger : in STD_LOGIC; delay : in STD_LOGIC_VECTOR (7 downto 0); pulse : out STD_LOGIC :='0'); end oneshot; architecture Behavioral of oneshot is signal count: INTEGER range 0 to 255; -- count variable begin process (clk,delay,trigger) begin -- wait for trigger leading edge if rising_edge(clk) then if trigger = '1' then count <= to_integer(unsigned(delay)); end if; if count > 0 then pulse <= '1'; count <= count - 1; else pulse <= '0'; end if; end if; end process; end Behavioral; This is second one: library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.NUMERIC_STD.ALL; library UNISIM; use UNISIM.VComponents.all; entity oneshot is port ( clk : in STD_LOGIC; ce : in STD_LOGIC; trigger : in STD_LOGIC:='0'; delay : in STD_LOGIC_VECTOR (7 downto 0); pulse : out STD_LOGIC :='0'); end oneshot; architecture Behavioral of oneshot is signal count: INTEGER range 0 to 255; -- count variable begin process (clk,delay,trigger) begin -- wait for trigger leading edge if trigger = '1' then count <= to_integer(unsigned(delay)); elsif rising_edge(clk) then if count > 0 then pulse <= '1'; count <= count - 1; else pulse <= '0'; end if; end if; end process; end Behavioral;
8957bedb2bd5f7701aa7f5daf52e3099201eebec00bee990804415d8b2c0bcc4
['d5abb7a7d7c04b718f5b901b9f12810c']
I use code VHDL to make a one-shot timer in Simulink by "black box" of System Generator. The module concludes input is: clk, en, trigger, delay & output is: pluse. Now I want to use System Generator to implement on Zynq 7020 and use clock frequency = 1.562Mhz. I read "ug897-vivado-system generator-user", but i still dont know how to configure clk. The diagram in Matlab/Simulink The VHDL code for one-shot timer/black box library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.NUMERIC_STD.ALL; library UNISIM; use UNISIM.VComponents.all; entity oneshot is port ( clk : in STD_LOGIC; ce : in STD_LOGIC; trigger : in STD_LOGIC:='0'; delay : in STD_LOGIC_VECTOR (7 downto 0); pulse : out STD_LOGIC :='0'); end oneshot; architecture Behavioral of oneshot is signal count: INTEGER range 0 to 255; -- count variable signal bus_rising_edge : boolean; signal input_sync : std_logic_vector(0 to 2); begin input_syncronizer : process(clk) begin if rising_edge(clk) then input_sync <= to_x01(trigger)&input_sync(0 to 1); end if; end process ; bus_rising_edge <= input_sync(0 to 1) = "10"; trigger_process: process (clk) begin -- wait for trigger leading edge if rising_edge(clk) then if bus_rising_edge then pulse <= '1'; count <= to_integer(unsigned(delay)); elsif count > 1 then pulse <= '1'; count <= count - 1; else pulse <= '0'; end if; end if; end process; end Behavioral; The Matlab code automatically create when importing VHDL code https://drive.google.com/open?id=1jfztL-NgftDc7VAgAX4eHfuJF8uOgK3V (sorry i cant post my code properly)
ae2437286b642a00d24a766b73dbb4adee83b064a4566fb62f06b022c4ae354c
['d5c07241275442eb888d3f5dc8c6c709']
After creating a few portlets, add last div with class addspace. Then create a function with .replaceWith and a .addClass. $('.addspace').replaceWith(html); Example of returned HTML: <div class="portlet" id="portletname"> <!-- make sure portletname is unique --> <div class="portlet-header">test</div> <div class="portlet-content">test</div> </div> <!-- New addspace (replaceWith replaces the old one) --> <div class="addspace" > </div Add portlet class to div by id: $('#portletname') .addClass("ui-widget ui-widget-content ui-helper-clearfix ui-corner-all") .find(".portlet-header") .addClass("ui-widget-header ui-corner-all") .prepend('<span class="ui-icon ui-icon-minusthick"></span>') .end() .find(".portlet-content");
7a13b0cbfcb9b55c9c9cb74ce4218ec6703dad70ada882b935bbfdd23693f441
['d5c07241275442eb888d3f5dc8c6c709']
From IBM iSeries DB2 I recieve a ordered quantity DEC 11,4. In iReport I use java.lang.Float to print the value. Also I have a pattern #,##0.0000;-#,##0.0000 (4 Decmimal places, 1000 separator). When something is ordered in Metric Tons, this is no problem, but when something is ordered in pieces, it also prints "2,0000". This is confusing, how do I hide the ",0000"?
abb05095bf5128d6a49070a20fe1217e90edf6f2875570ce45ea42bcc221175d
['d5d88953cd8a45fca93d8684a8fe0ddf']
I am popular with TFS for a long time but now I am required to port to Git. After some days, I have some problems I need your helps: TFS defines WorkItem and checkins will be put in this WorkItem. I easily get all changed files in WorkItem to create a deployment packages. WorkItem is awesome in TFS because when I have 2 tasks which run in same time, I create 2 WorkItem for each task, I easily check-in files in WorkItem I want. Now on Git, I don't find this feature. How to archive only changed files in selected commits (1 or more commits). I am using TortoiseGit like a GUI and Git Source Control Visual Studio Extension. Please help me on them. I don't like to use command line. Thanks.
8cd7a7c493fa25a7578910f4f358b0c6d5250289e3553899016ed600970d7309
['d5d88953cd8a45fca93d8684a8fe0ddf']
I use Java Applet like an example. When you open a website which has a java applet on web page. The java applet application will run in web page. Applet support to detach itself out of the web page and run as a single instance. I have a question: If I have a control inside a form, or this control maybe in a lot of other controls. On the form will have a Full Screen button. When user click on it, I want this control will be full screen. HOw to do it? Please give me the solution. Thanks. Note: My application is WinFORM C#, .NET 2.0.
60dad704cab196951abba7509658d8ff1d651fbf5cdf4614ac4f1488659d176d
['d5e3a0eccbd943fd9655cb896231eedd']
I have .NET Core 3.1 executable, compiled as framework dependent / portable. I'm running it on a CentOS server, with the .NET Core Runtime installed. The application works completely fine when executed in the terminal, but when I execute from a .service file with systemd, it always "freezes" when executing a http request. Here's the .NET code: //Systemd - Bug hunting Console.WriteLine("starting download.."); var c = new HttpClient(); var _download = await c.GetStringAsync("https://www.google.com"); Console.WriteLine($"Downloaded {_download.Length} characters."); //--------------------- Console output when run in the CLI: starting download.. Downloaded 47466 characters. As expected.. However, if I run this from a service, the console output (from journalctl) looks like this: Jan 18 23:34:13 myvps.local mydaemon[1385]: starting download.. Jan 18 23:34:23 myvps.local systemd[1]: mydaemon.service holdoff time over, scheduling restart. Jan 18 23:34:23 myvps.local systemd[1]: Stopped My Daemon Service. Jan 18 23:34:23 myvps.local systemd[1]: Started My Daemon Service. And then it starts over again. It might be worth mentioning that this C# code is executed in a separate thread. Here's the service configuration file (/etc/systemd/system/mydaemon.service): [Unit] Description=My Daemon Service [Service] WorkingDirectory=/home/myuser/applicationDir ExecStart=/usr/bin/dotnet /home/myuser/applicationDir/mydaemon.dll Restart=always # Restart service after 10 seconds if the dotnet service crashes: RestartSec=10 KillSignal=SIGINT SyslogIdentifier=mydaemon User=myuser Environment=ASPNETCORE_ENVIRONMENT=Production Environment=DOTNET_PRINT_TELEMETRY_MESSAGE=false [Install] WantedBy=multi-user.target From what I've observed, the service somehow isn't able to send any http requests. I tried this multiple times and I got the same result every time. The dotnet application doesn't seem to crash, it rather "freezes" and then the restarting timer from the service sets in, causing the application to restart. How do I need to configure my service for this to work?
cea11e5b6cb0eb0c511546d75050c22788975e45f9630fd18bfabbe96835b277
['d5e3a0eccbd943fd9655cb896231eedd']
In short: I want to use UI Automation in FL Studio 20 using C#. I know there are a lot UI automation frameworks out there. Currently, I'm using Teststack.White but this framework is made for Win32, WinForms, WPF, Silverlight and SWT based applications. It works sort of for FL Studio 20. Here's what I mean: The red rectangle is from a UI Inspection tool. And it is exactly what Teststack.White sees. It can make out the containers, but never the actual, clickable elements. Right now the only option I have left to click the button, is to get the location of the container and then simulate a mouse click with an offset. But that's only gonna work if the display resolution stays the same. So my question is: Is there any framework that can handle these type of UI's? And does anyone know what GUI technology FL Studio is using? I know it's written in Delphi but that's all I know. Here's the code that clicks the button using the offset-method I mentioned above (it's for a different button, but the code stays roughly the same): TestStack.White.Application application = TestStack.White.Application.Launch(@"C:\Program Files (x86)\Image-Line\FL Studio 20\FL.exe"); this.window = application.GetWindow("FL Studio 20", InitializeOption.NoCache); UIItemCollection coll = window.Items; Panel itemToClick = null; foreach (UIItem item in coll) { if (item.Name.Contains("Piano roll")) { if (((Panel)item).Items.Count == 0) { itemToClick = (Panel)item; break; } } } window.Focus(); var mouse = window.Mouse; Point p = itemToClick.Location; p.Offset(11, 12); mouse.Click(p);
34c009cbe9a6fa3faab22ef4f7cac3827beaf460d148db34ccb317f82d3adbb8
['d5e83b3eca3a4fe1a6f600b43874bdcf']
Without highlighting, I use: (defun python-eval-expression () (interactive) (let ((py-command (read-string "Command: "))) (save-excursion (setq elpy-shell-echo-output t) (setq elpy-shell-echo-input t) (elpy-shell--with-maybe-echo (python-shell-send-string py-command))))) Should be easy to adapt to choose the current selection if exists (using
d9732ae0254c453f2a15b81bdfffa7cc4a15e5c4da350a643057e2cf25dfd910
['d5e83b3eca3a4fe1a6f600b43874bdcf']
For more general boolean functions that you would like to use as a filter and that depend on more than one column, you can use: df = df[df[['col_1','col_2']].apply(lambda x: f(*x), axis=1)] where f is a function that is applied to every pair of elements (x1, x2) from col_1 and col_2 and returns True or False depending on any condition you want on (x1, x2).
578fc015b1e4fec97ef970ccbbd59e9ed349c29aa864bc129101c8837b142b4d
['d5fe580a5ae847c782939646d5861009']
I tried import hbase 2.1.0 of cloudera 6.3.3 at my gradle file like this: compile ("org.apache.hbase:hbase-client:2.1.0-cdh6.3.3"){ exclude group: 'org.slf4j' exclude group: 'org.jruby' exclude group: 'jruby-complete' exclude group: 'org.codehaus.jackson' exclude group: 'org.codehaus.jettison' } When I refresh the gradle , it shows below error: Could not resolve org.apache.hbase:hbase-client:2.1.0-cdh6.3.3. I tried refreshing gradle dependencies , but no luck Any help appreciated! Thanks in Advance!
d4dde9e219995b05dcf41ad19482f3f1f4b3e8ceba1cafd0e15ae06a802acde1
['d5fe580a5ae847c782939646d5861009']
I need to generate a job-id for user-request call which I thought of handling it through python-theading using below block: from flask_restful import Resource from flask import copy_current_request_context import uuid import time class ScoreReportGenerator: def trigger_job(): try: # Do memory-intensive process return "success" except: return "failure" class JobSubmitter(Resource): def post(self): job_id = uuid.uuid4() @copy_current_request_context def start_score_report_generator_thread(payload_data, job_id): score_report_generator = ScoreReportGenerator() score_report_generator.trigger_job() t = threading.Thread(target=start_score_report_generator_thread, args=[payload_data, job_id]) t.setDaemon(False) t.start() response = dict() response["status"] = "RUNNING" response["jobId"] = str(job_id) return response Here what had been noticed, around 70GB of RAM is occuppied by this spawned thread, after completion of thread 70GB of RAM remains occupied. After killing the whole python application, RAM is getting released. Looking forward for suggestions to release RAM-Memory consumption, any help welcomed! Thanks in advance!
52f7626afdf02b7418630a0de18ff7d48b215044135a5e656abfef2140f6a877
['d5ff205ed3304fa493fa7f6e57d98d79']
Is it possible now to get all results from Freebase Search API? Today I was trying 2 approaches in Java: 1) www.googleapis.com/freebase/v1/search?filter=..." Using "cursor"(integer) and "limit" options. 2) www.freebase.com/ajax/156b.lib.www.tags.svn.freebase-site.googlecode.dev/cuecard/mqlread.ajax?&query= Try to simulate 'Query Editor' (https://www.freebase.com/query) Using "cursor" from the previous results set (String). But in both of these approaches I got only - 200 (first option) - 500 (second option) records (should be about 6000 records) ... After several iterations I have got - "Request too large, cursor: 200, limit: 200" (first option, only 1 iteration) - "cursor is false" (second option, 6 iterations) message. Is it Freebase problem or may be API limitations? How could I get all results?
d6a5dd65f1dd8ac655da77ea330859660d101c636e1219d3c3344df0e194878c
['d5ff205ed3304fa493fa7f6e57d98d79']
I have about 8 million documents(with URL) in the ElasticSearch(v.0.90) index but only 3,5 millions documents are "valid"(need to be searched within). I have a list of all "valid" URLs(no special template here). How can I delete other 4,5M documents from the index?
2a33385ed0f2a2f3d07e25d3461e9f6b19a0a1917b82be3e0594cd56f02d39f8
['d600b95fbc2b4551a289954ed2b23128']
I am trying to programmatically log in a wordpress user, using the following function for that. public function auto_login( $user ) { $username = $user; if ( !is_user_logged_in() ) { $user = get_user_by( 'login', $username ); wp_set_current_user( $user->ID, $user->user_login ); wp_set_auth_cookie( $user->ID ); do_action( 'wp_login', $user->user_login ); } } Unfortunately it seems not to be working. That function is called from within a shortcode. Could this be the explanation ? Should I rather hook my function to some filter, before any content is output ? Also I would like to redirect the newly logged in user to a specific post based on a $_GET parameter, can I simply add a header redirect at the end of the function ? Thank you in advance for your help !
478619f28dea093fc884ec2a1db17bde738856dc6c2e730cb5b0c9bd560ff085
['d600b95fbc2b4551a289954ed2b23128']
I am trying for the first time to build a plugin for Wordpress following OOP way. I am having some problems while trying to create a submenu page using add_users_page() function. Here is a simple version of my code : class MyPlugin { public function __construct() { add_action('admin_menu', array($this, 'create_menu')); } public static function create_menu() { add_users_page( 'My Plugin Menu', 'My Plugin Menu (Test)', 'list_users', 'mp_test_page', array($this, 'display_test_page')); } public static function display_test_page() { if ( !current_user_can( 'list_users' ) ) { wp_die( __( 'You do not have sufficient permissions to access this page.' ) ); } echo '<h2>Test page</h2>'; echo '<p>The Problem : I cannot see that output in the corresponding submenu page</p>'; } } new MyPlugin(); The problem is that I cannot see the html output in the display_test_page() function... although the submenu page was indeed created in the Users general menu. Thank you in advance for your help,
f7a3ef5b764143d96ce894f6a2d63250cb697e7bb262cf7ed519ece0266a96e4
['d600f32dac7843b892dac3b45d40be8d']
I have an Excel template where the underlying values are updated via SAS. There are predefined formulas in the template that do not update when the data changes. The workbook is set to automatic calculation. F9, or any combination of keys and F9, does not update the cells. The only way to update them is to click inside the formula box and hit enter. The cells are not formatted as text. These are simple formulas such as =Data!A1 There are no error messages. The cell displayed values simply do not update.
78a470c260c26667312fece59e05bc4acce88041901818427b02467ef28c78ef
['d600f32dac7843b892dac3b45d40be8d']
I have RStudio 1.1.419 running on a Mac OS El Capitan. I am trying to install the dplyr package. The installation first attempts to install package utf8. The following is the text I get back: installing source package ‘utf8’ ... ** package ‘utf8’ successfully unpacked and MD5 sums checked ** libs llvm-gcc-4.2 -arch x86_64 -std=gnu99 -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/include -Iutf8lite/src -fPIC -mtune=core2 -g -O2 -c as_utf8.c -o as_utf8.o make: llvm-gcc-4.2: No such file or directory make: *** [as_utf8.o] Error 1 ERROR: compilation failed for package ‘utf8’ removing ‘/Users/andrewdkilmer/Library/R/3.2/library/utf8’ Warning in install.packages : installation of package ‘utf8’ had non-zero exit status Since utf8 failed to install, dplyr cannot install either. Why am I getting this 'No such file or directory' error?
6682cd184fe3f398564a00841d912e4557668ebace87a1a80bfac6d10433946f
['d607ad78d7ee4dc48b55e5782ca70cd9']
This I can't get my simple brain around. A comma-delimited array of products ordered is passed to a procedure like so: set @array = 'productID_47, productID_4' select productID, price from Products where @array like '%' + productID + '%' Two records are returned. Great. But then if I have: set @array = 'productID_47' select productID, price from Products where @array like '%' + productID + '%' Again, two records are returned which is NOT what I want. The product codes are fixed, sadly. Any help would be appreciated, thanks
132f2b7fdc25bc9f03cbd12e61c02a04f2ccc78f9288777b26c8f0512cf551a7
['d607ad78d7ee4dc48b55e5782ca70cd9']
I have an AJAX call to retrieve a JSON encoded object ('result') that may contain some null values. When I use $.each(result, function(x,y) { y.myvalue + "<br/>"; } to output the values, any null value is converted to the string "null". I am aware I can use a dateFilter callback function in my AJAX call to replace null values, but that seems expensive, unreliable and unnecessary. I could also do something like: $.each(result, function(x,y) { (y.myvalue || "") + "<br/>"; (y.myvalue ? y.myvalue: "") + "<br/>"; } But those mechanisms both seem messy. What's the easiest, slickest, least expensive way of handling this? I've read a few questions on this site with similar issues but I've yet to find a definitive answer.
4d369beaf27172efa82a483753a47d05e0952db40f627783ea0d12d5e4971840
['d610660bf2064717a24b7c30ddc76ae9']
Please consider this MWE: \documentclass{article} \usepackage{glossaries} \makeglossaries \newglossaryentry{date} { name=1 October 1999, description={He saw him} } \begin{document} He saw him on \gls{date}. \printglossaries \end{document} This will result in 1 October 1999 on the left of the glossary. However, I would like it to appear as 1999, 1 October because it is easier to read dates in the glossary when the year always comes first. How can you use different names for a glossary entry depending on whether the glossary entries appears in the glossary or in the text?
cd13611ed7d14b9c8bd340805db829ba3a450220a983a7ae485263d4c18c02d9
['d610660bf2064717a24b7c30ddc76ae9']
I tried `Select[Join[ solution, {{g[1] -> 1, h[3] -> 1, g[2] -> 0}, {h[3] -> 1}, {g[1] -> 2 g[2], h[2] -> 1}}], ({g[1], h[3]} /. #) != {0, 0} &]`, and it only gives me `{{g[1] -> 1, h[3] -> 1, g[2] -> 0}, {h[3] -> 1}}` Somehow while it admits your last example, it doesn't admit my new example. It just seems my guess about why it's behaving this way is wrong...
384d4436b8b1f3d1c971611927b45749919780fe19c970629d16bda23c26ffa3
['d61380add56d42f2a5fad0aa95ee40c1']
Superb - love the answer. I read a piece on beer history recently that claimed BIAB multi bag is probably the oldest form of brewing, and that the mash tun / sparge system is a relatively new invention so that much larger volumes can be made. So, it’s like a new old method.
68ef114b9c37699e1163678dae4712b35fa10621c0703538967b23295fed212d
['d61380add56d42f2a5fad0aa95ee40c1']
First off, you need to figure out how big your downtime window is, and what their expectations are. The window and their expectations will determine what technologies are used to reduce downtime. Secondly, see how long it takes you to restore the server on the second box from the ground up. This is your baseline. Third, figure out how you can meet the window and reduce restoration time. Also, figure out how much they want to spend. This is where you negotiate uptime versus cost. You can get crazy by buying vSphere with a SAN, or you can run some scripts every couple of hours and ship the data to a warm spare. Fourth, run DR drills to make sure everything works. The server PSUs should be redundant and hot-swappable. I would call HP to be sure and test it in a maintenance window after calling them.
cba6140c91a758a3375dfe9685dda5b3ac65320356b52941fff5ceaea8afef3b
['d6142851179f4b0cb1e9115d0beb13d6']
There's a program /usr/sbin/vcstime which prints the date/time in the top/right corner of your terminals. You can enable it in /etc/kbd/config (on the last line). It's disabled by default. I'm having a problem whereby each time I ssh into one of my servers (Debian Jessie) vcstime runs. I don't know why it is running. My /etc/kbd/config file does not enable it. I moved /usr/sbin/vcstime to /usr/sbin/vcstime.disabled. I rebooted. And still I have the problem. I grepped for 'vcst' and didn't find anything interesting. I have no idea why the clock is always printed in my terminal. It's getting in the way of some content that always prints on the top line and I need to make it go away. Can anyone help with that? Note: if I run /etc/init.d/kbd restart the clock disappears for a second then reappears.
93a69b07d5b841df0235884b7032b60f5b5a9dc57800dd8ff1f9598500575724
['d6142851179f4b0cb1e9115d0beb13d6']
Hereby my solution in text. Imagine a bone with the tail at the centre of a drive wheel of a steam locomotive. Adding a second drive wheel a simple: add another armature (bone) at a certain distance from the first one in the X-direction. Then connect those two drive wheels with a connection rod. I tried to ad another armature (bone) with constraint 'Copy Location' with the second drive wheel as Target. In the field labeled Bone, I see a bone, just what I wanted. Problem 1: Changing Head/Tail from 0 to 1 has no effect at all!?! Thanks to the former help, I clicked in the field and to my surprise I could choose 'Bone'. That's weird in my opinion, why have to select 'Bone' if I already selected a bone as target? Anyhow, this does the trick: Head/Tail to 1 and problem solved. Adding Constraint 'Track To', target=first drive wheel, Bone=Bone, Up=X, To=Z and scaling to top it off. Then imagine a piston, moving horizontally backwards and forwards. A primary connecting rod from this piston to the first driving wheel translates this horizontal movement to rotating. The tip you gave me was to use drivers. So I designed a formula for the X-location of the piston: -sqrt(4-cos(r)**2)+sin(r), where r is the rotation_euler of the driving wheel and 2 is the length of the connection rod. Constraint 'Copy Location' for the primary connecting rod to the first driving wheel head and 'Track To' the piston gives me what I wanted. The formula I came up with at first was -sqrt(4-cos(r)**2)-sin(r), giving me the same result as using the Blender Keep Distance-modifier.
cafab431e28f8a1f6dcfb24198169b4f1df72643b117a10a11cb34252ed4c0a1
['d61466a1d06747fa97cdc628904c22a3']
+1 @Yannis Rizos: **+1 for the [SE-Data query](http://data.stackexchange.com/programmers/query/60095/closed-non-dupe-questions).** Beyond that, the question was only about practice alignment, not execution; meaning on Security.SE, some mods appear to have had the position that some questions are an okay fit as closed questions, but not as open questions; which was perplexing to me.
69a77a2cefaac415373ff7bc90a9667abbe1345a03bb4fecad9e452614df9a79
['d61466a1d06747fa97cdc628904c22a3']
@Christi: Even particleboard (as others, I suspect this is what you mean by 'fiberboard') can be easily drilled with a classic drill bit or a brad drill bit. Even if the drill bit is dull the drilling can be done, even if not as easy. There must be something very out of line for the drilling to fail as described. For example, the drill in reverse..
984191c6bdc5ebf8834058be67eadae362bc96ef35fc1be3fb386dfafef8b678
['d619ea28de104f179c6af16a77c9e290']
I am trying to take an attached excel file from a DAO.recordset, open it, edit it with new information and resave the file to the database all within MS Access 2007. Currently I am having trouble finding any similar task that someone has completed so that I can see how to open an attachment object from a DAO.recordset within vba. I'm guessing it isn't too bad to do once I get past the opening a saved attachment part. I have yet to find any reference material on this topic. Has anyone done anything like this or know how to edit an attachment within vba? Any insight would be much appreciated. Thanks
07cd4365725e05330ceadb4e6aaa5d2c2904255060fae85a66f4a5d59b409407
['d619ea28de104f179c6af16a77c9e290']
I am assisting with a local MS Access database and am creating a number of extensive forms. I was wondering if it is possible to create forms via HTML or Javascript (rather than creating them directly within Access) and then use them locally within the database? Has anyone run across anything like this?
af6e53851c17ed6a5da322bab80a5ca8a4a94c555ef5acb6564bf2faa7e6a155
['d623dba2382c4a4e95efff036345e308']
As per my understanding the system HW is good but still the restart is happening for every 1/2 hour, So my suggestion is to check with Microsoft and upgrade your OS, because i had similar issue, but for it reboots for every 2 hours, so i have changed my OS and its working fine. Regards, M.Vetrivel
4f7ad9dd7ce1f0d35af7ec3cb9ec28f8bbb8b1859294918b407ae3b559fdb0c5
['d623dba2382c4a4e95efff036345e308']
If you are using RestfulAuthentication with friendly_id, the latest version of friendly_id can bring this error as indicated on the github page: Also, this feature uses attr_protected to protect the cached_slug column, unless you have already invoked attr_accessible. So if you wish to use attr_accessible, you must invoke it BEFORE you invoke has_friendly_id in your class. github page Also, when using grep to find occurences of keywords, don't forget to grep also in gems as you may have installed some plugins as gem archive.
e213bb3ab1fc10ed4eb6627981badf1f11b6e05a6499430b99ec870cc9d96f5b
['d627500af13e486c880759884fdd4326']
The problem was that in the game in the main scene I locked the mouse cursor and also make the mouse cursor not to be visible. So what I did is attached new script to the main menu to a empty gameobject with two lines in the Start: Cursor.visible = true; Cursor.lockState = CursorLockMode.None; And now everything is working great. I can click on the escape key at any time and place in the game back to the main menu and click on new game and it's starting the game over.
6d7cb40846d46a51f6be84dc42e20bdbd1cd65c1746df88673bcb10467815c0a
['d627500af13e486c880759884fdd4326']
I don't want to find the shortest way and not moving in diagonals. The start position and end position are both on the edges walls so in the start i can't move back and in the end i can't move forward (depending on what direction the player is facing when getting to the end position ). I want to move only left,right,forward but randomly. Randomly i mean that in the start i have only 3 directions possible moves: Forward,Left,Right so i want to store the 3 directions and then to pick one random direction for example Left to rotate the player facing to the left and then moving to the waypoint on the left the nearest waypoint on the left. Now if he moved left now he have two directions to move right or keep forward and again to pick random direction from this two. I want that the player will never go back to the last waypoint he visited. So in any case the player will have 2 or 3 directions to move and each time to pick random direction to move to. The red is the start position the blue is the end position. So i want to create a random path from the red to the blue. using System.Collections; using System.Collections.Generic; using UnityEngine; using System.Linq; using System.IO; public class PathFinder : MonoBehaviour { private Transform start; private Transform end; public void FindPath() { GenerateStartEnd(); GenerateRandomPath(); } private void GenerateRandomPath() { GridGenerator gridgenerator = GetComponent<GridGenerator>(); List<float> distances = new List<float>(); List<float> rotations = new List<float>(); for (int i = 0; i < gridgenerator.allBlocks.Length; i++) { var distance = Vector3.Distance(start.localPosition, gridgenerator.allBlocks[i].transform.localPosition); if (distance == 1.5f) { var angle = Vector3.Angle(start.localPosition, gridgenerator.allBlocks[i].transform.localPosition); rotations.Add(angle); } } distances.Sort(); } void SmoothLook(Vector3 newDirection) { start.rotation = Quaternion.Lerp(start.rotation, Quaternion.LookRotation(newDirection), Time.deltaTime); } private List<Vector3> GenerateStartEnd() { GameObject walls = GameObject.Find("Walls"); List<Transform> wallsParents = new List<Transform>(); List<Vector3> startEndPos = new List<Vector3>(); foreach (Transform child in walls.transform) { wallsParents.Add(child); } for (int i = 0; i < 2; i++) { wallsParents.Remove(wallsParents[Random.Range(0, wallsParents.Count)]); } var childsWall0 = wallsParents[0].GetComponentsInChildren<Transform>().ToList(); var childsWall1 = wallsParents[1].GetComponentsInChildren<Transform>().ToList(); childsWall0.RemoveAt(0); childsWall1.RemoveAt(0); start = childsWall0[Random.Range(0, childsWall0.Count)]; end = childsWall1[Random.Range(0, childsWall1.Count)]; startEndPos.Add(start.position); startEndPos.Add(end.position); start.GetComponent<Renderer>().material.color = Color.red; end.GetComponent<Renderer>().material.color = Color.blue; return startEndPos; } } In GenerateStartEnd i pick two random walls. Then i'm getting the children of each wall the blocks(cubes). I remove the parents. Then i pick random block from each wall childs. I set the start and end. Then in GenerateRandomPath this is where i'm trying to generate the random path between start and end. This is the whole part of the random path: private void GenerateRandomPath() { GridGenerator gridgenerator = GetComponent<GridGenerator>(); List<float> distances = new List<float>(); List<float> rotations = new List<float>(); for (int i = 0; i < gridgenerator.allBlocks.Length; i++) { var distance = Vector3.Distance(start.localPosition, gridgenerator.allBlocks[i].transform.localPosition); if (distance == 1.5f) { var angle = Vector3.Angle(start.localPosition, gridgenerator.allBlocks[i].transform.localPosition); rotations.Add(angle); } } distances.Sort(); } void SmoothLook(Vector3 newDirection) { start.rotation = Quaternion.Lerp(start.rotation, Quaternion.LookRotation(newDirection), Time.deltaTime); } The logic is simple find what directions you can move pick random direction move one waypoint in that direction don't stop continue to the next random waypoint. The next waypoint can be the nearest or even far away i don't mind but once he is reaching to the next waypoint find the directions pick random one and rotate and move to that direction to another rndom waypoint on this direction. And son on until the player will get to the end. And i don't mind if the path will be long. I'm just not sure how to translate it to the script. allBlocks is GameObject[] array containing all the grid blocks(cubes).
d7fb6d6483d8c8fdf87551b8e933ac4414d245ffd3e620a1ee718eee75757af5
['d6316e0bc96f4b6a98f7af73b7a4535c']
If you want a portable C++ solution, you should use unique_path in boost<IP_ADDRESS>filesystem : The unique_path function generates a path name suitable for creating temporary files, including directories. The name is based on a model that uses the percent sign character to specify replacement by a random hexadecimal digit. [Note: The more bits of randomness in the generated path name, the less likelihood of prior existence or being guessed. Each replacement hexadecimal digit in the model adds four bits of randomness. The default model thus provides 64 bits of randomness. This is sufficient for most applications
c11fe199018596886ad3aa964e780f0ada110b18b4d79ff553e081202950b982
['d6316e0bc96f4b6a98f7af73b7a4535c']
You could try mysql++, but you'll encounter the same linker errors I bet. Have you set the include path (C:...\MySQL Server 5.1\include) and the library path (C:...\MySQL Server 5.1\lib\debug) ? In VC2010 to set global settings you have to : VS2010 introduces the user settings file (Microsoft.cpp..users.props) to control global settings including Global search path. These files are located at $(USERPROFILE)\appdata\local\microsoft\msbuild\v4.0 directory. The issue you are seeing is a bug in the UI. To make it possible to change the ordering of these read-only directories, here is the workaround that you can apply: open up the property manager, right click on the .user.props file to bring up the property page open up VC++ Directories -> Include Directories, add new paths after $(IncludePath) Click on the "Edit" dropdown on VC++ Directories -> Include Directories property, the user directories as well as the inherited values will show up in the upper pane you can move the directory orders as you wish and save. http://connect.microsoft.com/VisualStudio/feedback/details/550946/vs-2010-how-to-change-vc-directories-inherited-values-read-only
7fc974b0de7559076e6b92aa57a574eecd019bd5d973b56ae332c6c15ff2349c
['d638fd452a084b36aff278279f9e7a4e']
During my program execution, I have to load a large array of MyStruct // Struct definition struct MyStruct { var someString: String = "" } // Array definition var ar = Array<MyStruct>() The issue is, having all these someString take a large amount of memory and could easily be shaved down because they all have common (large) prefixes. These prefix do vary. So, I would like to have struct MyStruct { var someString: String = "" var someString: pointer to a shared string prefix } My questions are: How do I tell swift not to assign and copy the string, but rather a pointer to the string. How do I obtain the pointer to said strings. Currently, I obtain the prefix using stringByReplacingOccurrencesOfString. Also, For the strings to be retained somewhere, I plan to put all the prefixes in an array. Thanks for your help
2f114ed8a44b63b1d1fbf29b9ea68799e0675127fec0142c6f15fadeb5fe791d
['d638fd452a084b36aff278279f9e7a4e']
I have a dictionary of arrays that contain one kind of objects : database records. Each array is like a table associated to a key (table name) in the dictionary. My issue is: How do I update a table (delete a record, add a record, etc) without making any temporary copy of the table, like I would do with an NSDictionary of NSArrays ? Currently, I do : func addRecord(theRecord: DatabaseRecord, inTable tableName: String) { if var table = self.database[tableName] { table.append(theRecord) self.database[tableName] = table } else { self.database[tableName] = [theRecord]; } } The issue is: a temporary copy of the table is made twice. This is pretty inefficient.
bc8600291cef08945cbffc6f7693171c7b63255b2e8702e435f518720e9dbe59
['d63a0d142ea04e7facc4a61020f54cb2']
Yes, try increasing the parallelism for the stream2 source - it should help: env.addSource(kafkaStream2Consumer).setParallelism(9) At the moment you have a bottleneck of 1 core, which needs to keep up with consuming stream2 data. In order to fully utilise parallelism of Kafka, FlinkKafkaConsumer parallelism should be >= the number of topic partitions it is consuming from.
b429494ba1869582c2c2356270fd3306a4d34dec5063438b558a98a92d67f511
['d63a0d142ea04e7facc4a61020f54cb2']
I need to detect versions of installed Adobe AIR and Flash from a Java application on Windows. One approach could be reading the .exe files' meta data in the "C:\Program Files (x86)\Common Files\Adobe AIR\Versions\1.0" folder, but this is obviously an ugly solution. For Flash version one can try to read the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Macromedia\FlashPlayerPlugin\ /v Version, but I am not sure whether the *Plugin part of the name is a good indicator, because I need the Flash version, that is actually used by AIR, not by browsers. Is there any clean way to get this done?
7bfd168df285163550d355aabdb4949185b8357060d9d5cb026846a34c499cbf
['d644bc2f04994e5eb15fcf594c25c1de']
<PERSON>' phase rule states: $$F=C-P+2$$ where $F$ is number of degrees of freedom, $C$ is number of components, $P$ is number of phases. <PERSON>'s polyhedral formula states: $$V+F-E=2$$ where $V$ is number of vertices, $F$ is number of faces, $E$ is number of edges. It is easy to see that these formulas are similar. Is there a true parallel between them? Otherwise, what is the mathematical meaning of <PERSON>' phase rule?
79475f3ee1811b03171f20db3e8dff3a434bb9aa791e9824621b53858fbe7212
['d644bc2f04994e5eb15fcf594c25c1de']
Hi, I tried with below code but still some values are not retrieving as expected like in excel value is -65533.333 but when I am reading it is coming as -65533.332999999999.For value -<PHONE_NUMBER>.55857, it is coming as -<PHONE_NUMBER>.5585732. cell.setCellType(Cell.CELL_TYPE_STRING); System.out.println(cell.toString());
7419e55cd6f9caf8ecd554dd3f17fef6b845c94d23b783da6b196c59e0cb89b9
['d65cabf4cbb141599bb14d1a76e1a109']
I am using an ANSI USB keyboard on my macbook pro OSX 10.6.8 (Yeah, I know it'd old but it still works great). In system preferences/keyboard/shortcuts/display you notice that F14& F15 are the shortcuts for screen bright or dim. These correspond to the SCROLL LOCK and PAUSE/BREAK keys on my keyboard. They are directly above the home & pageup keys. The volume keys on my ANSI keyboard work with the macbook pro. Not sure what to do for launchpad or mission control.
4923cba1b36c159834c244a1393923dc2332b19c4bad834989a2963226e294e5
['d65cabf4cbb141599bb14d1a76e1a109']
I have a surface pro 2 and Win 10 64 bit. Had to go to "Turn Windows Features on or Off" in Control panel and disbale/uncheck both Hyper-V as well as Windows Hypervisor (this feature is only in 64 bit). Restart and then try installing IntelHaxm again. You can find that where you SDK is installed. sdklocation\extras\intel\Hardware_Accelerated_Execution_Manager. You can check you sdk location in Android Studio System Settings > Android SDK.
eeff36831018c7db444079901b3f65a8265b14d2b7b73d3afd1e14e5eadeab1e
['d67d07d2a25f4cffab9d23f9ed0ec3ce']
I need to get the user location at regular intervals. e.g. every 5 minutes. The application need to be able to do that while in background. Giving the iOS restrictions that freezes the app conde while inactive I cannot have a thread/task running every 5 minutes to perform this task. Using the Standard Location Service does not allow me to define an interval to receive the user location. Having it running all the time with the UIBackgroundModes=location will consume too much battery and be running at unnecessary times. I have also considered using Significant-Change Location Service which has the ability to wake-up my app when a new location is available, but if the user is stationary no events are generated. Anyone has any idea how I can accomplish this? Perhaps another way to have a service waking-up my app every 5 minutes?
1f52a9bab828f7f021f3abd9bbcefdf91c7d9f240bea1e7604920672afa99286
['d67d07d2a25f4cffab9d23f9ed0ec3ce']
I'm developing an iOS app which uses a UIWebView and the WebApp running inside uses WebDB to store it's local data. I would like to 'reset' the state of the my which would include: Removing any cached items (images, html and etc) - This is done and is working fine :-) Remove any WebDB created by the Webapp. Anyone has any ideias on how to do item n. 2?
df76d0a9922e1430f670ca4304aeb23025e11a9f424bcdd3e18feba250699bdb
['d697f2f582024ff08cf925d33a89b3b6']
function wordBreak(dict, str){ if (!str){ return true; } for (const word of dict){ if (str.startsWith(word)){ return wordBreak(dict, str.substring(word.length, str.length)) } } return false; } You could also probably optimize the loop over dict by pre-sorting the array and using binary search, but hopefully this gets the point across.
fed70f65ab2c865d01d3019a34eefb787136d43fb76c82813a489f9dd014fbdc
['d697f2f582024ff08cf925d33a89b3b6']
Your immediate problem is that if budgets[0] is not an Investment, you'll never enter into the while loop. But since you're new to Python, there's quite a lot that would improve your code. You're not using additionalInvesting. This is just a bug. There's no reason to explicitly cast your variables to floats. Python will do this automatically. Idiomatic Python uses snake_case for variables and function names. There is (usually) no need to include getters and setters in Python. Python doesn't have privately scoped variables, so you should do budget[counter].apr budget[counter].name budget[counter].amount I assume that budgets is a list, so it's an iterable type. Rather than worrying about bookkeeping with counter, you can simply do: for budget in budgets: do_something() Honestly, if there's no reason for budgets to be a list, it would be better if it were a dictionary indexed by name instead. That way you could use the "in" keyword to avoid iterating through the list at all This is a personal preference, but a function called calculate_investments should ideally do nothing besides calculate the investments. You should wrap the input logic in a main tag.
78b626c40a718012696225f598cda685b92013b996a25e3f2694f9f779fcec1b
['d6aef21d43fb4e42b5b29aea9a63b513']
I have just started to use Camel in one of my projects. I am trying to configure Camel with Spring, but having issues doing that. I don't want to use xml configuration but rather go with Spring based Annotations for configuring Routes and Processors. My App is a stand alone Spring Application, which will be run as Jar. To keep the app running, I've a empty scheduled method which runs every x min. Below are the dependencies in my build.gralde // Spring // compile('org.springframework:spring-core:5.0.0.RC2') compile('org.springframework:spring-context:5.0.0.RC2') compile('org.springframework:spring-beans:5.0.0.RC2') compile('org.springframework:spring-context-support:5.0.0.RC2') // Apache // // Camel // compile('org.apache.camel:camel-core:2.19.1') compile('org.apache.camel:camel-spring:2.19.1') snapshot of beans.xml <context:annotation-config/> <tx:annotation-driven/> <context:component-scan base-package="my.package" /> <camelContext id="aggregatorCamelContext" autoStartup="true" xmlns="http://camel.apache.org/schema/spring"> <package> my.package.camel </package> </camelContext> Sample RouteBuilder @Component public class SampleRoute extends RouteBuilder { @Autowired MyClass myObject; @Override public void configure() throws Exception { from("file:filelist") .process(myObject) .to("file:processedList"); } } To keep the app alive ( I know bit hacky, but suffices for now ) @Component @EnableScheduling public class KeepitAlive { @Scheduled(fixedRate = 1000l) public void run(){ System.out.println("KeepitAlive.run "+ Thread.currentThread().getName() ); } } Main Class. I have tried both the methods, Initializing Spring context as well as Camel Main, but to no luck public class MyApplication { public static void main(String[] args) throws Exception { /*AbstractXmlApplicationContext context = new ClassPathXmlApplicationContext("path/to/beans.xml");*/ Main main = new Main(); main.setApplicationContextUri("path/to/beans.xml"); main.start(); } } If I put my Route within camelContext declaration itself, it works absolutely fine, <route> <from uri="file:filelist"/> <to uri="file:processedlist"/> </route> I've also looked into Camel Spring Integration documentation, but it also contains xml based configuration. Could anybody please guide me in right direction.
9143916260e619d352ab065bd171e5798db4fdec0537bbf4b032a3362a05a864
['d6aef21d43fb4e42b5b29aea9a63b513']
I was revisiting Operating Systems CPU job scheduling and suddenly a question popped in my mind, How the hell the OS knows the execution time of process before its execution, I mean in the scheduling algorithms like SJF(shortest job first), how the execution time of process is calculated apriori ?
78cfdd9f5e1a54c66c479426eda97bb4f3607c2857579050c10473d57b6bb03e
['d6cf1353c2a54bf4a8b1d0939cd72b10']
Well, I am not extremely experienced with CSS, but you want to balance readability and compression. The way you used to do it was heavy on compression, and the way you're saying you were suggested to do it seems heavy on readability. But I've tried that latter one, and boy, is that a lot of work. And it barely adds readability, as most things in CSS don't only show up in one place in any given site structure-- they show up in multiple places, making it impossible for that structure you were suggested to actually become readable. If you ask me, nothing beats a good comment. //* If you're trying to be able to easily locate sections of CSS, titles that draw a lot of attention to themselves even if you're skimming very quickly are the way to go*// Sure beats all the work of tabbing your CSS. And like I said earlier, the reusable nature of CSS declarations makes tabbing impossible to easily follow anyway.
e2beabb9f8124f9a8ade4bfabf61f97fec5bb936ccafdf1d52a9f5f224b927db
['d6cf1353c2a54bf4a8b1d0939cd72b10']
I have a navigation menu on my site, which is an unordered list. Items are naturally displayed left-to-right, and in the proper order. It looks like this: |[--1--][-2-][----3----][--4--].......| |[---5---][-6-][-----7-----][-8-].....| |[------9------][----10----]..........| Obviously, if I float all the list items ("li") to the right, they will show up in the position that I want them to shop up in-- but in the reversed order: |.......[--4--][----3----][-2-][--1--]| |.....[-8-][-----7-----][-6-][---5---]| |..........[----10----][------9------]| I like the positioning, but I don't want the reversed order. I need it to look like this: |.......[--1--][-2-][----3----][--4--]| |.....[---5---][-6-][-----7-----][-8-]| |..........[------9------][----10----]| The limitation that I present is that I cannot rewrite the menu HTML in the reverse order. I want to do this in CSS alone. Supposedly, this can be done by floating the unordered list ("ul") to the right, and floating the list items (li), to the left. However, I have been unsuccessful in doing this, and since my CSS is so minimal, I am not sure what I could be missing. Is the desired styling possible without changing the HTML?
0aff77893546a86cfede76eee958df5deeb77798468f8f44bbddff0d92198036
['d6ecf63581ba457f885f1874e79d1fd0']
I've been looking into more strict component based designs in Unity3D. I've been using a space invaders clone as a practice project. On my player object it has components: PlayerInput, HorizontalVelocity as well as the usual suspects like renderers. I am using a mediator system for communication, so when an arrow key is pressed, the PlayerInput class creates an event which is then broadcast via the mediator to the velocity. Now I want to add a HorizontalBounds class that stops it moving too far left or right. But there is a conflict: Velocity and Horizontal Bounds are each trying to move the transform in different ways concurrently. I can think of a few options of resolving this conflict: The bounds component constantly checks the transform and if it is out of bounds it pushes it back in bounds. This is horrible as we have the velocity component moving it one way, and the bounds component moving it back, every single frame. Make a VelocityWithBounds component derived from Velocity (or implements a velocity interface if we are trying to avoid inheritance?). The issue here is you are putting two components together. If you want to remove the bounds, you can't just get rid of that part (you could set it to bounds off but it would still be there). You would have to destroy everything and replaces it with a new velocity component. I'm not sure if this is going to cause any significant issues, but it seems inelegant. Give the bounds component some way of overriding the velocity components functionality during run time. This seems like the most elegant solution but probably the hardest to implement. You would have to decouple them in such a way that velocity doesn't know its being overridden. This is just one example problem. Are there any best practices for this kind of problem or should it be solved case by case?
205a7cc3497678cf5e66cb9e2bd4f457bb148185bbc21db911ceb0276da2d327
['d6ecf63581ba457f885f1874e79d1fd0']
While not standard I have found this practice very useful. Imagine a game where a warrior has HP, attack and defense. You could write a stat component that takes an enum and a value. Another way would be to have a component that holds other entities and make each stat an entity itself with a value and type component. I tried both of these and I didn't like the early results. (The latter worked fine but it was really convoluted, but it does strictly adhere to ECS design) In the end I made each one a StatComponent which inherited from Component. This meant that I could perform operations common to all stats which was very convenient. The trick is to make each bit of OOP you stick in a bubble. As long as it is self contained I don't see any major issues.
c132335d2fc33294d1117770548d3462d180ff1c4128d3b498f8f963dc5e1d29
['d6fd6563dee14e6089ba6feb3eed7c87']
I understand the relationship of Base, Collector and Emiter. Understand how to solve BJT problems. Sorry if im my language does not reflect that. I understand saturation mode, cutoff, linear etc. Understand basic concepts and know how to do mesh analysis, node analysis, etc. Im just very lost with this project. I managed to build a circuit that in my opinion complies with the design. i will upload some images.
a08c2be0e5d9c6c544bf5d0b44718be3f737c9cbbd9d683f7b7d5dc8cb4ccfbf
['d6fd6563dee14e6089ba6feb3eed7c87']
I think i will just stick to the 9 v battery. I think my circuit outputs 2.5 volts on the Rc resistor... thats what i mean by 2.5 of amplitude, that in my opinion results in a 5 V peak to peak. But i can be wrong, if you can share with me a design that complies with the initial requirements... maaan you would be my hero.
d2dc2e7a29e279dcc860ade24c3dc5e32751cdf21a71a278e3b345b8b5ae6b57
['d7040edfc8084137a51c6c4fe0855b58']
Can someone tell what's wrong here please? It send me this error: Type 'CityWeatherInfo' does not conform to protocol 'Encodable' struct CityWeatherInfo: Codable { var name: String var main: Main var weathers: [Weather] private enum CodingKeys: String, CodingKey { case weathers = "weather" case main = "main" case name } init(from decoder: Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) self.name = try container.decode(String.self, forKey: .name) let mainContainer = try container.nestedContainer(keyedBy: CodingKeys.self, forKey: .main) let weatherContainer = try container.nestedContainer(keyedBy: CodingKeys.self, forKey: .weathers) } } struct Weather: Decodable { var main: String var description: String private enum WeatherKeys: String, CodingKey { case main = "main" case description = "description" } } struct Main: Decodable { var temp: Double var feels_like: Double var temp_min: Double var temp_max: Double private enum MainKeys: String, CodingKey { case temp = "temp" case feels_like = "feels_like" case temp_min = "temp_min" case temo_max = "temp_max" } } <PERSON> is this: {"coord":{"lon":-0.13,"lat":51.51},"weather":[{"id":804,"main":"Clouds","description":"overcast clouds","icon":"04n"}],"base":"stations","main":{"temp":287.45,"feels_like":286.61,"temp_min":284.82,"temp_max":289.15,"pressure":1012,"humidity":72},"visibility":10000,"wind":{"speed":1,"deg":0},"clouds":{"all":100},"dt":<PHONE_NUMBER>,"sys":{"type":1,"id":1414,"country":"GB","sunrise":<PHONE_NUMBER>,"sunset":<PHONE_NUMBER>},"timezone":3600,"id":2643743,"name":"London","cod":200}
c68fc982e89b63e1a5ce549cb6cd326be015ff962bacba62695a6d381f98b6b7
['d7040edfc8084137a51c6c4fe0855b58']
Can someone tell what could I do? I have a class named RequestManager where i have the URLSession and inside of it, a constant where I store the Data from the server. import Foundation class RequestManager { func fetchWeather(cityName: String,completionHandler: @escaping ([String]) -> Void){ let weatherURL = "https://api.openweathermap.org/data/2.5/weather?q=\(cityName)&appid=55dbb1b10e9f55181ad910227f1460ae&units=metric" let objectURL = URL(string: weatherURL) let task = URLSession.shared.dataTask(with: objectURL!, completionHandler: {(data,reponse,error)in if error != nil{ print(error!) } else{ do{ let json = try JSONDecoder().decode(CityWeatherInfo.self, from: data!) print(json) let saveData: WeatherModel = WeatherModel(name: json.name, temp: json.main.temp, feelsLike: json.main.feelsLike, tempMin: json.main.tempMin, tempMax: json.main.tempMax, main: json.weathers[0].main, description: json.weathers[0].main) print(saveData) } catch{ print("error") } } }) task.resume() } } I run the app and get this in console when I ask for the server data: CityWeatherInfo(name: "Paris", main: Evaluación_Autofin_México.Main(temp: 20.3, feelsLike: 18.41, tempMin: 18.0, tempMax: 21.67), weathers: [Evaluación_Autofin_México.Weather(main: "Clouds", description: "broken clouds")]) WeatherModel(name: "Paris", temp: 20.3, feelsLike: 18.41, tempMin: 18.0, tempMax: 21.67, main: "Clouds", description: "Clouds") I need to paste this info into a "WeatherViewDetailController" labels, but I can't enter to the "let saveData" from RequestManager. class WeatherDetailViewController: UIViewController { var weatherPresenter: WeatherDetailPresenter? public var cityName: String? let request = RequestManager() @IBOutlet weak var closeButton: UIButton! @IBOutlet weak var cityImage: UIImageView! @IBOutlet weak var nameLabel: UILabel! @IBOutlet weak var mainLabel: UILabel! @IBOutlet weak var descriptionLabel: UILabel! @IBOutlet weak var tempLabel: UILabel! @IBOutlet weak var feelsLikeLabel: UILabel! @IBOutlet weak var tempMinLabel: UILabel! @IBOutlet weak var tempMaxLabel: UILabel! override func viewDidLoad() { super.viewDidLoad() weatherPresenter = WeatherDetailPresenter(view: self) weatherPresenter?.retriveWeatherByCity(cityName: self.cityName ?? "") self.view.backgroundColor = UIColor(red: 56/255.0, green: 110/255.0, blue: 185/255.0, alpha: 1.0) self.closeButton.tintColor = UIColor(red: 0/255.0, green: 20/255.0, blue: 20/255.0, alpha: 1) } @IBAction func closeAction(_ sender: Any) { self.dismiss(animated: true, completion: nil) } } extension WeatherDetailViewController: WeatherDetailView { func showWeatherSuccessful() { print("Success") } func showWeatherFailure() { print("Failure") } }
5d261efdb6c67f3b0b8942632c701831514ea83eeb4d39840504d30755b9ee21
['d71236abe15245f7b112124befc6b0ab']
I've looked into so many CSS shape resources that it's ridiculous, but I can't seem to find my answer. I'm trying to create a div with this shape so that I can put a line of text inside of it. Is this even possible? Or do I go the other route and use a background image instead?
4b9115e59225aab9dca1d6ad078bad8c73626784303ea402f96893964ce706ab
['d71236abe15245f7b112124befc6b0ab']
I have looked at this so long that I'm confusing myself. I seem to be stuck and missing something. My code is basically supposed to have the default div background (gamebg), and when you click on one of the buttons, the background of the div they are in changes. <style> #gamebg { background-color: #00b5d3; background-image: url('background_button_1.png'); background-position: center; background-size: cover; background-repeat: no-repeat; width: 100%; max-width: 950px; height: 800px; box-sizing: border-box; padding: 20px; } .gamebg1 { background-color: #00b5d3; background-image: url('background_button_1.png'); background-position: center; background-size: cover; background-repeat: no-repeat; width: 100%; max-width: 950px; height: 800px; box-sizing: border-box; padding: 20px; } .gamebg2 { background-color: #00b5d3; background-image: url('background_button_2.png'); background-position: center; background-size: cover; background-repeat: no-repeat; width: 100%; max-width: 950px; height: 800px; box-sizing: border-box; padding: 20px; } </style> <div id="gamebg"> <a href="#none" onclick="document.getElementById('gamebg').className ='gamebg1'"><img src="background_button_1.png" class="panel-button"></a> <a href="#none" onclick="document.getElementById('gamebg').className ='gamebg2'"><img src="background_button_2.png" class="panel-button"></a> </div> Any suggestions for me?
63f9174730e466363d9006abe47f711ecde2b839dd1ddcdf63bb50c1c221c523
['d71d12b1f786495f9cae56e8516ce535']
The problem is solved. The problem was not with the cin function but with the way i gave the program the input. Pasting the enormous ammount of input on to clipboard and then put it as an argument in the terminal when running the program seams to be the problem. When running the program as ./program < input.in where 'input.in' is the file which holds all the input in the format as has been describe above, then the programs runs fine and does not freeze anymore.
97c9f2ac63936626b6e0d619db1dea567240d79334c60ae1b6b25e4c77c9bdfd
['d71d12b1f786495f9cae56e8516ce535']
It is allowed. In my opinion and i say without a reference that in general other programmers do not find your 'for' loop very readable. Sometimes in a for loop you want to do other things then just for (int i = 0; i < 10; ++i){"do something"}For example increment 'i' in every loop with two. Reading code should be like reading a text. If you are reading a book you do not want it to be unnecessary difficult. Your other question was about the safety of the statement. The biggest problem with the code is that you might get confused about what you are doing exactly. Bugs are caused by human errors (computers are deterministic and are executing machine code which ultimately has been written by a human) and the question about safety mainly depends on how you define it. To give you some tips. When i just started programming C++ i looked a lot on CPP reference. I will give you a link where you can read about the syntax and what is allowed/possible. On this website there are quite a lot of examples on all kinds of statements. They will in general not put 5 or 6 operations within in a single line. If there are more variables that you want to change then you might want to do that in the scope of the for loop so it will be more readable instead of inside the for loop. http://en.cppreference.com/w/cpp/language/for
e3ee240f971fd1433465bb4d89d801b9eaa7b16d1a0920ce78cc0ae6dd92ceec
['d71e6fac0be74cdca9f0053d623a0e0e']
I'm testing my REST API on Mule ESB, and when the API, implemented using Python Flask, returns a 200 http status Mule correctly exhibits the message returned (a JSON, as it is expecting). But when I return any other status, I can't seem to exhibit the message returned, which is a string. I'm trying to configure the exception thrown to show the original message returned by the API. How can I access it? I'm using Anypoint Studio. Thanks in advance.
36fae3e0e15e0bd1a01274fea54939bd754cce0d1993fd765f3056dda7a9730c
['d71e6fac0be74cdca9f0053d623a0e0e']
I'm trying to read a local file into an ArrayBuffer using the FileReader API, like this let reader = new FileReader(); reader.onload = function(e) { let arrayBuffer = new Uint8Array(reader.result); console.log(arrayBuffer); } reader.readAsArrayBuffer(new File([], 'data.txt')); But I'm getting an empty arrayBuffer How can I read this local file as an ArrayBuffer in my browser? Thank you.
4baa11b0f6ba979e3039f283729ba5ba03acb47dd47b42e6c1324f96976db930
['d730a0fa67944e74be8f24cf60b045b9']
I solved my programming issue again on my own. The reason why a MessageBox showed those strange messages when an image was opened via openfiledialog was the code line MessageBox<IP_ADDRESS>Show(sr->ReadToEnd());. Probably a part of the Image-Header was displayed in the Box. I don't need it, so the solution is to delete or to comment out this line of code.
b8a1ed36732991f54e2e40c587bb625eef80baa6c21151bf6429be398e9e6695
['d730a0fa67944e74be8f24cf60b045b9']
In three ways I tried to display an image within a Windows Forms Picturebox using Visual C++ 2010 Express. The files path I fetch with an openFileDialog. Here are the three attempts: 1. pictureBox1->ImageLocation = openFileDialog1->FileName; 2. Bitmap^ image1; image1 = gcnew Bitmap(openFileDialog1->FileName, true); pictureBox1->Image = image1; 3. pictureBox1->Image = static_cast<Bitmap ^>(Image<IP_ADDRESS>FromFile(openFileDialog1->FileName)); Before the image is displayed finally an error- or info-message pops up. The message window has no name an shows BM6 (opening a Bimap-Image), nothing (opening a JPEG-Image) or ?PNG[] (opening a PNG-Image). Question: How I can avoid those messages when displaying an image within a picturebox?
408628c32c5bf0450331b4b8321fbf0d3678e9026fea67f91ccbafa47f5e4eb2
['d7323e73362c4f1f9fd040b1c0284d2b']
i want to upload files to google drive using nodeJS as backend. I have used google drive API v3. I get the file id and type in response after uploading a file. drive.files.create({ resource: { name: 'Test', mimeType: 'image/jpeg' }, media: { mimeType: 'image/jpeg', body: fileData } }, function(err, result){ if(err) res.send(err); else res.send(result); }); but what i want is when i upload a file i want it as publicly accessible. i want the shareable link of that file in response. Is there any way to do so ? i have implemented the way given here : https://developers.google.com/drive/v3/web/manage-sharing which works fine with s.showSettingsDialog(). But i want the shareable link at the time i upload the file.
f76aaffc8f41032a788766b2965627419f9ec93d9362f53750aa7885561e4ee9
['d7323e73362c4f1f9fd040b1c0284d2b']
I am using facebook SDK for social login, it works well most of the time, but sometimes when a user tries to login with Facebook they accidentally logs into someone else's account. I am using facebookId as unique Id in my DB, and if an existing user logs in again, through this facebookId i validate his/her account. /* Find user by Fb id */ accountModel.findOne({ facebookId: req.body.fbId }, function (err,resultUserByFb) { if(err){ } else { sendLoginResponse() } }); If the facebookId is not present in the DB, we register that user into the system.
746764236ad53b95add0cb03e0708f4c7feab1f7a1228ae4a970b20ef5ec7cb8
['d73be13dc1d04ea4a9d249a310ef4f5c']
It's not an operator. It indicates a double, not a float. 42. means 42.0, and .42 means 0.42. A . alone is a compiler error (rather than 0.0). If you add a trailing f, it will become a float instead of double, e.g. 1.f, .1f, 1.0f.
fa2b4384fb3a2ebb25359f8e6b48de691cecc6e5fad282307bbf048f4a1892dd
['d73be13dc1d04ea4a9d249a310ef4f5c']
If your compiler supports it, __VA_OPT__ from C++20 makes this more or less simple: #define LOG(...) LOG1(__VA_ARGS__,)(__VA_ARGS__) #define LOG1(x, ...) LOG2##__VA_OPT__(a) #define LOG2(x) std<IP_ADDRESS>cout << "n = 1: " STR(x) "\n"; #define LOG2a(x, ...) std<IP_ADDRESS>cout << "n > 1: " STR(x, __VA_ARGS__) "\n"; #define STR(...) STR_(__VA_ARGS__) #define STR_(...) #__VA_ARGS__ int main() { LOG(1) // Prints: `n = 1: 1` LOG(1, 2) // Prints: `n > 1: 1, 2,` LOG(1, 2, 3) // Prints: `n > 1: 1, 2, 3,` }
5a3a02876e5aeeab3f580b89bff87a1272f62762038a2ea64ea5f044c087c117
['d74780d423ec4784a4ce2d447b6ed43c']
OK I got it, sorry. Please let me add an example. If the given basis is a single vector $u\in \mathbb{R}^n$ and $V\in \mathbb{R}^{n \times n-k}$, then, $P = uu^T$ and the orthogonal subspace is defined by the columns of $\tilde{V} = [I-uu^T]V$. Am I right?
917289b59a7422a7faa43e18bc5bf4bf69afeb6b43902668c883e0f793e2c7be
['d74780d423ec4784a4ce2d447b6ed43c']
Hello <PERSON>, given the definition $\mathbf{J} = \mathbf{MC}^{-1}$ and given the fact that $\mathbf{M}$ and $\mathbf{C}^{-1}$ are invertible, why we could not define the $\mathbf{J}^{-1}$ which is actually $\big(\mathbf{MC}^{-1}\big)^{-1}$. $\mathbf{C}^{-1}$ is invertible because $\mathbf{C}\mathbf{C}^{-1} = \mathbf{I}$ and $\mathbf{C}^{-1}\mathbf{C} = \mathbf{I}$. Thanks <PERSON> for the comments!
c174f4707dafc6b67502624eacf317fab4cd88c858a9b25f2839a2fc86a35a5c
['d7625863afec40dfb18a0bed8e1eb462']
I'm working with lxml.etree and I'm trying to allow users to search a docbook for text. When a user provides the search text, I use the exslt match function to find the text within the docbook. The match works just fine if the text shows up within the element.text but not if the text is in element.tail. Here's an example: >>> # XML as lxml.etree element >>> root = lxml.etree.fromstring(''' ... <root> ... <foo>Sample text ... <bar>and more sample text</bar> and important text. ... </foo> ... </root> ... ''') >>> >>> # User provides search text >>> search_term = 'important' >>> >>> # Find nodes with matching text >>> matches = root.xpath('//*[re:match(text(), $search, "i")]', search=search_term, namespaces={'re':'http://exslt.org/regular-expressions'}) >>> print(matches) [] >>> >>> # But I know it's there... >>> bar = root.xpath('//bar')[0] >>> print(bar.tail) and important text. I'm confused because the text() function by itself returns all the text – including the tail: >>> # text() results >>> text = root.xpath('//child1/text()') >>> print(text) ['Sample text',' and important text'] How come the tail isn't being included when I use the match function?
148b4a813cacb34a4fd551596f36033a283b29278ae45d7b764b1eb5f134c47d
['d7625863afec40dfb18a0bed8e1eb462']
The best option is to use Django's get_random_secret_key method. # Return a 50 character random string usable as a SECRET_KEY setting value. from django.core.management.utils import get_random_secret_key SECRET_KEY = get_random_secret_key() Neither of those suggestions make the SECRET_KEY any more secure. You're still just generating a random string of characters. If you're really worried about security, you can increase the length of the random string generated. get_random_secret_key is really just an alias for get_random_string that alters the character set and length of the returned string: # generate an even longer random string usable as a SECRET_KEY setting from django.utils.crypto import get_random_string chars = 'abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*(-_=+)' SECRET_KEY = get_random_string(100, chars)
a72dd3c9ea80d8d2347eaadbc7b8df536c4069b95ff4ae38a365798310cce6b9
['d765c4fa0e7e4516abe433bb1bf20184']
This may or may not have already been said, and as of right now, there are 39 answers. some very long-winded. I chose to be lazy and not read through them all. One way to prevent duplicate answers from appearing right after one another is when someone goes to post, let them know if there have been any new posts since they started writing theirs. This would prevent something that's happened to me where someone was quicker to the draw in saying the exact same thing i just did.
0398af0fe6e4b98d9754eda66b99ff8cef2f1ec95cf354f0e61c070069816110
['d765c4fa0e7e4516abe433bb1bf20184']
Necesito que esta función me valide si una cita ya existe para una trabajadora y a determinada hora: public function addCita($Next,$Trabajadora,$Cliente,$Concat,$Suma,$Observaciones,$Estado) { $sql= "SELECT * from cita WHERE Id_Trabajadora= :Trabajadora and Fecha_Hora= :Concat and Id_Estado != 3"; $query = $this->db->prepare($sql); $parameters = array(':Trabajadora' => $Trabajadora,':Concat' => $Concat, ':Estado' => $Estado); //echo '[ PDO DEBUG ]: ' . Helper<IP_ADDRESS>debugPDO($sql, $parameters); exit(); $query->execute($parameters); $resultado = $query->fetchAll(); var_dump($resultado) if ($resultado) { return false; die(); }else{ $sql = "INSERT INTO `cita`(`Id_Cita`, `Id_Trabajadora`, `Id_Cliente`, `Fecha_Hora`, `Precio_Total`, `Observaciones`, `Id_Estado`) VALUES (:Next, :Trabajadora, :Cliente, :Concat, :Suma, :Observaciones, :Estado)"; $query = $this->db->prepare($sql); $parameters = array(':Next' => $Next, ':Trabajadora' => $Trabajadora, ':Cliente' => $Cliente, ':Concat' => $Concat, ':Suma' => $Suma, ':Observaciones' => $Observaciones, ':Estado' => $Estado); //echo '[ PDO DEBUG ]: ' . Helper<IP_ADDRESS>debugPDO($sql, $parameters); exit(); $query->execute($parameters); } } El problema que tengo es que se salta la validación y siempre guarda, cualquier ayuda con este problema se los agradecería mucho.
1961923072e31f14304b554530ee910ea3aad1df359c59f12119120e1bf0b2aa
['d7995e0b763b4e09b8542bc4761eace1']
I have routes for my project and I'm using Route<IP_ADDRESS>when('*', 'auth') to protect my routes by implement auth filter on every Route like given below: // All the following routes must be filtered by the 'auth' filter. Route<IP_ADDRESS>when('*', 'auth'); Route<IP_ADDRESS>resource('route_1', 'Controller_1); Route<IP_ADDRESS>controller('route_2', 'Controller_2'); Route<IP_ADDRESS>get('route_3', 'Controller_3@method_1'); It's clear that the user can not access the routes as a guest or in other words without log into. Now I'v to use a couple of routes which could be accessed without login. I'm using the following code but it's not working and also implement auth filter on route_0: // Following two routes must not be filtered by the 'auth' filter. Route<IP_ADDRESS>get('route_0', 'Controller_0@getMethod'); Route<IP_ADDRESS>post('route_0', 'Controller_0@postMethod'); // All the following routes must be filtered by the 'auth' filter. Route<IP_ADDRESS>when('*', 'auth'); Route<IP_ADDRESS>resource('route_1', 'Controller_1); Route<IP_ADDRESS>controller('route_2', 'Controller_2'); Route<IP_ADDRESS>get('route_3', 'Controller_3@method_1'); How can I remove auth filter from route_0? I also don't want to use auth filter separately on each route or controller. Any solution please?
8583aabe142a4d7af312c456276aac906e47d30bbe6803f44433b6c88d117b64
['d7995e0b763b4e09b8542bc4761eace1']
Personally I found Mass-assignment very much useful as it not only help you to protect your sensitive fields to get filled without check, like password and ids, but also it help you to assign values to non-sensitive fields quickly. How Mass-Assign Protects Sensitive Fields: It would not fill/assign values to fields which are not mentioned by you to mass-assign in the protected $fillable property. For example you have a User model with fields id, first_name, last_name, email, password. You can assign values to first_name, last_name, email as given below: $user = new User; $user->first_name = Input<IP_ADDRESS>get('first_name'); $user->last_name = Input<IP_ADDRESS>get('last_name'); $user->email = Input<IP_ADDRESS>get('email'); $user->save(); The above method is acceptable but what if you have more fields? This is where mass-assignment comes to rescue. You can go with the following way: $user = new User; $user->fill(Input<IP_ADDRESS>all()); $user->save(); But before using the mass-assigning you should make sure that the fields, you want to mass assign are saved in a protected $fillable property of your model as given below other wise you'll get mass assign exception: protected $fillable = ['first_name', 'last_name', 'email']; Note: It would be dangerous to include sensitive fields like password in your protected $fillable property. Better is you should add your sensitive fields in the protected $guarded property as given below: protected $guarded = ['id', 'password'];