date
stringlengths
10
10
nb_tokens
int64
60
629k
text_size
int64
234
1.02M
content
stringlengths
234
1.02M
2018/03/04
562
1,369
<issue_start>username_0: text file contains name of file is `clean.txt` and contents are ``` 20170524201630.600|20170524201632.760|CC1|Mir wurde ganz schwer ums Herz. 20170524201633.280|20170524201634.600|CC1|Ich hoffte und betete, ``` i want to remove time stamps and output should be ``` Mir wurde ganz ...
2018/03/04
485
1,876
<issue_start>username_0: I'm trying to create a functional interface that can throw an custom exception, what I've come up with is. ``` public class MyException extends Exception { public MyException(String message) { super(message); } } @FunctionalInterface public interface ThrowingFunction { R appl...
2018/03/04
484
1,837
<issue_start>username_0: I'm trying to write a JavaScript browser application, and it needs to run in IE 11. I'd like to use the Promises feature of the AWS SDK, but IE does not natively support promises. It looks like Bluebird will do this, but I'm not sure how to get AWS to use it in a browser. The recommended appro...
2018/03/04
1,146
3,932
<issue_start>username_0: I've got a model that looks approximately like that (in JSON): ``` {"gender": "female", "name": [ {"family": "Smith", "given": ["Samantha"], "middle": ["Lee"]]}} ``` There are about 6M records with such a structure. I need to provide a full-text search across all the components o...
2018/03/04
3,417
10,451
<issue_start>username_0: I need to convert a field that has ISO 8601 duration in a `varchar` field to a decimal value representing that duration in hours. How would I do a `SELECT` using the following data so results come back with the row values of 8.0 (`PT8H0M`), 7.5 (`PT7H30M`) and 1.0 (`PT1H0M`) for the duration f...
2018/03/04
277
951
<issue_start>username_0: I'm trying to change the default text display in ActiveAdmin from the id to different, multiple attributes of an associated model object. (e.g. first name, last name). How do I do this? ``` index do selectable_column column :artist end ```<issue_comment>username_1: One more Simple Sol...
2018/03/04
948
3,560
<issue_start>username_0: I'd like to generate a WKWebView with a specific size programmatically. This code is what I got so far: ``` override func viewWillAppear(_ animated: Bool) { let webview = WKWebView() webview.frame = CGRect(width: UIScreen.main.bounds.width, height: 150) // not working webview.loa...
2018/03/04
1,713
6,213
<issue_start>username_0: now i want create a dumbell shape in javafx i know how to create it and control it in but the problem that i need to treat the shape as multiple three objects not just one object i am newbie in java and oop i just want to create dumbell shape that extends extends javafx node thanks in advance ...
2018/03/04
476
1,767
<issue_start>username_0: I am following the [material.angular.io](https://material.angular.io) documentation. While building a side navbar i am getting the below error "`'mat-nav-list' is not a known element:`" I have imported the following ``` import { MatSidenavModule } from '@angular/material/sidenav'; ``` ...
2018/03/04
661
2,340
<issue_start>username_0: I'm using [Neo4J Javascript Driver](https://github.com/neo4j/neo4j-javascript-driver) to query database from my Node.Js app. Suppose I use the following construct to send several queries to Neo4J (looping through them). When do I need to close the `session` and when do I need to close the `...
2018/03/04
3,876
8,217
<issue_start>username_0: I'm parsing a file that has chronologically timestamped data for multiple time series that I would like to parse in python and then use matplotlib to create a single line plot with independent lines for each set of time series data. The data I'm parsing looks something like this: ``` time labe...
2018/03/04
914
3,884
<issue_start>username_0: I have an SBT project and a CD pipeline and what I want is to execute the following sequence of steps: 1. Checkout my project from the git repo 2. Tag the commit 3. Run the tests 4. Package my app Now at this point I don't want to release anything yet as I will promote the binaries to anothe...
2018/03/04
650
2,888
<issue_start>username_0: I have a page that inherits an `activeTab` routing param from the URL path. So on my page, I can navigate to `/home/` and load in the home tab, or at `/somethingElse` I can load in a different tab within my page template's tab viewport. To update the tab, I'm using: ``` updateTab(tab) { thi...
2018/03/04
424
2,053
<issue_start>username_0: How does java know in which line of the compiled code the exception was thrown? Does each bytecode in class file has information about line of source file ?<issue_comment>username_1: This is not the expected behaviour. Components that do not change should not re-execute the mounted hook. I wou...
2018/03/04
466
2,188
<issue_start>username_0: I am trying to get my videos to play on different parts when the mouse hovers over them but I can't seem to get it working. I already added the script and have tested the page on different browsers. ``` Documento sin título document.getElementById('video1').currentTime=5; VIDEOS ```<iss...
2018/03/04
1,408
5,398
<issue_start>username_0: What does `BuildContext` do, and what information do we get out of it? <https://docs.flutter.dev/flutter/widgets/BuildContext-class.html> is just not clear. <https://flutter.dev/widgets-intro/#basic-widgets> on the 9th instance of the term `BuildContext` there is an example, but it's not clea...
2018/03/04
1,537
6,175
<issue_start>username_0: I have a class in my Android app that implements an Inteface. This is the call. `public class SearchFragment extends Fragment implements HttpAsyncTaskInterface` I have a HttpAsyncTask where I have to set a class that implements this Interface. My problem is that I'm creating de HttpAsynkTask...
2018/03/04
1,791
5,907
<issue_start>username_0: I want to configure 2nd level hibernate cache at Spring Boot microservice. And I don't want to use xml at all. Next is my example. UserEntity.java ``` @Entity @Table(name = "users") @Cacheable @Cache(usage = CacheConcurrencyStrategy.READ_WRITE, region = "users") public class UserEntity { ...
2018/03/04
1,494
4,404
<issue_start>username_0: I want to convert a PDF to a TIFF using PDFBox 2.x and the PDFRenderer Class. But it runs very slowly compared to ghostscript. Here's my sample code ``` public class SpeedTest { static long startTime = System.currentTimeMillis (); public static void logTime (String msg) { ...
2018/03/04
2,789
9,020
<issue_start>username_0: I'm still a newbie to **C** ``` char* str = (char*)malloc(512); str = "hello"; *(str) = 'H'; // Segmentation fault ``` I get a `Segmentation fault` on the third line trying to **set** an character I know that `str` is a **pointer** to the **first** `char` and I can **printf** it ``` printf...
2018/03/04
2,329
7,622
<issue_start>username_0: I am working on a question and it reads: Generate 1000 iid variates of X=(x1, x2) with a specific definition that is given in an example. The definition is that x1 is a standard normal distribution so N(0,1). However x2 is approximately x1 when -1 <= x1 <=1 and is x1 otherwise. [![enter image...
2018/03/04
1,006
4,001
<issue_start>username_0: I have a library that scans a directory for files on a remote server. It returns a Promise like this: ``` client.scanRemoteDirectory(path) .then(files => { console.log(files) }) ``` I'm trying to write a recursive method to scan directories and subdirectories too. But I'm running ...
2018/03/04
893
2,328
<issue_start>username_0: This is a rather simple operation, but it is repeated millions of times in my actual code and, if possible, I'd like to improve its performance. ``` import numpy as np # Initial data array xx = np.random.uniform(0., 1., (3, 14, 1)) # Coefficients used to modify 'xx' a, b, c = np.random.unifor...
2018/03/04
705
2,634
<issue_start>username_0: I need to rewrite this awful piece of code using recursion in Python. The depth of the nesting should depend on argument of function rec but eventaully I'd like it to be length of the variable "a", which is string. I'd be grateful for any responses and clues how to approach this problem. ``` ...
2018/03/04
1,689
4,229
<issue_start>username_0: I have the code ``` img = cv2.imread("poolPictures\chessboard3.jpg", cv2.IMREAD_COLOR) chessboardImage = cv2.imread("poolPictures\chessboardActual.jpg", cv2.IMREAD_COLOR) ret, corners = cv2.findChessboardCorners(img, (9,6), None) cv2.drawChessboardCorners(img, (9,6), corners, ret) chessRet,...
2018/03/04
1,296
3,306
<issue_start>username_0: I have simple application which contains `UICollectionViewController` with custom `UICollectionViewCell`. The controller is placed in Mainstoryboard (I use native xamarin). My application works, but I want to add a common '**header**' control above of my collection view (with buttons and labels...
2018/03/04
723
2,754
<issue_start>username_0: I have three activities on my App. MainActivity's layout is a DrawerLayout with `fitsSystemWindows="true"`. The other two activities' root element is a CoordinatorLayout with the same properties. I've defined `android:launchMode="singleTop"` for all activities in the manifest. All activities ...
2018/03/04
679
2,665
<issue_start>username_0: Strange case: using Powermock to mock out UUID.getRandom(). This works within the JUnit test class but when the class under test (a Filter, if that matters) calls UUID.getRandom, a unique UUID is produced. Simple test case ``` @RunWith(PowerMockRunner.class) @PrepareForTest({UUID.class}) publ...
2018/03/04
905
3,129
<issue_start>username_0: I am using React. In the code below, when I click on the Reset button, it clears the input and set the default value 'Dear .' back. What is happening? why doesn't it reset the `Dear .` too? and after clicking on Reset button I assume that it re-renders, but `console.log('rende');` is not called...
2018/03/04
1,199
4,007
<issue_start>username_0: I have the following questions regarding the `constexpr`, I kinda understand that one cannot declare a `std::shared_ptr` to be `const`, but why does the first `static_assert()` works? Also, how does the second `static_assert()` work? I wanted to have an array of `std::variants`, which are cons...
2018/03/04
670
1,935
<issue_start>username_0: So I have this: ``` 'title' => 'required|max:100|regex:/^(?=.*[a-zA-Z]).+$/', 'start_time' => 'date_format:H:i|regex:/^((([01]?[0-9]|2[0-3]):[0-5][0-9])?)$/', ``` title is working perfect (the user has to enter at least 1 letter) But I'm having problems with start\_time which is returning ...
2018/03/04
849
2,537
<issue_start>username_0: I wondered if its better to: 1. Pass Object1 into Object2 for use or 2. Instantiate Object1 from Object2 I could do either, but I am wondering what is better practice, or where i could get caught up. These are rather rudimentary examples, and of course in the second example, i could just u...
2018/03/04
591
2,412
<issue_start>username_0: What is everybody's favourite way of injecting dependencies when unit testing `UIViewController.viewDidLoad()` method on iOS? Given my implementation is: ``` class MyViewController: UIViewController { var service: Service = Service() override func viewDidLoad() { super.viewD...
2018/03/04
1,337
4,872
<issue_start>username_0: Suppose I have a simple *[Hello, World!](https://en.wikipedia.org/wiki/%22Hello,_World!%22_program)* file in C++ or C (whatever will help me use it easier in Node.js, preferably C) and want to run it from a Node.js file. What is the most efficient way considering that the file will be used to b...
2018/03/04
755
3,074
<issue_start>username_0: I'm trying to populate a table using JSON from a local page. So far it fetches all data from the JSON but still doesn't get any text into the cells. I checked the identifier of my cell and it matches with the withIdentifier or used the variable nom or fec and also doesn't work. Any help would...
2018/03/04
526
2,120
<issue_start>username_0: I am trying to setup Angular CLI to an ASP.Net MVC project using the [tutorial](https://dotnetthoughts.net/how-to-use-angular4-wth-aspnet-mvc/). When all described steps are done, I can run my project successfully, but the problem is that, the project must be rebuilt every time there were any ...
2018/03/04
541
1,947
<issue_start>username_0: I get the error: [Error] no matching function for call to 'subjects::subjects(std::string&, std::string&, std::string&, int&, int&)'. Here is my code: ``` void listInput(subjects a){ // subjects a; cout<<"Enter the name of the subject"<>a.subjectName; while(a.subjectName.empty()){ cout<...
2018/03/04
513
2,049
<issue_start>username_0: I'm currently using a `try/except` block to treat a particular variable as an iterable when I can, but handle it a different, though correct, manner when it isn't iterable. My problem is that a TypeException may be thrown for reasons other than trying to iterate with a non-iterable. My check ...
2018/03/04
725
2,546
<issue_start>username_0: How can I prevent the Route prefix from being passed to all the child routes controller functions as the first parameter? It is messing with the $id parameter of my child routes! ``` Route::prefix('{locale?}')->middleware(['locale.default', 'locale'])->group(function() { Route::get('/car...
2018/03/04
505
2,052
<issue_start>username_0: Is it legal to destruct and construct the elements of a vector externally? Assuming that you leave the same set of elements in a constructed state that you started with, of course? And assuming to don't do anything obviously dumb, like calling the destructor twice on the same element, or simila...
2018/03/04
536
1,984
<issue_start>username_0: So I am doing a pretty basic landing page in Elm and I want to determine what picture to use depending on the initial screen size and then again on resize. I found the resize function on the Window module, and made it work fine, but I couldn't figure out how to do it on load as well. I am look...
2018/03/04
638
2,336
<issue_start>username_0: I'm looking to change the pitch and playback speed of some audio in real time with a slider, or a variable (i.e. while the sound is playing) in Xcode, Swift 4. Currently, I'm using AVAudioEngine, which allows me to set these values before playback starts, but I can't change them while I the a...
2018/03/04
850
3,284
<issue_start>username_0: So, I am trying to using conditional statements and check boxes on a form in c# to conditionally build a MySQL SQL query. I don't see many topics on it so either I am doing something wrong (quite possible), or I am missing something simple. Either way, I have hit a wall and could use some help....
2018/03/04
1,154
3,650
<issue_start>username_0: I'm trying to load the package StanfordCoreNLP to get the correct parsing for the movie reviews presented in their page (<https://nlp.stanford.edu/sentiment/treebank.html>): (I'm using MAC) ``` nlp = StanfordCoreNLP("/Users//NLP_models/stanford-corenlp-full-2018-01-31") ``` But get the error...
2018/03/04
511
1,778
<issue_start>username_0: I have a problem with python directories. I have structure like: * python + modules - algorithms * cyphers + morse.py + tests - algorithms * cyphers + test\_morse.py When I try to import module in test I get a module not found error. I am trying to import like: ``` paren...
2018/03/04
293
878
<issue_start>username_0: ``` plt.legend('g(x) = x^3 − x + 1', loc = 'upper left') ``` I have this line of code in my program, but the legend appears just as a small box with no text in it on my graph. Any solutions?<issue_comment>username_1: Try wrapping the input to the legend argument in a list, like this ``` plt...
2018/03/04
1,131
4,584
<issue_start>username_0: How `train_on_batch()` is different from `fit()`? What are the cases when we should use `train_on_batch()`?<issue_comment>username_1: For this question, it's a [simple answer from the primary author](https://github.com/keras-team/keras/issues/2708#issuecomment-218803413): > > With `fit_genera...
2018/03/04
266
1,016
<issue_start>username_0: I've seen some Layout Editors in Android Studio with a ruler on top and on the side for the Preview window and I'm trying to figure it out how to enable, any ideas? I'm using Android Studio 3.0.1 and I can't see them. [![enter image description here](https://i.stack.imgur.com/uwaJF.png)](http...
2018/03/04
391
1,519
<issue_start>username_0: I created an etch-a-sketch type of program so that when a user enters a height, width, and select a color choice, they are able to draw on the provided grid below. I am having troubles with the drawing part. I included a link to my code via codepen ... Online 37, I created a mouseover event but...
2018/03/04
310
1,188
<issue_start>username_0: In my database I have two columns. First is called `starting` and the other is`ending`. Both are formatted like `11:00`. How to get the interval between ending and starting. I have tried `whereBetween`, but it didn't work as I think.<issue_comment>username_1: You can use Carbon to get the diff...
2018/03/04
455
1,708
<issue_start>username_0: I’m trying to upload my certs to Bitrise by using the `codesigndoc` tool, which I’m running with the following command bash -l -c "$(curl -sfL <https://raw.githubusercontent.com/bitrise-tools/codesigndoc/master/_scripts/install_wrap-xcode.sh>) --scheme='my Scheme' --certs-only" The issue is t...
2018/03/04
707
2,724
<issue_start>username_0: I'm fairly new to Python and Django. I've recently got a Django app working on localhost in Linux Mint 18.3 with a Postgresql database. I've uploaded the app to PythonAnywhere, but unfortunately it requires Java for some of the NLP features (Stanford POS). Is there a way to parse and process ...
2018/03/04
523
1,704
<issue_start>username_0: I would like to redirect the following urls from: <http://example.com/index.php/item123-detail?tmpl=component&format=pdf> to: <http://example.com/index.php/item123-detail> In essence removing the "?tmpl=component&format=pdf" from all urls. I have tried multiple different examples from othe...
2018/03/04
580
1,974
<issue_start>username_0: I'll try to explain this the best I can. Let's say I have 2 if statements that both send a Debug.Log message to console, like this: ``` if(Input.GetKeyDown("c")){ Debug.Log("C was pressed!"); } if(Input.GetKeyDown("b")){ Debug.Log("b was pressed!"); } ``` We of course know that we'...
2018/03/04
1,961
6,923
<issue_start>username_0: I want to create a python script using NLTK or whatever library is best to correctly identify given sentence is interrogative (a question) or not. I tried using regex but there are deeper scenarios where regex fails. so wanted to use Natural Language Processing can anybody help!<issue_comment>u...
2018/03/04
864
2,621
<issue_start>username_0: I need help editing this function lenumerate() that takes a string (like 's') and returns a list of 2-item lists containing each word and it's length:`[['But', 3], ['then', 4], ['of', 2], ... ['are', 3], ['nonmigratory', 12]]` > > lenumerate(s) - convert 's' into list of 2-element lists: [[wo...
2018/03/04
671
2,190
<issue_start>username_0: Having trouble with accepting nested attributes when I've changed the class name. I'm sure I am just missing something obvious but just can't seem to find it. models/walk.rb ``` class Walk < ApplicationRecord has_many :attendees, class_name: 'WalkAttendee', foreign_key: "walk_id", dependent...
2018/03/04
384
1,337
<issue_start>username_0: I have a JAX-RS application deployed under tomcat and a mobile app. I would like to know how to make the webservice usable only by the mobile application, in other words, allow access only for a given application<issue_comment>username_1: I was going about the validation all wrong. Thanks to @m...
2018/03/04
1,040
3,287
<issue_start>username_0: ``` list.append(elapse): if len(list) > 50: raise Exception(list_2.append(elapse)) else: list.append(elapse) ``` I have no idea how to format this, I just want it so that once `list[]` gets to big the new entries are diverted into `list_2[]`, my original cod...
2018/03/04
521
1,708
<issue_start>username_0: I have the following data structure: ``` Dictionary>> data = new Dictionary>>(); ``` I want to filter some of the elements in that dictionary based on value in first element of the list of the inner dictionary. ``` for example: {legion1 {soldier1, [10,1000]}, {soldier2, [50,1000]} } ``` ...
2018/03/04
1,174
4,740
<issue_start>username_0: At the moment I'm creating fixed thread pool using the Executor service like ``` executor = Executors.newFixedThreadPool(coreAmount); ``` While this is fine, I was wondering if it's possible to keep the behaviour of creating a number of threads and change the max pool limit so that if all t...
2018/03/04
8,301
19,075
<issue_start>username_0: I have the following structure ``` 'data.frame': 0 obs. of 18 variables: $ IDnumber : chr $ sctrs : chr $ Region : chr $ status : num $ EBIT.TA : num $ EBITDA.TA : num $ NI.SALES : num $ EQ.TA...
2018/03/04
668
2,405
<issue_start>username_0: In Python 2, a Python variable name contains only ASCII letters, numbers and underscores, and it must not start with a number. Thus, ``` re.search(r'[_a-zA-Z][_a-zA-Z0-9]*', s) ``` will find a matching Python name in the `str` `s`. In Python 3, the letters are no longer restricted to ASCII...
2018/03/04
301
1,082
<issue_start>username_0: Consider an image which is a composite of repeated pattern of varying size and unknown topography (as shown below) [![An image composed of varying tile patterns. Note that there are 4 patterns here considering that the images of same topography are classified in the same category ](https://i.s...
2018/03/04
2,649
8,176
<issue_start>username_0: What is the best way in python to parse these results? I have tried regex but can't get it to work. I am looking for a dictionary of title, author etc as keys. ```html @article{perry2000epidemiological, title={An epidemiological study to establish the prevalence of urinary symptoms and felt ...
2018/03/04
565
1,997
<issue_start>username_0: Tried all the answers on this q, but just can't get the count to display (or maybe the js to run?) Here's my code .. I want the current count of selected items to update each time I select another Any advice appreciated .. learning every day ``` function count\_cars() { var options = docum...
2018/03/04
1,175
3,501
<issue_start>username_0: I have Visual Studio 2017 Community edition installed on my PC. Recently I installed Qt5.10.1. I generated a VS project from one of the example .pro files: ``` qmake -tp vc cube.pro ``` However when I open this VS project and build it I get the error: The Windows SDK version 8.1 was not fo...
2018/03/04
917
2,973
<issue_start>username_0: In one of my classes header file `Lfo.h`, I have a class definition where I put the member function definition out of the class (It might be better to have a separate .cpp file but it should be ok put here?): ``` // Lfo.h class CLfo { public: static int create (CLfo*& pCLfo); }; int CLfo:...
2018/03/04
563
2,150
<issue_start>username_0: I am new to the ASP.Net framework, and I am currently struggling to understand how to manage lifetimes of objects. In a more specific case I am currently facing a problem in my application: I want to have a class starting with my application, which should run in the background and do some wor...
2018/03/04
964
3,855
<issue_start>username_0: I'm going to migrate the site <http://www.thetrekkr.com> (from a friend) to another server. The current server does have problems, until I migrate the domain I made a subdomain which is <http://www.thetrekkr.pd-design.at>. Everything works except the **themes (Avada) icons** - this must be font...
2018/03/04
447
1,427
<issue_start>username_0: Well I want that when the button is clicked the modal closes [![enter image description here](https://i.stack.imgur.com/v4bZF.png)](https://i.stack.imgur.com/v4bZF.png) main.component.ts here you could do something too ``` crear(form){ this._servicio.creararchivos(this.formulario).subscrib...
2018/03/04
515
1,945
<issue_start>username_0: When we say that a function's result is sent to output buffer, it means that the result is not visible until echoed. And for functions that output directly, we use ob\_start to direct the result to the output buffer (before it hits the browser as plain html) so that we may manipulate it, and th...
2018/03/04
1,151
5,071
<issue_start>username_0: I have a scenario where I need to create a user using the `Auth` and add more info (such as name and type of business) to Firestore database. Firestore as transaction/batch operation but it is for Firestore only. Is there a way where I can perform `Auth` operation such as create along with the...
2018/03/04
1,435
6,016
<issue_start>username_0: Here is the head of my data.frame,df in r. There is no pattern in any row or column. ``` Type SIZE V1 V2 A 1 5 7 B 1 NA NA B 3 NA NA B 4 NA NA A 8 2 4 ...
2018/03/04
653
1,882
<issue_start>username_0: I am trying to calculate the FWHM of spectra using python. The spectral description (I'm talking in terms of the physics) for me it's bit complicated and I can't fit the data using some simple Gaussian or Lorentizian profile. So far I managed to manage interpolation of the data and draw a str...
2018/03/04
1,753
6,181
<issue_start>username_0: There is a similar question here: [Regular Expression For Consecutive Duplicate Words](https://stackoverflow.com/questions/2823016/regular-expression-for-consecutive-duplicate-words). This addresses the general question of how to solve this problem, whereas I am looking for specific advice on w...
2018/03/04
1,564
5,547
<issue_start>username_0: I am struggling to figure out how to display/hide sub-category "Auto Parts" when I check/select "Automobiles". I looked through lot of examples posted here but none of them are working for me. Also, the html is from plugin so I don't have much control over it. Thanks in advance. /\* ``` - ...
2018/03/04
654
1,767
<issue_start>username_0: I wrote this code: ``` alist = [[0], [1], [2]] blist = [-1, 0, 1] for a, b in zip(alist, blist): a.append(b) ``` > > output is [[0, -1], [1, 0], [2, 1]] > > > It works, but is there a way to remove the loop entirely?<issue_comment>username_1: ``` >>> alist = [[0], [1], [2]] >>> bli...
2018/03/04
319
1,117
<issue_start>username_0: I am new writing lua extension for vlc. I have a bare minimal vlc extension that pops a dialog on activating the menu item and logs message to terminal. How to get the current duration of the file which is playing. Looked at this manual <https://www.videolan.org/developers/vlc/share/lua/README....
2018/03/04
912
3,175
<issue_start>username_0: Please help me to optimize my scrapy spider. Specially next page pagination is not working. There are lot of page per page has 50 items. I catch first page 50 items(link) in parse\_items and next page items also scrap in parse\_items. ``` import scrapy from scrapy import Field from fake_userag...
2018/03/04
505
1,815
<issue_start>username_0: I'm having trouble with creating a view using the Inner Join, i have these 3 tables * Projects (ProjID, ProjName, InitDate, EndDate) * Employees (EmpID, EmpName, Phone, City, Salary) * Assign (ProjID, EmpID, Hours, Status, Date) What i am triying to do is to create a view with the name "View1...
2018/03/04
940
2,759
<issue_start>username_0: say I have a dataset called Economic\_Trends, and it contains 5 columns with 10 years of data. So for example, ``` Economic_Trend <- matrix(c(1:10, 2:11, rnorm(30)), byrow = FALSE, nrow = 10, ncol = 5) ``` Then this is the code that I run: ``` mu <- colMeans(Economic_Trend) Econ_pca <- pr...
2018/03/04
584
1,972
<issue_start>username_0: Unfortunately I am having problems using `uasort` (or any function which expects a callback function) within a Namespace. Within this script I am not using any classes (therefore no OOP). I didn't come up with any solution (declaring the Namespace with the callback function did not help). I...
2018/03/04
161
468
<issue_start>username_0: How to return the length of a dictionary to a variable in python?<issue_comment>username_1: Simply just use len(): ``` dic = {'val1':0,'val2':0,'val3':0} length = len(dic) ``` Upvotes: 1 <issue_comment>username_2: `my_var = len(my_dict)` Gets the number of keys in the dictionary. Equivalent ...
2018/03/04
570
1,832
<issue_start>username_0: I have a part of an URL from a curl command like: ``` Newest Version 2.1.4 ``` (The result is longer, but this should do it as well. I want to have a sed or awk statement that leaves only ``` 2.1.4 ``` What is the most "dynamic" way to do that? Is it possible to filter only the Numbers af...
2018/03/04
548
2,239
<issue_start>username_0: In my `componentWillMount` function, I have an `async` function `getResults` that fetches data from a server. I want to pass the response from `getResults` to the same component on initial load, but I noticed that my component renders before waiting for the data to come back from `getResults`. ...
2018/03/04
1,185
3,131
<issue_start>username_0: couple issues with my code I need help working out. 1. how do I get the header to only print once above the results, and not at all if nothing meetings the criteria? 2. the else component of my code is no longer working, it used to just print if none of the other scenarios were true but I upd...
2018/03/04
1,035
2,884
<issue_start>username_0: How can I create data vector to filter data.table? ``` timeframe = as.Date(seq(ISOdate(1997,06,12), Sys.time(), "weeks")) timeframe2 = c("1997-06-12", "1997-06-19") tmp = data[Name == "aaa" & Date %in% timeframe] #doesn't return data tmp = data[Name == "aaa" & Date %in% timeframe2] #returns...
2018/03/04
1,030
2,924
<issue_start>username_0: I am trying to connect to remote socket server and i get an error: "Socket connection failed for unknown reasons" spent a lot of time, and I could not find a solution ( Please, helpe me/ thanks [![enter image description here](https://i.stack.imgur.com/GhwUQ.png)](https://i.stack.imgur.com/Gh...
2018/03/04
972
3,463
<issue_start>username_0: I am working on a practice quiz and one of the questions makes you work with ``` data Person = MakePerson String Int Float ``` where String is the name, Int is the age, Float is the height. I must create a function that takes in a list of persons and returns the oldest person (know strict ...
2018/03/04
647
2,396
<issue_start>username_0: I am trying to migrate my models to use Guardian permissions. At this point I have: ``` class Data(models.Model): user = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE) class Meta: permissions = ( ('view', 'View'), ('edit', 'Edit'),...
2018/03/04
839
2,768
<issue_start>username_0: I'm trying to parse out JSON data and create my own dictionary to show a subset of the data. The thing is, I'm noticing that my input data changes based on what is scanned (with nmap). Some elements might be an array value, whereas some might not. The combinations seem to be pretty broad. For...
2018/03/04
392
1,400
<issue_start>username_0: I'am trying to generate certificate from Let's Encrypt It over certbot (package ver. 0.21.1.-1), but i'am getting error. I'am using webroot module. ``` OSError: Could not find a suitable TLS CA certificate bundle, invalid path: /etc/ssl/certs/ca-certificates.crt ``` I don't have there file w...
2018/03/04
967
3,128
<issue_start>username_0: I am trying to implement the range function in clojure, but my implementation is returning an error that I cannot understand. Here it is: ``` (defn implement-range [a b] ( if (= a b) (conj nil b) ((conj nil a) (implement-range (inc a) b)))) ``` I am trying to do in a recursive way, it ...
2018/03/04
733
2,437
<issue_start>username_0: So far i worked is on the above with time complexity n^2, can anyone helper increase the efficiency to nlogn or below? ``` bool checkDuplicates( int array[], int n) { int i,j; for( i = 0; i < n; i++ ) { for( j = i+1; j < n; j++ ) { if( array[i] == arra...
2018/03/04
702
2,396
<issue_start>username_0: While changing to a CMake and Travis CI build environment I enabled the compilation on Travis CI. Even though the CMake project compiles correctly on my pc, Travis exited with 2: ``` In file included from /home/travis/build/Codestones/Proton/source/application.cpp:1:0: /home/travis/build/Codes...
2018/03/04
449
1,527
<issue_start>username_0: I have a collection with all the students of my school. Each document has a `sports` array property that lists the sports practiced by each student, but that property may appear either as `sports: []` or `sports: null` or not appear at all. How can I retrieve all the documents that fall in one...
2018/03/04
438
1,464
<issue_start>username_0: Let's assume we have a multiline string, like ``` var s:String = "my first line\nmy second line\nmy third line\nand so on!"; ``` What is the best way to get (only) the first line of this string in Haxe? I know I can do something like: ``` static function getFirstLine(s:String):String { ...
2018/03/04
5,170
20,478
<issue_start>username_0: I'm trying to create a google spreadsheet directly from android app using google drive api. I'm run the code given in quickstart <https://developers.google.com/drive/v3/web/quickstart/android#step_5_setup_the_sample> and it works fine. Now while creating spreadsheet, android studio cannot resol...
2018/03/04
950
3,228
<issue_start>username_0: New to Python and was testing simple example of passing by reference versus passing by value. But I ran into an unexpected syntax hurdle, but not sure what I'm missing here. ``` #!usr/local/bin python3 def print_reference(list[:]): temp = list.pop() print(temp) def print_value(list):...