Id
int64
34.6M
60.5M
Title
stringlengths
15
150
Body
stringlengths
33
36.7k
Tags
stringlengths
3
112
CreationDate
stringdate
2016-01-01 00:21:59
2020-02-29 17:55:56
Y
stringclasses
3 values
57,299,646
merge multiple rows having some identity to a new one that have the sum of a culumn thats is distinct between thems
i have table like this : id name qt 0 mm 4 1 mm 5 2 xx 8 i want update it or get new table that will have id name qt 0 mm 9 (sum of the two or multiple some identical ) 1 xx 8
<sql><sql-server>
2019-07-31 22:35:09
LQ_EDIT
57,299,662
Do I use Node.js to build a whole website?
<p>The last couple of days I began to teach myself how to create a Website from scratch.</p> <p>I bought a webspace and fooled around with html, css and javascript and when I wanted to build a online chess game I learned about Node.js</p> <p>But I don't understand what Node.js is used for because the <a href="https://nodejs.org/dist/latest-v10.x/docs/api/http.html#http_http" rel="nofollow noreferrer">documentation</a> shows how to install and create a fresh server(!) with Node.js and handle requests. </p> <ul> <li><p>Do I don't have to use a apache installation on my server anymore? </p></li> <li><p>Do I create the whole website and all it's pages with Node.js like the index or about page? </p></li> <li><p>If I use Node.js just for a web application, how can I add the web app to an already existing Apache website's page?</p></li> </ul> <p>I think I really got confused and need some help to understand Node.js better since so many are using it.</p>
<javascript><html><node.js><apache><web>
2019-07-31 22:36:44
LQ_CLOSE
57,299,926
how to set json data in table view
<p>I want to get data from Json and put it in the table and display it from the API via Alamofire through the 'Post' process that has parameters containing the page number</p> <p>I want get "results" .. </p> <p>{ "responseCode": 200, "message": null, "status": true, "results": [ { "id": 971, "title": "ST201972362", "cdate": "07/31/2019", "summary": "test", "address": "", "timer": "77876203", "lat": "31.515934", "lng": "34.4494066", "source": "2", "CreatedOn": "2019-07-31T13:38:46.927", "done_940": null }, { "id": 970, "title": "ST201972356", "cdate": "07/30/2019", "summary": "ov", "address": "", "timer": "0", "lat": "31.5159315", "lng": "34.4493925", "source": "2", "CreatedOn": "2019-07-30T15:26:00.077", "done_940": null }, { "id": 964, "title": "ST201972341", "cdate": "07/29/2019", "summary": "تجربة بلاغ ", "address": "", "timer": "0", "lat": "21.5066086", "lng": "39.1758587", "source": "2", "CreatedOn": "2019-07-29T19:06:58.817", "done_940": null }, { "id": 959, "title": "ST201972820252314", "cdate": "07/28/2019", "summary": "اااااا", "address": "", "timer": "0", "lat": "21.5066716", "lng": "39.1758483", "source": "1", "CreatedOn": "2019-07-28T11:45:02.493", "done_940": null }, { "id": 957, "title": "ST201972312", "cdate": "07/28/2019", "summary": "تمتمتم", "address": "", "timer": "0", "lat": "31.5397884", "lng": "34.4544891", "source": "2", "CreatedOn": "2019-07-28T08:56:43.577", "done_940": null }, { "id": 956, "title": "ST201972312", "cdate": "07/28/2019", "summary": "لا تنام", "address": "", "timer": "0", "lat": "31.5397238", "lng": "34.4540829", "source": "2", "CreatedOn": "2019-07-28T08:56:00.15", "done_940": null }, { "id": 955, "title": "ST201972311", "cdate": "07/28/2019", "summary": "تجربه جديد", "address": "", "timer": "0", "lat": "31.5395001", "lng": "34.4542211", "source": "2", "CreatedOn": "2019-07-28T08:52:09.81", "done_940": null }, { "id": 953, "title": "ST201972309", "cdate": "07/28/2019", "summary": "يلا", "address": "", "timer": "0", "lat": "31.5110196", "lng": "34.4784933", "source": "2", "CreatedOn": "2019-07-28T05:30:29.647", "done_940": null }, { "id": 952, "title": "ST201972309", "cdate": "07/28/2019", "summary": "ماك ١", "address": "", "timer": "0", "lat": "31.5110291", "lng": "34.4785841", "source": "2", "CreatedOn": "2019-07-28T05:29:09.943", "done_940": null }, { "id": 949, "title": "ST201972307", "cdate": "07/28/2019", "summary": "مرحبا", "address": "", "timer": "0", "lat": "31.5443154", "lng": "34.4585304", "source": "2", "CreatedOn": "2019-07-28T00:20:42.753", "done_940": null } ], "done_940": "2/811" }</p>
<ios><json><swift><uitableview>
2019-07-31 23:14:16
LQ_CLOSE
57,300,871
Can I use "request" and "cheerio" libraries to extract data from a .html file?
<p>I'm creating a React Web Application and using request and cheerio to do some Web Scrapping. I need to extract data from a .html file. The user enters with a .html in an input:</p> <pre><code>&lt;input type='file' /&gt; </code></pre> <p>How can I extract data from the file? It is possible with those libraries? I know that request needs an <code>url</code> and I guess that it will be the local path to file. I used the following code to do Web Scrapping:</p> <pre><code>const foo = await new Promise(function (resolve, reject) { request.get(url, (err, res2, data) =&gt; { const $ = cheerio.load(data) let s = $("tbody &lt; table.table_lt").text().replace(/\t/g, '').replace(/\n/g, '') resolve(s) }) }) </code></pre> <p>But this work just with Web.</p>
<node.js><web><request><cheerio>
2019-08-01 01:50:18
LQ_CLOSE
57,301,058
Hi, guys I need help solving this question that involves function and optionals
Im done with the first part, I need help with second question that involves updating the function to return an Int. Ive tried to solve it but what I get is an error If an app asks for a user's age, it may be because the app requires a user to be over a certain age to use some of the services it provides. Write a function called checkAge that takes one parameter of type String. The function should try to convert this parameter into an Int value and then check if the user is over 18 years old. If he/she is old enough, print "Welcome!", otherwise print "Sorry, but you aren't old enough to use our app." If the String parameter cannot be converted into an Int value, print "Sorry, something went wrong. Can you please re-enter your age?" Call the function and pass in userInputAge below as the single parameter. Then call the function and pass in a string that can be converted to an integer. Go back and update your function to return the age as an integer. Will your function always return a value? Make sure your return type accurately reflects this. Call the function and print the return value. func checkage(age: String)->Int? { if let age_type = Int(age) { if age_type > 18 { return "Welcome!" } else if age_type < 18 { return"Sorry, but you aren't old enough to use our app." } } else { return "Sorry, something went wrong. Can you please re-enter your age?" } return age_type } print(checkage(age:"23")) error: 3. Exercise - Functions and Optionals.xcplaygroundpage:20:12: error: use of unresolved identifier 'age_type' return age_type ^~~~~~~~
<swift><optional>
2019-08-01 02:20:47
LQ_EDIT
57,302,802
I get exception after pressing click() for "FindElemebtByID"
I get exception after pressing click() for "FindElemebtByID". I get the next exception: Error CS1061 'ReadOnlyCollection<WindowsElement>' does not contain a definition for 'Click' and no accessible extension method 'Click' accepting a first argument of type 'ReadOnlyCollection<WindowsElement>' could be found (are you missing a using directive or an assembly reference?) my code is: var EQ = DesktopSession.FindElementByName(@"C:\Users"); var EQWindowHandle = EQ.GetAttribute("NativeWindowHandle"); EQWindowHandle = (int.Parse(EQWindowHandle)).ToString("x");
<c#><winappdriver>
2019-08-01 06:14:37
LQ_EDIT
57,305,495
How to disable NavigationView push and pop animations
<p>Given this simple <code>NavigationView</code>:</p> <pre class="lang-swift prettyprint-override"><code>struct ContentView : View { var body: some View { NavigationView { VStack { NavigationLink("Push Me", destination: Text("PUSHED VIEW")) } } } } </code></pre> <p>Did anyone find a way of disabling the <code>NavigationView</code> animation when a destination view is pushed/popped into/from the stack?</p> <p>This has been possible in UIKit since iOS2.0! I think it is not too much to ask from the framework. I tried all sorts of modifiers on all views (i.e., the <code>NavigationView</code> container, the destination view, the <code>NavigationLink</code>, etc)</p> <p>These are some of the modifiers I tried:</p> <pre class="lang-swift prettyprint-override"><code>.animation(nil) </code></pre> <pre class="lang-swift prettyprint-override"><code>.transition(.identity) </code></pre> <pre class="lang-swift prettyprint-override"><code>.transaction { t in t.disablesAnimations = true } </code></pre> <pre class="lang-swift prettyprint-override"><code>.transaction { t in t.animation = nil } </code></pre> <p>None made a difference. I did not find anything useful in the <code>EnvironmentValues</code> either :-(</p> <p>Am I missing something very obvious, or is the functionality just not there yet?</p>
<swiftui>
2019-08-01 09:08:23
HQ
57,305,918
I'm getting an error "Error type 'AuthResult' is not a subtype of type 'FirebaseUser' in type cast" when I'm trying to login or signup
<p>I'm making a flutter app for my college project, where I'm adding a login and signup page and authenticating it via Firebase, and when I click login the debug console says <strong>"Error type 'AuthResult' is not a subtype of type 'FirebaseUser' in type cast"</strong> and when I reload the app after this error it successfully logs in.</p> <p>Everything was working best before the update of the <strong>firebase_auth</strong> package to 0.12.0 after this update, the methods "signInWithEmailAndPassword()" and "createUserWithEmailAndPassword()" throwing an error <strong>"A value of type 'AuthResult' can't be assigned to a variable of type 'FirebaseUser'. Try changing the type of the variable, or casting the right-hand type to 'FirebaseUser'"</strong>, so I added a cast <strong>as FirebaseUser</strong> which fixed the error and the app was built successfully but when i clicked on login or create account, debug console said <strong>Error type 'AuthResult' is not a subtype of type 'FirebaseUser' in type cast</strong></p> <p>the main login and create account function code before the update of firebase_auth 0.12.0</p> <pre><code>Future&lt;String&gt; signIn(String email, String password) async { FirebaseUser user = await FirebaseAuth.instance.signInWithEmailAndPassword( email: email, password: password); return user.uid; } Future&lt;String&gt; createUser(String email, String password) async { FirebaseUser user = await FirebaseAuth.instance.createUserWithEmailAndPassword( email: email, password: password); return user.uid; } </code></pre> <p>the above code was working fine, after the update (firebase_auth 0.12.0) the same code started throwing this error,</p> <pre><code>A value of type 'AuthResult' can't be assigned to a variable of type 'FirebaseUser'. Try changing the type of the variable, or casting the right-hand type to 'FirebaseUser'.dart(invalid_assignment) </code></pre> <p>I fixed the error by casting "FirebaseUser" as shown below</p> <pre><code>Future&lt;String&gt; signIn(String email, String password) async { FirebaseUser user = await FirebaseAuth.instance.signInWithEmailAndPassword( email: email, password: password) as FirebaseUser; return user.uid; } Future&lt;String&gt; createUser(String email, String password) async { FirebaseUser user = await FirebaseAuth.instance.createUserWithEmailAndPassword( email: email, password: password) as FirebaseUser; return user.uid; } </code></pre> <p>this new code didn't threw an error in compilation but when I try to login or create new account it throws an error in debug console Error type 'AuthResult' is not a subtype of type 'FirebaseUser' in type cast and the new created account is successfully created on firebase but the app doesn't go on the next page but as soon as i reload it starts with the page that should come after login and creation of account(sign out is working perfectly)</p>
<flutter><dart><firebase-authentication>
2019-08-01 09:29:38
HQ
57,306,611
How can I remove default version of bundler?
<p>I tried to change default bundle version but it getting updated with 2 default version. How can I modify to single default?</p> <pre><code>$ gem list bundler *** LOCAL GEMS *** bundler (2.0.1, default: 1.16.6, default: 1.16.2) </code></pre> <p>If I do gem uninstall not removing defaults,</p> <pre><code>$ gem uninstall bundler Successfully uninstalled bundler-2.0.1 $ gem list bundle *** LOCAL GEMS *** bundler (default: 1.16.6, default: 1.16.2) </code></pre> <p>How can I set (like the below) default as single version?</p> <pre><code>bundler (2.0.1, default: 1.16.6) </code></pre>
<ruby-on-rails><rubygems><bundler>
2019-08-01 10:06:33
HQ
57,307,686
wmic is not recognized as an internal or external command, operable program or batch file
<p>I'm trying to get my motherboard's serial number through the following command in windows 10 cmd: </p> <pre><code>wmic baseboard get serialnumber </code></pre> <p>but I receive this Error:</p> <pre><code>wmic is not recognized as an internal or external command, operable program or batch file </code></pre> <p>while, this command works on other systems of mine (for example my office pc). What may be wrong with it?</p>
<windows><cmd><command-prompt><wmic>
2019-08-01 11:09:40
LQ_CLOSE
57,311,894
Java lwjgl GLSL shader issue with mac osx Validation Failed: No vertex array object bound
<p>I am building OPENGL application in Java using <a href="https://www.lwjgl.org/" rel="nofollow noreferrer">lwjgl</a> and following part of tutorial on YouTube by <a href="https://www.youtube.com/watch?v=DJnzafkmuTA&amp;list=PLEETnX-uPtBXP_B2yupUKlflXBznWIlL5&amp;index=9" rel="nofollow noreferrer">thebennybox</a></p> <p>I am able to create rectangle using Mesh class i build. </p> <pre><code>import engine.core.Util; import static org.lwjgl.opengl.GL15.*; import static org.lwjgl.opengl.GL20.*; public class Mesh { private int vbo; private int size; public Mesh() { this.vbo = glGenBuffers(); this.size = 0; } public void addVertices(Vertex[] vertices){ this.size = vertices.length * Vertex.SIZE; glBindBuffer(GL_ARRAY_BUFFER, vbo); glBufferData(GL_ARRAY_BUFFER, Util.createFlippedBuffer(vertices), GL_STATIC_DRAW); } public void draw(){ glEnableVertexAttribArray(0); glBindBuffer(GL_ARRAY_BUFFER, vbo); glVertexAttribPointer(0, 3, GL_FLOAT, false, Vertex.SIZE * 4, 0); glDrawArrays(GL_TRIANGLES, 0, this.size); glDisableVertexAttribArray(0); } } </code></pre> <p>And <code>util</code> helper</p> <pre><code>import engine.render.Vertex; import org.lwjgl.BufferUtils; import java.nio.FloatBuffer; public class Util { public static FloatBuffer createFloatBuffer(int size){ return BufferUtils.createFloatBuffer(size); } public static FloatBuffer createFlippedBuffer(Vertex[] vertices){ FloatBuffer buffer = createFloatBuffer(vertices.length * Vertex.SIZE); for(int i = 0; i &lt; vertices.length; i++) { buffer.put(vertices[i].getPos().getX()); buffer.put(vertices[i].getPos().getY()); buffer.put(vertices[i].getPos().getZ()); } buffer.flip(); return buffer; } } </code></pre> <p>Here is how i am rendering</p> <pre><code> this.mesh = new Mesh(); Vertex[] data = new Vertex[]{ //1st triangle new Vertex(new Vector3(0.5f,-0.5f,0)), //RB new Vertex(new Vector3(-0.5f,-0.5f,0)), //LB new Vertex(new Vector3(0.5f,0.5f,0)), //RT //2nd triangle new Vertex(new Vector3(-0.5f,0.5f,0)), //RB new Vertex(new Vector3(0.5f,0.5f,0)), //RT new Vertex(new Vector3(-0.5f,-0.5f,0)), //LB }; mesh.addVertices(data); public void render(){ //update per frame mesh.draw(); } </code></pre> <p>So far it worked. Then I followed tutorial for shader and got error</p> <blockquote> <p>Validation Failed: No vertex array object bound.</p> </blockquote> <p>Here is shader class</p> <pre><code>import static org.lwjgl.opengl.GL32C.*; public class Shader { private int program; public Shader() { program = glCreateProgram(); if(program == 0){ System.out.println("Shader creation failed!"); System.exit(1); } } public void addVertexShader(String text){ //System.out.println(text); addProgram(text, GL_VERTEX_SHADER); } public void addGeometryShader(String text){ addProgram(text, GL_GEOMETRY_SHADER); } public void addFragmentShader(String text){ addProgram(text, GL_FRAGMENT_SHADER); } public void bind(){ glUseProgram(program); } public void compileShader(){ glLinkProgram(program); if(glGetProgrami(program, GL_LINK_STATUS) == 0){ System.out.println(glGetProgramInfoLog(program, 1024)); System.exit(1); } glValidateProgram(program); if(glGetProgrami(program, GL_VALIDATE_STATUS) == 0){ // System.out.println("ffff"); System.out.println( glGetProgramInfoLog(program, 1024)); System.exit(1); } } public void addProgram(String text, int type){ int shader = glCreateShader(type); if(shader == 0){ System.out.println("Shader creation failed!"); System.exit(1); } glShaderSource(shader, text); glCompileShader(shader); if(glGetShaderi(shader, GL_COMPILE_STATUS) == 0){ System.out.println(glGetShaderInfoLog(shader, 1024)); System.exit(1); } glAttachShader(program, shader); } } </code></pre> <p>And here is ResourceLoader</p> <pre><code> import java.io.BufferedReader; import java.io.FileReader; public class ResourceLoader { public static String loadShader(String fileName){ StringBuilder shaderSource = new StringBuilder(); BufferedReader shaderReader = null; try { shaderReader = new BufferedReader(new FileReader(fileName)); String line; while ((line = shaderReader.readLine()) != null){ shaderSource.append(line).append("\n"); } } catch (Exception e){ System.out.println(e.getMessage()); } return shaderSource.toString(); } } </code></pre> <p>GLSL CODE FOR BOTH FILE</p> <pre><code> ==== basicVertex.glsl #version 410 core out vec4 outColor; void main(){ outColor = vec4(0.0, 1.0, 1.0, 1.0); } ========= basicFragment.glsl #version 410 core layout (location = 0) in vec3 position; void main(){ gl_Position = vec4(position, 1.0); } </code></pre>
<java><opengl><opencl><lwjgl>
2019-08-01 15:00:07
LQ_CLOSE
57,312,111
How to get values of all rows in jTable and split them with delimiters and newline?
Say I had a table like this: ``` |ID|Name|Work|Age| |31|John|IT |31 | |32|Jane|IT |22 | ``` And I wanted to convert the values in the cell to string with delimiters(,) and newline like this: ``` 31,John,IT, 31 32,Jane,IT ,22 ``` What code would I need to punch in in order for this to happen?
<java><swing><jtable>
2019-08-01 15:12:17
LQ_EDIT
57,312,345
Reading 10 csv file and storing it in database
<p>I am using JAVA 8 and Spring Boot.</p> <p>I have 10 files(.csv) with a million row each.What's the best to read the files and store it in Database?</p>
<java><spring-boot>
2019-08-01 15:24:59
LQ_CLOSE
57,313,583
Error handling when calling .bat within .bat
I am trying call a .bat file from within a .bat file. This is how the call is invoked : call %FWK_DIR%\run_sqlldr_process.bat !ldr!.ctl !log!.log !bad!.bad !data!.dat %BATCHUSER% %BATCHPWD% %ORACLE_SID% echo %ERRORLEVEL% echo %RC% There is a failure inside run_sqlldr_process.bat after which run_sqlldr_process.bat fails with return code 1 and exits with RC = 1. However, the parent .bat file does not capture the failed return code from run_sqlldr_process.bat. Both the echo statements return 0 and the parent script completes successfully. Please provide any pointers.
<batch-file>
2019-08-01 16:45:33
LQ_EDIT
57,314,144
what is difference between console.time() vs Date.now() in javascript and which one is better performance
<p>I have written some nodejs code and I am logging api call response timing. console.time() and Date.now() but I am not sure which one is better in performance and right to use.</p>
<javascript><node.js><performance><console.log>
2019-08-01 17:25:15
LQ_CLOSE
57,314,650
How to Add StockItem to list
<p>I have this code for my test, can you please help me</p> <p>1) A barcode label on a box in our warehouse has the following format HKGB43563PC5 The first 3 characters are always the country code, and the last 3 relate to the number of pieces. The value in the middle may vary in length, and may be a combination of letters and numbers in no particular order.</p> <p>A <code>List&lt;T&gt;</code> has already been declared in the main application, you can assume it is accessible from both the class and the method.</p> <pre><code>List&lt;StockItems&gt; stockList = new List&lt;StockItems&gt;(); </code></pre> <p>Write code that would replace the comments in the method and the class below to ensure that the list gets populated.</p> <pre><code>Private void AddStockItemToList(string barcode) { //ToDo Parse the string and add the items to the list. } public class StockItems { public int Quantity; public string OriginCountryCode; public string StockItemReference public Items(int qty, string country, string reference) { // } } </code></pre>
<c#>
2019-08-01 18:01:44
LQ_CLOSE
57,314,857
C++ Logging or a logger class that will print the log message with a custom prefix
I have a C++ project that has multiple classes. I want to streamline my logging process so that I can create some custom ostream object 'log' so that wherever I want to print a log message, I can write "log << my-message". The catch is that each of my class has a name (stored as a string) and I want the ostream object to prefix the name of the class before the log message. So the output would look like name-of-class: my-message How can I do this in C++? I tried create a Logger class with a name variable, and then instantiating an object of that class in each of my classes, which will then set the class' name as the Logger object's name. But this approach cannot scale because once I concatenate multiple log messages, the name gets printed each time. I also tried using variadic templates/functions, but then I wasn't able to pass in arguments such as std::hex, std::endl etc.
<c++>
2019-08-01 18:17:34
LQ_EDIT
57,317,218
Why can't I get return value in Python?
<p>I can't get return value in this function:</p> <pre><code>def test_1(): ques = input("Give name: ") if ques == "Kim": return "One" elif ques !="Kim": print ("two") test_1() </code></pre> <p>When I type "Kim" i get only [Program finished] and when i type something else i get "two" as expected. Why typing "Kim" doesn't give "One"?</p>
<python><return>
2019-08-01 21:29:55
LQ_CLOSE
57,317,261
how can i access a variable of type stringbuilder from another class?
<p>im new to c# and still learning, im not sure if i was correct to put this inside a struct, i want to access automotivedevice in another class to print out its information. How do i do this? </p> <p>ive tried changing it from a struct to a class, i also made sure to instance the struct in the other class</p> <pre><code>``` struct car { public void StringBuilder() { StringBuilder automotivedevice = new StringBuilder(); Console.WriteLine("enter brand of the car"); StringBuilder CarBrand = automotivedevice.AppendLine(Console.ReadLine()); Console.WriteLine("enter mileage of the car"); StringBuilder CarMileage = automotivedevice.AppendLine(Console.ReadLine()); Console.WriteLine("enter number of cylinders in the car"); StringBuilder NumberOfCylinders = automotivedevice.AppendLine(Console.ReadLine()); } }``` </code></pre>
<c#><struct><stringbuilder>
2019-08-01 21:34:14
LQ_CLOSE
57,317,397
How to add a wordpress post title to url?
<p>I need to add a post title to the url, each word separated by a dash "-"</p> <p>example: <a href="https://example.com/url.php?s=" rel="nofollow noreferrer">https://example.com/url.php?s=</a></p> <p>add title: <a href="https://example.com/url.php?s=Hello-World" rel="nofollow noreferrer">https://example.com/url.php?s=Hello-World</a></p> <p>(Sample title of the post: "Hello World!")</p> <p>Is it possible? Can someone do this</p>
<javascript><php><wordpress>
2019-08-01 21:49:19
LQ_CLOSE
57,317,918
Landing Page Redirect Based on Location Choice (Cookies?)
<p>Before someone gets upset that I haven't included code, please understand that it is because I am not sure what the best practice would be.</p> <p>I have a site that operates in 3 cities specifically, and also a nation-wide version. This is an eCommerce site that has different subdomains (essentially 3 different sites, but the ability to manage products specifically based on location.)</p> <p>What I need is for the user to select their city or location preference (say New York, Chicago, Detroit or Entire US) and have that information stored so that the next time they return they don't have to reselect their preferred location.</p> <p>Of course, for UX purposes the ability to change location is available in a Top Nav menu bar should they temporarily be in the other city.</p> <p>Can IPs be targeted accurately to exact city? Should this be automated or should they be able to choose?</p> <p>My question is : What is the best practice for this? Are there any consequences to this setup? What should be used? JavaScript? JQuery? PHP?</p> <p>If there are no major negatives, where should I start to implement this?</p>
<javascript><php><jquery><cookies><location>
2019-08-01 22:50:35
LQ_CLOSE
57,318,289
Can anyone show me what I am doing wrong here please?
I am trying to scrape tweets from twitter for a side project. Having difficulty with outputs. Using latest version of pycharm. import urllib import urllib.request from bs4 import BeautifulSoup theurl = "https://twitter.com/search?q=ghana%20and%20jollof&src=typed_query" thepage = urllib.request.urlopen(theurl) soup = BeautifulSoup(thepage, "html.parser") i = 1 for tweets in soup.findAll('div', {"class":"css-901oao css-16my406 r-1qd0xha r-ad9z0x r-bcqeeo r-qvutc0"}): print (i) print (tweets.find('span').text) i = i+1 print(tweets) I do not receive any errors at all but there no outputs for the tweets.
<python><web-scraping><twitter><sentiment-analysis>
2019-08-01 23:44:47
LQ_EDIT
57,320,407
I need a formula so that when the screen resolution decreases, objects go to the left
[![enter image description here][1]][1] [1]: https://i.stack.imgur.com/mnl8M.png I have a menu with links and when I decrease the screen resolution, the last buttons shrink, and I need to move all the objects to the left when reducing the screen size
<html><css><media-queries>
2019-08-02 05:27:00
LQ_EDIT
57,321,212
array multidimensionnelle angular
Helle guys, I work on the application under angular, and I would like to display data from a table like this: http://prntscr.com/onbcqb Example of an array ``` [ { "Noms": "Boizard Clement ", "Enfants": null, "FP": true, "Adresse": null, "Brunch": "Oui", "OK": "Oui", "OK enfant": null, "KO": null, "Attente": null, "mail cadeau": null, "Remerciements": null, "Sexe": "Homme" }, { "Noms": "Camille Giroud ", "Enfants": null, "FP": true, "Adresse": null, "Brunch": "Oui", "OK": "Oui", "OK enfant": null, "KO": null, "Attente": null, "mail cadeau": null, "Remerciements": null, "Sexe": "Femme" } ]; ```
<angular><multidimensional-array>
2019-08-02 06:44:20
LQ_EDIT
57,322,276
How to use lotusscript button in web browser?
<p>I have a save button in my lotus notes. My save button will execute some process in lotusscript. I will explain what document related to my save process.</p> <p>Now I have a document from main view with status "Active", I called it "current" document.</p> <ol> <li>First I create copy for all current document with status "Draft" and I called it as "Copy" document.</li> <li>Second I create "Inspection" document for all copy documents with status "Incomplete" and use all data from copy document with "Computed for display". So my "Copy" is used for all editing while "Inspection" is a Report of document only. It means, changes made in copy documents, when click save, Report will also updated with latest information.</li> </ol> <p>So the process will start edit copy document and save it. Copy document status will change from "Draft" to "Active", and current document will change from "Active" to "Inactive". That means, Copy document will be new current document. Then, Inspection Report status will change to "Complete".</p> <p>Below is my lotusscript button code:</p> <pre><code>Set db = session.CurrentDatabase Set uidoc = workspace.CurrentDocument Set doc = uidoc.Document '//Set lookup view for current document keys(0) = doc.PTagNo(0) keys(1) = "Lock" Set view = db.GetView("TagNo") '//Set lookup view for "Inspection" document pckeys(0) = doc.PTagNo(0) pckeys(1) = doc.PBatchNo(0) pckeys(2) = "Incomplete" Set pcview = db.GetView("BatchPCInspection") answer% = Messagebox("Save PC Inspection?", 4,"Confirmation") If Not answer% = 6 Then Exit Sub Else '//Make changes for "Inspection" document Set comdoc = pcview.GetDocumentByKey(pckeys, True) If Not comdoc Is Nothing Then If comdoc.AStatus(0) = "Incomplete" Then comdoc.DocId=doc.UniversalID comdoc.ATagNo = doc.PTagNo comdoc.ADept= doc.PDept comdoc.AUserName= doc.PUserName comdoc.AStatus="Complete" Call comdoc.Save(True, False) End If End If '//Make changes for current document become Inactive Set activeDoc = view.GetDocumentByKey(keys, True) If Not activeDoc Is Nothing Then If activeDoc.PStatus(0) = "Lock" Then activeDoc.DocumetId = doc.UniversalID activeDoc.PStatus = "Inactive" Call activeDoc.Save(True, False) End If End If '//Make changes for "Copy" document become Active Call uidoc.FieldSetText("PStatus" , "Active") Call uidoc.FieldSetText("SaveOptions" , "1") Call uidoc.Save Call uidoc.Close End If End Sub </code></pre> <p>So my question now, how can I convert this lotusscript code to javascript code? Because lotusscript will not run in web browser, so I surely need to convert this to javascript. Anyone know any documentation or way on how to convert this lotusscript button to javascript button. Any help will be appreciated! Thanks in advanced!</p>
<javascript><lotus-notes><lotusscript>
2019-08-02 08:06:33
LQ_CLOSE
57,322,954
background-color in css is not working when navigating from one form to another
<p>When I try to navigate from one form to another form, background-color in css is not working.</p> <p>login_form_success.php</p> <pre><code>&lt;div class="alert alert-success"&gt;Welcome &lt;?php echo $_SESSION['uname']; ?&gt;Signed in !&lt;/div&gt; </code></pre> <p>style.css</p> <pre><code>.alert alert-success{ background-color: greenyellow; } </code></pre>
<php><css>
2019-08-02 08:49:49
LQ_CLOSE
57,325,765
Some example of Junit of Rest Api
I wanna to try some example of junit with rest api, i m a beginner of j unit and i don t know how to start nothing to test My Repository: @Repository public interface ClienteRepository extends JpaRepository<ClienteEntity, Integer>{ ClienteEntity findByEmail(@Param("email") String email); @Query(value = "SELECT u FROM ClienteEntity u where u.email = ?1 and u.password = ?2 ") Optional<ClienteEntity> login(String email,String password); Optional<ClienteEntity> findByToken(String token); @Query(value = "SELECT c " + "FROM ClienteEntity c " + "WHERE c.id = :id ") ClienteEntity getClienteById(@Param("id")Integer id); } Had an entity "cliente" with these fields: @Id @GeneratedValue(strategy=GenerationType.AUTO) //Vedere UUID bene private Integer id; private String nome; private String cognome; @Column(name = "email", unique = true) private String email ; private String password; private String citta; private String cap; private String indirizzo; private String token; public String getToken() { return token; } with their set and get methods i wanna for example test a "cliente" means "user" by email and wanna test on fields instead my db
<java><spring><rest><junit>
2019-08-02 11:38:01
LQ_EDIT
57,326,471
Why does C++ allow nested namespace with same name?
<p>Codes bellowing compiles:</p> <pre><code>namespace x { namespace y { namespace x { struct C { C () { std::cout &lt;&lt; "x::y::z::C" &lt;&lt; std::endl; } }; } } struct C { C () { std::cout &lt;&lt; "x::C" &lt;&lt; std::endl; } }; } </code></pre> <p><code>x::C</code> and <code>x::y::x::C</code> are not same, but it's sometimes confusing.</p> <p>Why is <code>x::y::x</code> allowed in C++? Isn't it more clear to forbid this?</p>
<c++><namespaces>
2019-08-02 12:24:27
LQ_CLOSE
57,326,732
Infowindow on mouseclick only works for one marker
I have a map with 5 markers and I need an infoWindow for each marker on mouseclick, I have one infoWindow that works. However when I add code/data for another infoWindow for another marker, it doesn't work (i.e. I click on the marker for Edinburgh and a bubble displays but the chart doesn't display and nothing displays at all when I click on the Inverness marker). LINK TO JSFIDDLE FILE: https://jsfiddle.net/MarnieMaclean/megx2cbo/30/ Code Snippet: I currently have data for an InfoWindow for 2/5 markers. google.charts.load('current', {packages: ['corechart']}); function drawChart(map, marker) { //set up data var data = google.visualization.arrayToDataTable([ ['Genre', '#'], ['Science Fiction', 55], ['Comedy', 33], ['Thriller', 21], ['Action', 63], ['Romance', 17], ]); //set up any options var options = { title: 'Film Genre Preferences' }; //Create node var node = document.createElement('div'), infoWindow = new google.maps.InfoWindow(), chart = new google.visualization.BarChart(node); //chjjeck which marker it is if (marker.id == 'c4') { chart.draw(data, options); } infoWindow.setContent(node); infoWindow.open(map,marker); } google.charts.load('current', {packages: ['corechart']}); function drawChart(map, marker) { //set up data var data = google.visualization.arrayToDataTable([ ['Genre', '#'], ['Science Fiction', 41], ['Comedy', 27], ['Thriller', 13], ['Action', 15], ['Romance', 19], ]); //set up any options var options = { title: 'Film Genre Preferences' }; //Create node var node = document.createElement('div'), infoWindow = new google.maps.InfoWindow(), chart = new google.visualization.BarChart(node); //chjjeck which marker it is if (marker.id == 'c1') { chart.draw(data, options); } infoWindow.setContent(node); infoWindow.open(map,marker); } // Initialize and add the map function initMap() { //The location of Inverness var inverness = {lat: 57.480819, lng: -4.224250}; var city1 = {position: inverness}; // The map, centered at Inverness var map = new google.maps.Map( document.getElementById('map'), {zoom: 4, center: inverness}); // The marker positioned at Inverness var marker1 = new google.maps.Marker({position: inverness, map: map, id: 'c1', title: 'Number Of Cinemas: 2'}); //The location of Dundee var dundee = {lat: 56.467546, lng: -2.969593}; var city2 = {position: dundee}; // The marker, positioned at Dundee var marker2 = new google.maps.Marker({position: dundee, map: map, id: 'c2', title: 'Number Of Cinemas: 2'}); //The location of Glasgow var glasgow = {lat: 55.875362, lng: -4.250252}; var city3 = {position: glasgow}; // The marker, positioned at Glasgow var marker3 = new google.maps.Marker({position: glasgow, map: map, id: 'c3', title: 'Number Of Cinemas: 11'}); //The location of Edinburgh var edinburgh = {lat: 55.959425, lng: -3.189161}; var city4 = {position: edinburgh}; // The marker, positioned at Edinburgh var marker4 = new google.maps.Marker({position: edinburgh, map: map, id: 'c4', title: 'Number Of Cinemas: 3'}); //The location of Aberdeen var aberdeen = {lat: 57.155988, lng: -2.095139}; var city5 = {position: aberdeen}; // The marker, positioned at Aberdeen var marker5 = new google.maps.Marker({position: aberdeen, map: map, id: 'c5', title: 'Number Of Cinemas: 3'}); marker4.addListener('click', function() { drawChart(map,this); }); } [Proof of infoWindow working for one marker][1] [What happens after I've added code for a 2nd infoWindow][2] [Click on marker, no infoWindow][3] [1]: https://i.stack.imgur.com/38taB.png [2]: https://i.stack.imgur.com/TmS3G.png [3]: https://i.stack.imgur.com/vRf8q.png
<javascript><google-maps><charts><jsfiddle><infowindow>
2019-08-02 12:43:07
LQ_EDIT
57,327,622
Value of optional type must be unwrapped to a value of type
<p>I'm trying to have a sceneView load a scene but I get the error <em>Value of optional type 'SCNScene?' must be unwrapped to a value of type 'SCNScene'</em> With options of <em>Coalesce using '??' to provide a default when the optional value contains 'nil'</em> or <em>Force-unwrap using '!' to abort execution if the optional value contains 'nil'</em></p> <pre class="lang-swift prettyprint-override"><code>override func viewDidLoad() { super.viewDidLoad() sceneView.scene = SCNScene(named: "Models.scnassets/CDMTEST1"); VirtualObject.readCoreData() } </code></pre> <p>Error message : <em>Value of optional type 'SCNScene?' must be unwrapped to a value of type 'SCNScene'</em> <em>Coalesce using '??' to provide a default when the optional value contains 'nil'</em> <em>Force-unwrap using '!' to abort execution if the optional value contains 'nil'</em></p>
<ios><swift><xcode>
2019-08-02 13:36:19
LQ_CLOSE
57,327,688
Appending bullet point sentences to main sentence using python
<p>I have a paragraph which is like in the following format, </p> <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry; (a) It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages; and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum. (b) Contrary to popular belief; Lorem Ipsum is not simply random text.</p> <p>so for this I need to collect the bullet point (a) and (b) and append it to the main section like bellow, Lorem Ipsum is simply dummy text of the printing and typesetting industry. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages; and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p> <p>and </p> <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry Contrary to popular belief; Lorem Ipsum is not simply random text.</p> <p>Note: ; can be :, :- and (a) can be (i) or any type of bullet point.</p>
<python><regex><spacy>
2019-08-02 13:40:22
LQ_CLOSE
57,330,628
Sorting of object of objects property not working in Angular 7
I am trying to sort and object of an object based on a property field in angular 7 application. I have implemented the sort function but the sort doesn't seem applying. So I basically need to sort LegalFundClassCommercialViewModel on property name RedsFrqncyName. Following is the code that i have tried if(this.LegalFundClasses.AllTerms) { this.LegalFundClasses.AllTerms.LegalFundClassCommercialViewModel = this.LegalFundClasses.AllTerms.sort(function(a, b) { return a.LegalFundClassCommercialViewModel.RedsFrqncyName - b.LegalFundClassCommercialViewModel.RedsFrqncyName; }); The values of the property are Daily Weekly Semi-Monthly Monthly Quarterly Semi-Annually Yearly Illiquid Anniversary 2nd Anniversary 3rd Anniversary 4th Anniversary 5th Anniversary JSON [{"LegalFundClassCommercialViewModel":{"Description":"Class A (Soft Closed)","AuditSummary":"kweigand Jul 30, 2019","FeesReviewSummary":"kweigand Jul 30, 2019","TermsReviewSummary":"dmukerji Nov 29, 2018","ChildRecordExist":true,"Id":10651,"FundId":3640,"FundName":"Cevian Capital II Ltd.","FundClassType":1,"CurrencyId":3,"PrimaryCurrencyName":"EUR","OtherCurrencyIds":[{"Id":2,"Name":"Test"}],"OtherCurrencyNames":["USD"],"ManagerStrategyId":null,"ManagerStrategyName":null,"SubVotingId":2,"SubVotingName":"Yes","SubHotIssueId":4,"SubHotIssueName":"No Capital","RedsFrqncyId":11,"RedsFrqncyName":"3rd Anniversary","RedsNoticeDays":90,"NoticeTypeOfDaysId":2,"NoticeTypeOfDaysName":"Calendar","RedemptionComments":null,"LockupTypeId":1,"LockupTypeName":"Rolling","HardDurationMonthsId":null,"HardDurationMonthsName":null,"SoftDurationMonthsId":8,"SoftDurationMonthsName":"36","LockupFees0To12Pct":0,"LockupFees12To24Pct":0,"LockupFees24To36Pct":0,"WebfolioRedsFee":null,"LockupComments":"Following the expiration of the initial Class A Shares lockup, absent a redemption or exchange of such Class A Shares, such Shares will be subject to a new Class A Shares lock-up which will immediately commence on a rolling basis, in each case ending on the redemption day falling in the month of the three-year anniversary of the commencement of such Class A Shares lock up. Class A Shares may be redeemed on the first redemption days falling on the expiration of each New Class A shares lock up without being subject to a redemption fee. Special Redemption Rights where shareholder is permitted to redeem up to 5% of their holding of Shares. See key fund disclosures. * Investors can redeem upto 5% of their holding at the first anniversary date and thereafter an additional 5% on one of the four redemption dates falling on- January, April, July or October during each 12 month period (i.e year 2 and year 3 of investment). No redemption penalties are applicable. ","ApplyGateDecliningBalance":false,"GateInvestorPct":0,"GateSourceId":1,"GateSourceName":"Fund Gate","GateFundClassPct":50,"IntialProceeds":95,"PaymentInDays":14,"PaymentTypeOfDaysId":1,"PaymentTypeOfDaysName":"Business","HoldbackPercentage":5,"HoldbackPayment":30,"HoldbackTypeOfDaysId":2,"HoldbackTypeOfDaysName":"Calendar","ManagementFeeRate":1.5,"IncentiveFeeRate":18,"RealizationFrequencyId":22,"RealizationFrequencyName":"Every third anniversary","HighWaterMarkId":1,"HighWaterMarkName":"Standard","HurdleRate":false,"HurdleRateBasisId":null,"HurdleRateBasisName":null,"HurdleRatePct":null,"HurdleRateIndexId":null,"HurdleRateIndexName":null,"PreferredReturnRatePct":null,"GpCatchUp":null,"PrefferedReturnComments":null,"Clawback":false,"ClawbackPercentage":null,"AssetFeeDiscountTypeId":null,"AssetFeeDiscountTypeName":null,"FeeComments":"The incentive fee is payable at the end of the investor lock-up period. \n","FeeReductionsNegotiated":null,"InvestmentStatusId":1,"LegalParentClassId":null},"LegalFundClassSideLetterViewModel":null},{"LegalFundClassCommercialViewModel":{"Description":"Class B (Soft-Closed)","AuditSummary":"kweigand Jul 30, 2019","FeesReviewSummary":"kweigand Jul 30, 2019","TermsReviewSummary":"dmukerji Nov 29, 2018","ChildRecordExist":true,"Id":10656,"FundId":3640,"FundName":"Cevian Capital II Ltd.","FundClassType":1,"CurrencyId":3,"PrimaryCurrencyName":"EUR","OtherCurrencyIds":[{"Id":2,"Name":"Test"}],"OtherCurrencyNames":["USD"],"ManagerStrategyId":null,"ManagerStrategyName":null,"SubVotingId":2,"SubVotingName":"Yes","SubHotIssueId":4,"SubHotIssueName":"No Capital","RedsFrqncyId":10,"RedsFrqncyName":"2nd Anniversary","RedsNoticeDays":90,"NoticeTypeOfDaysId":2,"NoticeTypeOfDaysName":"Calendar","RedemptionComments":null,"LockupTypeId":1,"LockupTypeName":"Rolling","HardDurationMonthsId":null,"HardDurationMonthsName":null,"SoftDurationMonthsId":7,"SoftDurationMonthsName":"24","LockupFees0To12Pct":0,"LockupFees12To24Pct":0,"LockupFees24To36Pct":4,"WebfolioRedsFee":null,"LockupComments":"Class B Shares may first be redeemed on redemption day falling in the month of the two-year anniversary of the issue of Class B Shares. In the event that a shareholder requests redemption of Class B Shares on the first redemption day falling on the expiration of the initial Class B Shares, the Fund will charge a redemption fee of 4.00% of the redemption proceeds. Following the expiration of Class B lock-up, absent a redemption or exchange of such Class B Shares, such Shares will be subject to a new Class B lock up which will immediately commence on a rolling basis, in each case ending on the redemption day falling in the month of the two year anniversary of the commencement of such Class B lock-up. Class B may be redeemed on the redemption day failing on the expiration of each New Class B lock-up without being subject to a redemption fee. Special Redemption Rights where shareholder is permitted to redeem up to 5% of their holding of Shares. See key fund disclosures. ","ApplyGateDecliningBalance":false,"GateInvestorPct":0,"GateSourceId":1,"GateSourceName":"Fund Gate","GateFundClassPct":50,"IntialProceeds":95,"PaymentInDays":14,"PaymentTypeOfDaysId":1,"PaymentTypeOfDaysName":"Business","HoldbackPercentage":5,"HoldbackPayment":30,"HoldbackTypeOfDaysId":2,"HoldbackTypeOfDaysName":"Calendar","ManagementFeeRate":1.75,"IncentiveFeeRate":20,"RealizationFrequencyId":21,"RealizationFrequencyName":"Every second anniversary ","HighWaterMarkId":1,"HighWaterMarkName":"Standard","HurdleRate":false,"HurdleRateBasisId":null,"HurdleRateBasisName":null,"HurdleRatePct":null,"HurdleRateIndexId":null,"HurdleRateIndexName":null,"PreferredReturnRatePct":null,"GpCatchUp":null,"PrefferedReturnComments":null,"Clawback":false,"ClawbackPercentage":null,"AssetFeeDiscountTypeId":null,"AssetFeeDiscountTypeName":null,"FeeComments":"The incentive fee is payable at the end of the investor lock-up period. \n","FeeReductionsNegotiated":null,"InvestmentStatusId":1,"LegalParentClassId":null},"LegalFundClassSideLetterViewModel":null},{"LegalFundClassCommercialViewModel":{"Description":"Class C (Soft Closed)","AuditSummary":"kweigand Jul 30, 2019","FeesReviewSummary":"kweigand Jul 30, 2019","TermsReviewSummary":"","ChildRecordExist":true,"Id":10658,"FundId":3640,"FundName":"Cevian Capital II Ltd.","FundClassType":1,"CurrencyId":3,"PrimaryCurrencyName":"EUR","OtherCurrencyIds":[{"Id":2,"Name":"Test"}],"OtherCurrencyNames":["USD"],"ManagerStrategyId":null,"ManagerStrategyName":null,"SubVotingId":2,"SubVotingName":"Yes","SubHotIssueId":4,"SubHotIssueName":"No Capital","RedsFrqncyId":9,"RedsFrqncyName":"Anniversary","RedsNoticeDays":90,"NoticeTypeOfDaysId":2,"NoticeTypeOfDaysName":"Calendar","RedemptionComments":null,"LockupTypeId":1,"LockupTypeName":"Rolling","HardDurationMonthsId":null,"HardDurationMonthsName":null,"SoftDurationMonthsId":5,"SoftDurationMonthsName":"12","LockupFees0To12Pct":6,"LockupFees12To24Pct":4,"LockupFees24To36Pct":null,"WebfolioRedsFee":"12 M,0.06|24 M,0.04|","LockupComments":"Class C Shares may first be redeemed on the redemption day falling in the month of the one-year anniversary of the issue of such shares. In the event the shareholder requests redemption of Class C Shares falling on the expiration of the initial Class C lock-up, the Fund will charge a redemption fee of 6% of the redemption proceeds. Following the expiration of the initial Class C lock-up, absent a redemption or exchange of such Class C Shares, such shares will be subject to a new Class C lock-up which will immediately commence on a rolling basis, in each case ending on the redemption day falling in the month of the anniversary of the commencement of such Class C lock-up. If Class C Shares are redeemed on the redemption day falling on the expiration of the first new Class C lock-up, the Fund will charge a redemption fee of 4% of the redemption proceeds. If Class C Shares are redeemed on the first redemption day falling on the expiration of the second new Class C Shares lock-up or any subsequent new Class C lock-up such Shares may be redeemed without a redemption fee. Special Redemption Rights where shareholder is permitted to redeem up to 5% of their holding of Shares. See key fund disclosures. ","ApplyGateDecliningBalance":false,"GateInvestorPct":0,"GateSourceId":1,"GateSourceName":"Fund Gate","GateFundClassPct":50,"IntialProceeds":95,"PaymentInDays":14,"PaymentTypeOfDaysId":1,"PaymentTypeOfDaysName":"Business","HoldbackPercentage":5,"HoldbackPayment":30,"HoldbackTypeOfDaysId":2,"HoldbackTypeOfDaysName":"Calendar","ManagementFeeRate":2,"IncentiveFeeRate":22,"RealizationFrequencyId":7,"RealizationFrequencyName":"Yearly","HighWaterMarkId":1,"HighWaterMarkName":"Standard","HurdleRate":false,"HurdleRateBasisId":null,"HurdleRateBasisName":null,"HurdleRatePct":null,"HurdleRateIndexId":null,"HurdleRateIndexName":null,"PreferredReturnRatePct":null,"GpCatchUp":null,"PrefferedReturnComments":null,"Clawback":false,"ClawbackPercentage":null,"AssetFeeDiscountTypeId":null,"AssetFeeDiscountTypeName":null,"FeeComments":"The incentive fee is payable at the end of the investor lock-up.","FeeReductionsNegotiated":null,"InvestmentStatusId":1,"LegalParentClassId":null},"LegalFundClassSideLetterViewModel":null},{"LegalFundClassCommercialViewModel":{"Description":"Class C Interests (Soft Closed)","AuditSummary":"kweigand Jul 30, 2019","FeesReviewSummary":"kweigand Jul 30, 2019","TermsReviewSummary":"dmukerji Nov 29, 2018","ChildRecordExist":true,"Id":11812,"FundId":7069,"FundName":"Cevian Capital II LP","FundClassType":1,"CurrencyId":2,"PrimaryCurrencyName":"USD","OtherCurrencyIds":[{"Id":3,"Name":"Test"}],"OtherCurrencyNames":["EUR"],"ManagerStrategyId":null,"ManagerStrategyName":null,"SubVotingId":3,"SubVotingName":"No","SubHotIssueId":2,"SubHotIssueName":"Investor Discretion","RedsFrqncyId":9,"RedsFrqncyName":"Anniversary","RedsNoticeDays":90,"NoticeTypeOfDaysId":2,"NoticeTypeOfDaysName":"Calendar","RedemptionComments":null,"LockupTypeId":1,"LockupTypeName":"Rolling","HardDurationMonthsId":null,"HardDurationMonthsName":null,"SoftDurationMonthsId":5,"SoftDurationMonthsName":"12","LockupFees0To12Pct":6,"LockupFees12To24Pct":4,"LockupFees24To36Pct":null,"WebfolioRedsFee":"12 M,0.06|24 M,0.04|","LockupComments":"In the event that a Limited Partner requests withdrawal of a Class C Capital Account on the Withdrawal Date falling on the expiration of the Initial Class C Lock-Up, the Partnership will retain an amount equal to 6 per cent of the withdrawal proceeds. Following the expiry of the Initial Class C Lock-Up, absent a withdrawal or exchange of such Class C Capital Account, such Class C Capital Account will be subject to a new Class C Lock-Up which will immediately commence on a rolling basis ending on the Withdrawal Date falling in the month of the anniversary of the commencement of such Initial Class C Lock-Up (each, a \"New Class C Lock-Up\"). If a Class C Capital Account is withdrawn on the Withdrawal Date falling on the expiration of the first New Class C Lock-Up, the Partnership will retain an amount equal to 4 per cent of the withdrawal proceeds. If a Class C Capital Account is withdrawn on the Withdrawal Date falling on the expiration of the second New Class C Lock-Up or any subsequent New Class C Lock-Up, such Capital Account may be withdrawn without being subject to a withdrawal charge.","ApplyGateDecliningBalance":false,"GateInvestorPct":0,"GateSourceId":1,"GateSourceName":"Fund Gate","GateFundClassPct":50,"IntialProceeds":95,"PaymentInDays":14,"PaymentTypeOfDaysId":1,"PaymentTypeOfDaysName":"Business","HoldbackPercentage":5,"HoldbackPayment":30,"HoldbackTypeOfDaysId":2,"HoldbackTypeOfDaysName":"Calendar","ManagementFeeRate":2,"IncentiveFeeRate":22,"RealizationFrequencyId":7,"RealizationFrequencyName":"Yearly","HighWaterMarkId":1,"HighWaterMarkName":"Standard","HurdleRate":false,"HurdleRateBasisId":null,"HurdleRateBasisName":null,"HurdleRatePct":null,"HurdleRateIndexId":null,"HurdleRateIndexName":null,"PreferredReturnRatePct":null,"GpCatchUp":null,"PrefferedReturnComments":null,"Clawback":false,"ClawbackPercentage":null,"AssetFeeDiscountTypeId":null,"AssetFeeDiscountTypeName":null,"FeeComments":"The incentive fee is payable at the end of the investor lock-up period. \n","FeeReductionsNegotiated":null,"InvestmentStatusId":1,"LegalParentClassId":null},"LegalFundClassSideLetterViewModel":null},{"LegalFundClassCommercialViewModel":{"Description":"Class A Interests (Soft Closed)","AuditSummary":"kweigand Jul 30, 2019","FeesReviewSummary":"kweigand Jul 30, 2019","TermsReviewSummary":"dmukerji Nov 29, 2018","ChildRecordExist":true,"Id":11815,"FundId":7069,"FundName":"Cevian Capital II LP","FundClassType":1,"CurrencyId":2,"PrimaryCurrencyName":"USD","OtherCurrencyIds":[{"Id":3,"Name":"Test"}],"OtherCurrencyNames":["EUR"],"ManagerStrategyId":null,"ManagerStrategyName":null,"SubVotingId":3,"SubVotingName":"No","SubHotIssueId":2,"SubHotIssueName":"Investor Discretion","RedsFrqncyId":11,"RedsFrqncyName":"3rd Anniversary","RedsNoticeDays":90,"NoticeTypeOfDaysId":2,"NoticeTypeOfDaysName":"Calendar","RedemptionComments":null,"LockupTypeId":1,"LockupTypeName":"Rolling","HardDurationMonthsId":null,"HardDurationMonthsName":null,"SoftDurationMonthsId":8,"SoftDurationMonthsName":"36","LockupFees0To12Pct":0,"LockupFees12To24Pct":0,"LockupFees24To36Pct":0,"WebfolioRedsFee":null,"LockupComments":" Following the expiration of the initial Class A Shares lockup, absent a redemption or exchange of such Class A Shares, such Shares will be subject to a new Class A Shares lock-up which will immediately commence on a rolling basis, in each case ending on the redemption day falling in the month of the three-year anniversary of the commencement of such Class A Shares lock up. Class A Shares may be redeemed on the first redemption days falling on the expiration of each New Class A shares lock up without being subject to a redemption fee. Special Redemption Rights where shareholder is permitted to redeem up to 5% of their holding of Shares. See key fund disclosures. * Investors can redeem upto 5% of their holding at the first anniversary date and thereafter an additional 5% on one of the four redemption dates falling on- January, April, July or October during each 12 month period (i.e year 2 and year 3 of investment). No redemption penalties are applicable. ","ApplyGateDecliningBalance":false,"GateInvestorPct":0,"GateSourceId":1,"GateSourceName":"Fund Gate","GateFundClassPct":50,"IntialProceeds":100,"PaymentInDays":14,"PaymentTypeOfDaysId":1,"PaymentTypeOfDaysName":"Business","HoldbackPercentage":5,"HoldbackPayment":30,"HoldbackTypeOfDaysId":2,"HoldbackTypeOfDaysName":"Calendar","ManagementFeeRate":1.5,"IncentiveFeeRate":18,"RealizationFrequencyId":22,"RealizationFrequencyName":"Every third anniversary","HighWaterMarkId":1,"HighWaterMarkName":"Standard","HurdleRate":false,"HurdleRateBasisId":null,"HurdleRateBasisName":null,"HurdleRatePct":null,"HurdleRateIndexId":null,"HurdleRateIndexName":null,"PreferredReturnRatePct":null,"GpCatchUp":null,"PrefferedReturnComments":null,"Clawback":false,"ClawbackPercentage":null,"AssetFeeDiscountTypeId":null,"AssetFeeDiscountTypeName":null,"FeeComments":"The incentive fee is payable at the end of the investor lock-up period. \n","FeeReductionsNegotiated":null,"InvestmentStatusId":1,"LegalParentClassId":null},"LegalFundClassSideLetterViewModel":null}]
<javascript><angular>
2019-08-02 16:46:53
LQ_EDIT
57,330,811
How are variables in Java called that are set once but never again and are not final?
<p>I have several variables I need to set only once but never again after starting the application, such as SCREEN_WIDTH, ARRAY_X_LENGTH, TIME_APP_STARTED etc.</p> <p>I do not declare these final because the software will decide what value to assign to them, not me manually. I capitalize the words though so that I can see that no other code will assign any value to it, only 1.</p> <p>Is this a bad programming practice, and if yes, what should I do, I usually just have a file containing all these ''final'' variables and my flags, I do not like storing them locally.</p>
<java>
2019-08-02 17:03:43
LQ_CLOSE
57,330,828
Prevent an exception when I cancel an openfiledialog?
<p>I am having a problem when I click cancel on an openfiledialog in c#, it throws an exception. This is my code:</p> <p>I tried to look at some other Stackoverflow solutions but none of them work. Here is a example:</p> <pre><code>private void BtnCargarImagen_Click(object sender, EventArgs e) { //OFD = openfiledialog OFD.ShowDialog(); PicFotografia.Image = Image.FromFile(OFD.FileName); MessageBox.Show("LA IMAGAN HA SIDO CARGADA"); DialogResult result; if (result == DialogResult.OK) { return OFD.FileName; } return null; </code></pre> <p>When the "if" part is placed on the code, it marks error on both "returns". </p> <p>Without the dialog result part from top to bottom when I click on cancel, it marks an exception.</p> <pre><code>private void BtnCargarImagen_Click(object sender, EventArgs e) { //OFD = openfiledialog OFD.ShowDialog(); PicFotografia.Image = Image.FromFile(OFD.FileName); MessageBox.Show("LA IMAGAN HA SIDO CARGADA"); } </code></pre> <p>Thanks in advance.</p>
<c#>
2019-08-02 17:05:38
LQ_CLOSE
57,330,978
How can i check so that the letters in the beginning are three specific letters?
<p>My problem is that i need something that can check if an string got Three specific letters in the beginning. How would you guys do this?</p>
<python>
2019-08-02 17:19:00
LQ_CLOSE
57,330,987
How can i use For Loop initialize value start depend by the condition
[enter image description here][1] For Loop k initialize value assign if char[i] = ' ' get space then K value is assign i -1 ,Otherwise k value is start k = i value, my first condition is work if char of array get space, But when not get space k value is not assign k = i value always my first condition work k = i-1, for(k = (Char[i] ==' '? i-1 :i); j<k ; j++,k--)[enter image description here][1] [1]: https://i.stack.imgur.com/dDdiQ.png
<c>
2019-08-02 17:19:35
LQ_EDIT
57,331,024
my program runs fine and i am able copy the object however when i used the copy assignment (=) it still runs fine .why is it not giving error?
this is my code.i didnt overload the (=) operator but still it runs fine in codeblocks.however when i ran this code on c++ shell it compiled succesfully however the output was blank .can somebody please explain me that why is it running fine in codeblocks even though i didnt write the code for the copy assignment . also another question... if in line 1 i change the return type to string instead of string& it displays an error (about temporary variable) but if i change the code of line 2 to dummy(dummy& abc : ptr(new string (abc.print())) the program runs fine (despite the return type of line 1 being string) why is it so? class dummy{ string *ptr; public: dummy(string ab) {ptr=new string; ptr=&ab;} ~dummy (){delete ptr;} string& print(){return *ptr;} //line1 dummy (dummy& abc){ptr= new string; ptr=&(abc.print());} //line2 dummy (){}; }; int main() { dummy x("manzar"); dummy y; y=x; cout<<x.print(); cout<<"\n"<<y.print (); } i didnt expected it to run fine however it is working fine.it is copying the content from x to y.
<c++><codeblocks>
2019-08-02 17:22:50
LQ_EDIT
57,331,238
This is only the beginning
Im new to python and I wanted to practice doing loops cause I’ve been having the most trouble with it. So I decided to make a game where the user will pick a number from 0-100 to see if they can win against the computer. Now what I have going right now is only the beginning. The code isn’t finished. But trying out the code I got a Syntax error where the arrow pointed at the colon on the elif function. How do I fix this? What can I do? I accept any other additional comments on my code to make it better. Here’s my code: import random min = 0 max = 100 roll_again = "yes" quit = "no" players_choice = input() computer = random.randint while roll_again == "yes": print("Pick a number between 1-100: ") print(players_choice) if players_choice >= 0: print("Your number of choice was: ") print(players_choice) print("Your number is high.") if computer >= 0: print("Computers number is: ") print(computer) print("Computers number is high.") if computer >= players_choice: print("Computer wins.") print("You lose.") print("Would you like to play again? ", +roll_again) elif: print(quit) end
<python>
2019-08-02 17:41:24
LQ_EDIT
57,331,280
What does the keyword 'TYPE' mean proceeding a parameter in procedure?
I am very new to SQL and tried searching for this online with no avail - I would appreciate any help! I am looking a procedure in Oracle SQL Developer that looks like something along the lines of this: PROCEDURE pProcedureOne (pDateOne DATE, pDateTwo tableA.DateTwo%TYPE, pDateThree tableB.DateThree%TYPE, pTypeOne tableC.TypeOne%TYPE, pTestId tableD.TestIdentifier%TYPE DEFAULT NULL, pShouldChange BOOLEAN DEFAULT FALSE) IS What does `'%TYPE'` keyword mean in this context?
<oracle><plsql>
2019-08-02 17:44:43
LQ_EDIT
57,331,451
How can ı use "stdafx.h" in c++?
<p>I have a problem about my c++ code. When ı write in my code include "stdafx.h" ı have errors. Why is the reason? I have 2 pics to better explain my problem. Can anyone help me ?</p> <p><a href="https://imgur.com/yfHsKD6" rel="nofollow noreferrer">https://imgur.com/yfHsKD6</a></p> <p><a href="https://imgur.com/T6Jd3pV" rel="nofollow noreferrer">https://imgur.com/T6Jd3pV</a></p> <p>There is my code:</p> <pre><code>#include &lt;iostream&gt; #include "stdafx.h" using namespace std; int main() { int x, y,toplam=0; cout &lt;&lt; "1. Sayiyi Giriniz:"; cin &gt;&gt; x; cout &lt;&lt; "2. Sayiyi Giriniz:"; cin &gt;&gt; y; toplam = x + y; cout &lt;&lt; "Sayilarin toplami:" &lt;&lt; toplam &lt;&lt; endl; system("PAUSE"); return 0; } </code></pre> <p>Error C1083 Unable to open include file: 'stdafx.h': No such file or directory </p> <p>Error (active) E1696 Source file "stdafx.h" cant open</p>
<c++><visual-c++>
2019-08-02 18:00:14
LQ_CLOSE
57,331,660
Javascript can't change html scr
<p>So im creating an automatic slide show, but for some reason, I can get js to change my img scr to the images in the array I have. </p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-js lang-js prettyprint-override"><code>&lt;script&gt; var i= 0; // starting image var images= []; //image array empty-array var time= 2000; //2 sec time interval //image list for image array images[0] = 'image_1.png'; //image array starting image images[1] = 'image_2.png'; images[2] = 'image_3.png'; //change image function function changeImg(){ document.getElementById("imagess").scr = images[i]; //changes image on html side if(i &lt; images.length-1){ //if var i is less then the length of the array add one, length -1 because array list start with 0 and ends with 2. i++; } else{ // if var is more the array length set it back to 0 to start the slide again i = 0; } setTimeout("changeImg()", time);// the amount of time before the function run if statment } window.onload = changeImg; //when sites loads run script &lt;/script&gt;</code></pre> <pre class="snippet-code-html lang-html prettyprint-override"><code> &lt;div class="image"&gt; &lt;!--main image --&gt; &lt;img id="imagess" src="#" alt="HAL Phone Icon" &gt; &lt;/div&gt; &lt;!--closing image --&gt;</code></pre> </div> </div> </p>
<javascript><html>
2019-08-02 18:18:31
LQ_CLOSE
57,332,877
How to relate two sql table
Hi I have two tables cars and owners . ownerno is the primary key in table owners. I would like to know how I can put ownerno as foreign key in cars table and still insert values that are different from my first table cars REGNO MAKE COLOUR PRICE OWNERNO KAA462J FORD RED 120000 824 KAB230Q SKODA BLUE 110000 828 KAV201W MERCEDES BLUE 220000 832 KAA306T TOYOTA BLUE 130000 836 Owners OWNERNO OWNERNAME OWNERADDRESS 724 Atieno Otieno 567 Umoja 828 Hassan Hussein 987 Kayole 932 Wanjiru Wanjiri 735 Kariobangi
<sql>
2019-08-02 20:09:01
LQ_EDIT
57,334,140
Optimal way to cover a complete are making searching by zipcoe
I want to make a search by zip code, which is defined by polygons like in the picture below: [![enter image description here][1]][1] The thing is that actually, I can not make the search on the zip codes itself but in an area from the centroid of that zip code, for example for the zipcode 4, this area touch 1,2 and 5 as well. [![enter image description here][2]][2] In the same way, the search for 1 with take the results from 2,3,4 and 6 as well. Hence to avoid getting duplicates I want to take find out with are the zipcodes with whch I can get all the results with the less number of searches, say take 4, and 6 [![enter image description here][3]][3] [![enter image description here][4]][4] Instead of 2,5 and 6 [![enter image description here][5]][5] How can I approach this problem? [1]: https://i.stack.imgur.com/Wa4vF.png [2]: https://i.stack.imgur.com/jvVpf.png [3]: https://i.stack.imgur.com/ipyVz.png [4]: https://i.stack.imgur.com/3a1x5.png [5]: https://i.stack.imgur.com/ivl1M.png
<python><optimization><linear-programming>
2019-08-02 22:39:41
LQ_EDIT
57,335,170
How can i check what is the biggest string in a list
<p>I want to check what is the biggest string in a list</p> <p>Is there any function for this? for example:</p> <pre class="lang-py prettyprint-override"><code>lis = ['rafa', 'now', 'lucky'] </code></pre> <p>And it returns 'lucky' or 5</p>
<python>
2019-08-03 03:06:04
LQ_CLOSE
57,337,934
How to resolve a Nullpointer exception?
I am using two Recyclerviews in my app, one in the MainActivity and one in another activity. The one in the MainActivity works fine but the other has a NullpointerException and I don't know where the problem is. I know what this problem causes but I don't see it in my code. Here is a code snippet of the second Recyclerview, where Logcat says that there is a Null object reference. I used the same code as the first Recyclerview where everything works (I changed of course the names in this file) The error message says that there is a problem in this line: recyclerView.setLayoutManager(layoutManager); and in this line initRecyclerViewFreundesUebersicht(); ```private void initRecyclerViewFreundesUebersicht() { LinearLayoutManager layoutManager = new LinearLayoutManager(this, RecyclerView.VERTICAL, false); RecyclerView recyclerView = findViewById(R.id.recyclerViewFreundesUebersicht); recyclerView.setLayoutManager(layoutManager); RecyclerViewAdapterFreundesUebersicht adpater = new RecyclerViewAdapterFreundesUebersicht(mNames, mImageUrls, this); recyclerView.setAdapter(adpater); } @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_spielen_uebersicht); getSupportActionBar().setDisplayHomeAsUpEnabled(true); init(); initRecyclerViewFreundesUebersicht(); getImages(); }
<android><android-recyclerview><nullpointerexception>
2019-08-03 11:34:12
LQ_EDIT
57,338,271
How to read website content from url in flutter
<p>I need an application that reads the content of a site, given the url it navigates the DOM and extracts the content of the components.</p>
<html><web><flutter><dart>
2019-08-03 12:22:35
LQ_CLOSE
57,338,313
Make a int number by elements of a array. C code
I have a keypad that connects to lcd by atmega32 avr. I writes its lcd and keypad functions well. But now i have a problem; I store entered key by keypad in a array name l[i].i take numbers by while loop. Operator only can enter number under 999. For example operator enter 2 then 6,then9. My Array is l[3]={2,6,9}. Now i wanna make a int number y=269. How can i? I wanna can do it for 1-3 digit numbers. Keypad can put 0-999 numbers. Thanks
<c><arrays><string><integer><keypad>
2019-08-03 12:28:48
LQ_EDIT
57,339,135
No I want to ask about oracle
Lets say I have three rows with value as 1)121/2808B|:6081 2)OD308B|:6081_1: 3)008312100001200. I want to display value only till 'B' but want to exclude after B as you can see in above eg from 121/2808B|:6081 I want only 121/2808B OD308B|:6081_1: only OD308B and 008312100001200|:6081_1 only 008312100001200. Thanks for the Help.
<sql><string><oracle><substring>
2019-08-03 14:17:48
LQ_EDIT
57,339,612
How do I make my Discord bot join specific servers? The bot requires a paid subscription and I don't want the invite link to be leaked
<p>I want my Discord bot to only be added to servers where the owner has paid for a subscription. When I give them the bot invite link, I don't want the link to be leaked so how would I fix this problem?</p>
<javascript><bots><discord><discord.js>
2019-08-03 15:18:26
LQ_CLOSE
57,340,413
Want to find all the timestamp values interval by each minute between the two timestamp records
I have a table having three fields Id (Integer) - Unique , Open Date (Datetime), Close Date(DateTime)- Id Open Date Close Date 1 2019-07-03 16:28:39.497 2019-07-04 16:28:39.497 2 2019-07-04 15:28:39.497 2019-07-05 19:28:39.497 …..N I want to calculate the all the timestamps between open date and close date with an interval of each minute . So the final output i want is like this - Id Open Date Close Date TimeStamp Range 1 2019-07-03 16:28:39.497 2019-07-04 16:28:39.497 2019-07-03 16:29:00.0000 1 2019-07-03 16:28:39.497 2019-07-04 16:28:39.497 2019-07-03 16:30:00.0000 1 2019-07-03 16:28:39.497 2019-07-04 16:28:39.497 2019-07-03 16:31:00.0000 1 2019-07-03 16:28:39.497 2019-07-04 16:28:39.497 ….......................... 1 2019-07-03 16:28:39.497 2019-07-04 16:28:39.497 2019-07-04 16:27:00.0000 2 2019-07-04 15:28:39.497 2019-07-05 19:28:39.497 2019-07-04 15:29:00.0000 2 2019-07-04 15:28:39.497 2019-07-05 19:28:39.497 2019-07-04 15:30:00.0000 2 2019-07-04 15:28:39.497 2019-07-05 19:28:39.497 2019-07-04 15:31:00.0000 2 2019-07-04 15:28:39.497 2019-07-05 19:28:39.497 …................................. 2 2019-07-04 15:28:39.497 2019-07-05 19:28:39.497 2019-07-05 19:27:00.0000 N …............................ …........................... …...................................... Can Anyone please help to prepare the sql query for this ? Its Quite Urgent. Thanks in Advance :) Please Help.
<sql-server><sql-timestamp>
2019-08-03 16:58:35
LQ_EDIT
57,340,891
Printing on only one line
<p>I have a program that has to only print data onto one line.</p> <p>What can I do to do this.</p> <pre><code>for i in range(10): print(i) </code></pre> <p>Is it possible to print all of this on one line so it prints 0, erases the line, print 2, erases, etc..?</p>
<python><printing>
2019-08-03 18:02:36
LQ_CLOSE
57,343,318
How to break up string into multiple on newline character?
<p>I have the details of an amazon order, the literal string is separated by the newline character \n. </p> <pre class="lang-py prettyprint-override"><code>str = 'Linon Hampton Stool Fabric Top, 24-inch \nSold by: Amazon.com Services, Inc \n$33.99' </code></pre> <p>I want to split it up into n number of strings for each new line so that it looks like.</p> <pre class="lang-py prettyprint-override"><code>str1 = 'Linon Hampton Stool Fabric Top, 24-inch' str2 = 'Sold by: Amazon.com Services, Inc ' str3 = '$33.99' </code></pre>
<python><string>
2019-08-04 02:14:30
LQ_CLOSE
57,343,814
Yet another web.py name collision
<p>I'm trying to make a simple Hello World web page in Python 3.7.4 and web.py <code>0.40-dev1</code> (which is supposed to be compatible) and I'm running into</p> <blockquote> <p>AttributeError: module 'web' has no attribute 'applications'</p> </blockquote> <p>error. I've googled enough to know that is a name collision, but for the love of God I can't trace it.</p> <p>Here's the full code:</p> <pre><code>import web urls = ( '/', 'index' ) application = web.applications(urls, globals()) class index: def GET(self): greeting = 'Hello world' return greeting if __name__ == "__main__": application.run </code></pre> <p>And here's the full Python interpreter output:</p> <pre><code>Traceback (most recent call last): File "bin\app.py", line 7, in &lt;module&gt; application = web.applications(urls, globals()) AttributeError: module 'web' has no attribute 'applications' </code></pre>
<python><python-3.x><web.py>
2019-08-04 04:30:10
LQ_CLOSE
57,343,880
How to fix 'Use of unassigned local variable' in C#
<p>I am new to C#, my last programming language was C</p> <p>I kept getting Use of unassigned local variable 'average' The <code>average</code> it is pertaining was the <code>average /= 10;</code></p> <pre><code>using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ConsoleApp1 { class Program { static void Main(string[] args) { int i, average; int[] scores = new int[10]; Console.WriteLine("Enter 10 scores"); for (i = 0; i &lt; 10; i++) { scores[i] = Convert.ToInt32(Console.ReadLine()); } for (i = 0; i &lt; 10; i++) { average = scores[i] + scores[i + 1]; i++; } average /= 10; Console.WriteLine("Average of All the Scores: {0}", average); Console.Read(); } } } </code></pre>
<c#>
2019-08-04 04:47:59
LQ_CLOSE
57,344,063
angular install cli errno -13
<p>i am trying to install npm install -g @angular/cli and i get this error </p> <pre><code>npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules npm ERR! path /usr/local/lib/node_modules npm ERR! code EACCES npm ERR! errno -13 npm ERR! syscall access npm ERR! Error: EACCES: permission denied, access '/usr/local/lib/node_modules' npm ERR! { Error: EACCES: permission denied, access '/usr/local/lib/node_modules' npm ERR! stack: 'Error: EACCES: permission denied, access \'/usr/local/lib/node_modules\'', npm ERR! errno: -13, npm ERR! code: 'EACCES', npm ERR! syscall: 'access', npm ERR! path: '/usr/local/lib/node_modules' } npm ERR! npm ERR! The operation was rejected by your operating system. npm ERR! It is likely you do not have the permissions to access this file as the current user npm ERR! npm ERR! If you believe this might be a permissions issue, please double-check the npm ERR! permissions of the file and its containing directories, or try running npm ERR! the command again as root/Administrator (though this is not recommended). npm ERR! A complete log of this run can be found in: npm ERR! /Users/admin/.npm/_logs/2019-08-04T05_20_10_235Z-debug.log </code></pre> <p>Tried following Commands repeatedly still did not worked.</p> <p>1- i uninstall nodejs and reinstall old version </p> <pre><code>~ brew uninstall node ~ which node ~ rm -rf /usr/local/bin/node ~cd /usr/local/lib ~ sudo rm -rf node ~ sudo rm -rf node_modules </code></pre> <p>2- clean cash</p> <pre><code>~ npm cache verify --force ~ npm cache clear --force ~ npm uninstall -g @angular/cli ~ npm install -g @angular/cli </code></pre> <p>node version v8.16.0</p> <p>npm version 6.4.1</p>
<node.js><angular><npm><angular-cli>
2019-08-04 05:27:26
LQ_CLOSE
57,345,393
Use static_cast to dynamic polymorphism
<p>I used a static_cast to polymorphism. I read that I should use dynamic_cast, but I can't get why. Code works in both way (with static and dynamic cast).</p> <p>Could anybody show me an example with necessary dynamic_cast operator? </p> <pre><code>class Base { public: virtual void foo() = 0; }; class D1 : public Base { public: void foo() { std::cout &lt;&lt; "D1()"; } }; class D2 : public Base { public: void foo() { std::cout &lt;&lt; "D2()"; } }; int main() { srand( time( NULL ) ); int r = std::rand()%2; Base* b_ptr; if(r == 0) { b_ptr = static_cast&lt;Base*&gt;(new D1); } else { b_ptr = static_cast&lt;Base*&gt;(new D2); } b_ptr-&gt;foo(); } </code></pre>
<c++><polymorphism><dynamic-cast><static-cast>
2019-08-04 09:27:24
LQ_CLOSE
57,346,463
Check if the word is a palindrome in COBOL
Create a program that will ask the user to enter a word. Check if the word is a palindrome. WHEN I TYPE LOL IT SAYS IT IS NOT A PALINDROME. PLS HELP ME DISPLAY "Enter a word to check if it is a Palindrome: " ACCEPT WS-STR1 MOVE FUNCTION REVERSE(WS-STR1)TO WS-STR2 DISPLAY WS-STR1 DISPLAY WS-STR2 IF WS-STR1(1:1) = WS-STR2(15:1) AND WS-STR1(2:1) = WS-STR2(14:1) AND WS-STR1(3:1) = WS-STR2(13:1) AND WS-STR1(4:1) = WS-STR2(12:1) AND WS-STR1(5:1) = WS-STR2(11:1) AND WS-STR1(6:1) = WS-STR2(10:1) AND WS-STR1(7:1) = WS-STR2(9:1) DISPLAY "A PALINDROME! " ELSE DISPLAY "NOT A PALINDROME " END-IF.
<cobol>
2019-08-04 12:12:35
LQ_EDIT
57,347,876
my image is leaving space left side even though background size is cover
Ques: My image is leaving space on the left side instead of covering 100% on both the left and right side. background-image: url("https://images.unsplash.com/photo-1491336238524-c990bd671778?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=500&q=60"); background-size: cover; background-repeat: no-repeat; width: 100%; height:100%;
<css>
2019-08-04 15:32:28
LQ_EDIT
57,348,065
how to wrap a binary operator using modern C++ instead of macros
<p>I saw a macro wrapper for binary operator on <a href="http://craftinginterpreters.com/a-virtual-machine.html" rel="nofollow noreferrer">this site</a> like this:</p> <pre><code>#define BINARY_OP(op) \ do { \ double b = pop(); \ double a = pop(); \ push(a op b); \ } while (false) </code></pre> <p>and it's used like this:</p> <pre><code>switch(op){ case OP_ADD: BINARY_OP(+); break; case OP_SUBTRACT: BINARY_OP(-); break; case OP_MULTIPLY: BINARY_OP(*); break; case OP_DIVIDE: BINARY_OP(/); break; // other ops... } </code></pre> <p>but can I use a modern C++ way to implement such a wrapper instead of a macro?</p>
<c++>
2019-08-04 15:56:07
LQ_CLOSE
57,348,288
How to prevent failure of multiple cin statements if one fails
<p>If we have multiple cin statements and one of them gets a wrong input, every following cin fails. How to prevent that?</p> <pre><code>#include &lt;iostream&gt; using namespace std; int main() { int a, b, c, d, e; cin&gt;&gt;a; cin&gt;&gt;b; cin&gt;&gt;c; cin&gt;&gt;d; cin&gt;&gt;e; return 0; } </code></pre> <p>If I enter some string for first or any other variable that expects int, every cin that follows terminates. How to prevent this failure?</p>
<c++><c++11>
2019-08-04 16:27:23
LQ_CLOSE
57,349,287
WHat does the regex parameter in .replace() function mean
I am a beginner in Python. I was trying to replace few unwanted strings that got scraped from the website. So I tried removing them using codes from this website itself. df["col_1"].replace('', '', regex=True, inplace=True) What exactly does the regex = True and inplace = True mean? I am sorry if this question looks stupid but I am not from the coding background. Thanks.
<python><python-3.x><pandas><dataframe>
2019-08-04 18:40:33
LQ_EDIT
57,350,221
List of length n with p randomly allocated ones else zero
<p>What's the shortest way (as in short code) to get a list of length n with p &lt; n randomly allocated ones else zero. Say n = 6 and p = 2, I'd like something like [0,1,0,0,1,0].</p>
<python><random>
2019-08-04 21:07:50
LQ_CLOSE
57,351,730
is it possible to use a NPM made by angular 8 in javascript or even react native?
#is it possible to use a NPM made by angular 8 in javascript or even react native? # I made an angular8 app and want to convert to NPM if there is possible to use in normal Javascript app (or even in react native app), is it possible? please let me know if there is any detail to know? thanks in advanced
<javascript><angular><react-native><npm>
2019-08-05 02:59:42
LQ_EDIT
57,352,548
How to change the add to cart button in WooCommerce with Book Now
<p>Hi I am working on a WooCommerce theme design &amp; dynamic implementation, currently it has the add to cart option for its products (Normally it works as an e-commerce feature) in this project it has be different option product (it has 'Customised Plan' instead of 'Products') like when user visits to product description page user will select the plan with some options then instead of add to cart it should be Book Now button or something like that, the purpose is client will contact to the customer when the plan is booked &amp; they'll charge them accordingly. Please check the link of the live project: <a href="https://demosoftwares.biz/Eat-Conscious/wp/product/ec-customized-plan/" rel="nofollow noreferrer">https://demosoftwares.biz/Eat-Conscious/wp/product/ec-customized-plan/</a></p>
<php><wordpress><woocommerce>
2019-08-05 05:19:59
LQ_CLOSE
57,354,139
want to get the value of array key
<p>I have a complicated array and want to find the value of this. but the problem is answer getting like 0,1,2,3,4,5</p> <p>following is the code to getting the value of state of array</p> <pre><code>var shardState = Object.keys(mydata.cluster.collections[collectionName].shards[String(shardName)].state); alert(shardState); </code></pre> <p>Following is the array.</p> <pre><code>{ "responseHeader":{ "status":0, "QTime":4}, "cluster":{ "collections":{ "college":{ "pullReplicas":"0", "replicationFactor":"1", "shards":{"shard1":{ "range":"80000000-7fffffff", "state":"active", </code></pre>
<javascript><arrays>
2019-08-05 07:38:27
LQ_CLOSE
57,354,167
Charset on Linux server with Git
<p>We have some trouble with special signs in our (javascript) application like €.</p> <p>The files looks correct when we open they on our development pc's but when pulled on our production server the sign is showing up like <code>€</code>. In the browser but also in the file itselfs.</p> <p>I guess it is something with the charset or locale setting on the server, but when executing <code>locale</code> I see that it's set to UTF-8 already.</p> <pre><code>LANG=en_US.UTF-8 LANGUAGE= LC_CTYPE="en_US.utf-8" LC_NUMERIC="en_US.utf-8" LC_TIME="en_US.utf-8" LC_COLLATE="en_US.utf-8" LC_MONETARY="en_US.utf-8" LC_MESSAGES="en_US.utf-8" LC_PAPER="en_US.utf-8" LC_NAME="en_US.utf-8" LC_ADDRESS="en_US.utf-8" LC_TELEPHONE="en_US.utf-8" LC_MEASUREMENT="en_US.utf-8" LC_IDENTIFICATION="en_US.utf-8" LC_ALL=en_US.utf-8 </code></pre> <p>What can be the issue here? </p>
<linux><git><utf-8>
2019-08-05 07:40:26
LQ_CLOSE
57,355,602
C#: Writealltext in loop randomly doesn't write to file
<p>I created an executable which uses an API call to get information and writes it to a file with System.IO.File.WriteAllText . In SSIS i execute the file in a loop with a list of parameters (needs to loop around 3000 times). Everything goes fine, but after a random amount of executes (differs every time i execute although the order of execution remains the same) it fails to create and write to a file. The file doesn't exist. The executable doesn't encounter an error either. So when i want to read from my file in the next step of my loop, it fails. </p> <p>I have tried to write a try catch block around my code but it still doesn't return any errors. In my loop i always deleted the files after i read them. Now i just let the files stay in the folder so it doesn't exit my loop (as it sometimes creates the file and sometimes it doesn't. That way i can go through my whole loop but it doesn't help not knowing if some files were not updated.</p> <p>I'm currently out of ideas to try, since to me, the "error" appears completely random and because the program doesn't recognize the fault it's hard to troubleshoot.</p>
<c#><ssis>
2019-08-05 09:22:14
LQ_CLOSE
57,355,679
Rotating every 3 bits of integer in C++
<p>Note the following may have exactly the same solution if x is any positive integer, but for the exact problem at hand:</p> <p>Choose an integer 0 &lt; n &lt; 11. Let x be an integer whose binary representation is given by pasting together up to n of the 3-bit strings: 001, 010, 100, 111 in some order (this is "Numbers with digits 1,2,4,7 when written in base 8", see e.g. <a href="http://oeis.org/A308496" rel="nofollow noreferrer">http://oeis.org/A308496</a> ). Let y be the integer formed by rotating each 3-bit substring of x by 1 to the left. E.g. if (x)_2 = 001_010_111_100 then (y)_2 = 010_100_111_001 </p> <p>Problem: Let x_1, x_2, ... x_m be a sequence of such x for a given n, find the corresponding y_1, y_2, ... y_m. </p> <p>If m is less than, say, a few thousand, then speed is not really an issue. One could e.g. break "001_010_111_100" down into an array [001, 010, 111, 100] and perform bit rotation for each element of the array. </p> <p>However, once m becomes quite large (e.g. > 10^6), this task needs to be optimized as much as possible. Any suggestions (to a C++ beginner)?</p>
<c++><algorithm><performance><bit-manipulation>
2019-08-05 09:26:42
LQ_CLOSE
57,356,299
Separate each character in a string
<p>Hi everyone i am new member! I'm having a problem. I transmit data between Arduino Due and C #. C # receives a string a = "0.0.1.0.1.1100" from Arduino Due I want to separate each character in the string a, I tried the Substring function but it was not effective. Is it something strange?</p>
<c#>
2019-08-05 10:02:16
LQ_CLOSE
57,356,584
How to remove some items from an arraylist without loop and less complexity?
I have an array list of some 1 Lakh objects. I want to remove some of the objects which is having a particular ID. Now i'm using for loop to search through the arraylist and remove each of them. Hence it is very much time consuming. Is there any possible way to do this without any looping?
<performance><loops><arraylist><java-8><time-complexity>
2019-08-05 10:19:18
LQ_EDIT
57,358,136
Integrate row information with previous rows sql
Hi I need to integrate row information with previous rows --------------------------------------------- | ID | no| number | ----------------------------------------- | 1 | 40| 10 | | 2 | 32| 12 | | 3 | 40| 15 | | 4 | 45| 23 | | 5 | 32| 15 | | 6 | 12| 14 | 7 | 40| 20 | 8 | 32| 18 | 9 | 45| 27 | 10 | 12| 16 ------------------------------ result --------------------------------------------- | ID | no| number |last number ----------------------------------------- | 1 | 40| 10 |0 | 3 | 32| 12 |0 | 3 | 40| 15 |0 | 4 | 45| 23 |0 | 5 | 32| 15 |12 | 6 | 12| 14 |0 | 7 | 40| 20 |15 | 8 | 32| 18 |15 | 9 | 45| 27 |23 | 10 | 12| 16 |14 ------------------------------ thanks for your help..
<sql><sql-server>
2019-08-05 11:56:46
LQ_EDIT
57,358,226
How to convert Any? to Data in swift
<p>I need to convert from type <code>Any?</code> to <code>Data</code>. </p> <p>something like this</p> <pre><code>func getItem(item:Any?) { let data = convertToData(item) } </code></pre>
<ios><swift>
2019-08-05 12:02:37
LQ_CLOSE
57,359,762
Google photos on iPhone, only upload select photos
<p>I have an iPhone and I want to create an album my friends, many of whom are Android users, can add photos to. I downloaded the app on my phone for this purpose. In order to add any photos the phone first wants to uploade all my photos to Google Photos. I don't want this to happen. I only want to add select photos to the app. Further I don't want to create a situation where I remove a photo from Google Photos which then removes the photos from my phone and other devices. </p>
<iphone><delete-file><google-photos>
2019-08-05 13:37:03
LQ_CLOSE
57,362,588
reading a aplhanumeric text file and trying to store to a list or array
I am using scanner.usedelimiter("[^0-9|,]") this pattern to avoid alphabets from a text file.then using hasNext and next() methods to store to a string and then list but list is adding additional o and whitespaces. I am using Scanner class to read a text file and extract only numbers from that text file Scanner sc = new Scanner("123.txt"); sc.useDelimiter("[^0-9|,|-]"); while (sc.hasNext()) { String s=null; s=sc.next(); list.add(s.replaceAll("\\s+","")); } Actual file has data Class Student Details 1 total 25 students with 80% pass 2A - 3B total 90 students with 70% pass 4A - 5B total 69 students with 80% pass 10 distinction Expected Output 1 25 80 2 3 90 70 4 5 69 80 10
<java>
2019-08-05 16:27:57
LQ_EDIT
57,362,837
Weird behavior when assigning one char array to another char array using char
<p>When I try to copy one element from char array to a char and then from same char to another char array, second char array gives weird output, usually containing whole string from first char array. This happens only when second char array is not initialized. My question is how char is able to transfer whole string to another char array.</p> <pre><code>int main() { char a[10] = "ababababa"; char b[5]; char temp; temp=a[1]; b[0]=temp; std::cout&lt;&lt;b; } </code></pre> <p>While using g++ I get <code>b{�Uarabababa</code> While using clang++ I get <code>b�U</code></p> <p>Content between <code>b</code> and <code>U</code> changes every time program is run.</p>
<c++><arrays>
2019-08-05 16:46:24
LQ_CLOSE
57,363,096
[Environment]::Exit(0) - MEANING OF THIS?
<p>What is the meaning of this line in PowerShell?</p> <p>I have tried searching on google but I do not see any specific explanations.</p>
<powershell><exit>
2019-08-05 17:04:45
LQ_CLOSE
57,364,042
Why we need --scripts-version
I am new to React and was learning how to properly create new project. Then I came across -scripts-version when we create new project with such command : "create-react-app new project -scripts version". Why do we need to use -scripts-version?
<javascript><reactjs><create-react-app>
2019-08-05 18:14:38
LQ_EDIT
57,364,178
i want to trace this method to know why it stop looping after the second record
<p>i wanna to make a button to loop in all records and do a method that makes a list from ranges between tow fields and pop another record from the list and but the value in result field </p> <p>i make it like in the code below and it work well just in the first record and the second record it working but without remove the record form the list and it's important for me to remove it like then it stop working </p> <pre><code>class relate(models.Model): _name = 'relate' _rec_name = 'car' @api.multi @api.onchange('start', 'end', 'ignore') def years_rang(self): for rec in self.search([]): if not rec.rang: record = [int(x) for x in range(int(rec.start), int(rec.end) + 1)] list = [] if rec.ignore: try: record.remove(int(self.ignore)) list= [] print(record) except ValueError: return {'warning': {'title': 'Warning!', 'message': "the Ignored year doesn't in range"}} else: for item in record: range_id = self.env['yearrange'].create({'name': str(item)}) list.append(range_id.id) rec.rang = [(4, x, None) for x in list] else: return start = fields.Char(string="", required=False, ) end = fields.Char(string="", required=False, ) rang = fields.One2many(comodel_name="yearrange", inverse_name="product_id", store=True, string="Years" ,) ignore = fields.Char(string="Ignore", required=False, ) class yearrange(models.Model): _name = 'yearrange' _rec_name = 'name' name = fields.Char() product_id = fields.Many2one(comodel_name="relate") </code></pre> <p>any kind of help will be appreciated</p>
<python><python-3.x><loops><for-loop><odoo>
2019-08-05 18:24:42
LQ_CLOSE
57,364,431
Can't erase digits from c++ string by using the 'erase' function
<p>Using c++ 14. I'm prompting the user for a string containing both letters and integers, and trying to "strip" the integers from the string itself via the string.erase() function.</p> <p>The problem i'm facing is when there are 2 or more sequential numbers, than the function seems to erase the first but delete the latter.</p> <p><strong>Example:</strong></p> <pre><code> input: H23ey Th2e3re St01ack O34verflow output: H3ey There St1ack O4verflow </code></pre> <p>I can do it another way by using a new string, looping through the existing one and adding only what isalpha or isspace, but it seems messier.</p> <p><strong>code:</strong></p> <pre><code>string digalpha {}; cout &lt;&lt; "Enter string containing both numbers and letters: "; getline(cin, digalpha); for (size_t i {}; i &lt; digalpha.size(); i++) if (isdigit(digalpha.at(i))) digalpha.erase(i,1); cout &lt;&lt; digalpha &lt;&lt; endl; cout &lt;&lt; endl; return 0; </code></pre>
<c++><string>
2019-08-05 18:44:58
LQ_CLOSE
57,364,634
Brace-or-equal-initializers default value in child doesn't seem work
<p>I try understand what's going on here, why <code>bar</code> doesn't have default value for <code>name</code> property</p> <pre><code>#include &lt;string&gt; struct Foo { std::string name = "foo default value"; std::size_t number = 23; }; struct Bar : public Foo { std::string name = "here i want other value"; }; int main(int argc, char * argv[]) { Foo foo; std::cout&lt;&lt;"name="&lt;&lt; foo.name &lt;&lt; " number=" &lt;&lt; foo.number &lt;&lt; std::endl; Foo * bar = &amp;Bar(); std::cout&lt;&lt;"name="&lt;&lt; bar-&gt;name &lt;&lt; " number=" &lt;&lt; bar-&gt;number &lt;&lt; std::endl; return 0; } </code></pre> <p>output:</p> <pre><code>name=foo default value number=23 name= number=23 // why name is empty string? </code></pre> <p>I assume that's default generated constructos are involed in final result. But can't get it right in my mind. Can someone explain what sorcery compiler does here?</p>
<c++><inheritance>
2019-08-05 19:00:14
LQ_CLOSE
57,365,039
How to align this content using Flexbox?
[Example Picture][1] Don't worry about the css part. I'm trying to align the input and the anchor horizontally with the logo using flexbox. Example attached. The logo will be on the right and the input with the anchor will be on the left but all horizontal. This is what I currently have. I'm not worried about the css just trying to get the layout correct. <!-- begin snippet: js hide: false console: true babel: false --> <!-- language: lang-css --> <!-- language: lang-html --> <div class="small-12 cell footer-logo-container"> <a href="#"> LOGO </a> <div class="footer-email"> Sign Up for the Rock River Report Here <input class="footer-input" type="email" placeholder="email"> <a href="#" class="link"> <div class="link-text"> SUBSCRIBE </div> </a> </div> <!-- end snippet --> [1]: https://i.stack.imgur.com/1oBHV.png
<html><css>
2019-08-05 19:34:33
LQ_EDIT
57,366,616
indicate if an element can be found in another vector in R
<p>two vectors (a,b) of type integer. 'b' is smaller than 'a'. I need a logical vector for 'a', indicating if a specific element of 'a' is part of 'b'. </p> <p>Is there a economic solution similar to '%in%' (which can not serve here)? Thanks in advance!</p>
<r><vector><element>
2019-08-05 22:06:21
LQ_CLOSE
57,367,081
Como realizar um insert em uma tabela utilizando um parâmetro fixo e um parâmetro "dinâmico" (resultado de um SELECT))
Preciso fazer um INSERT populando dois campos de uma tabela, onde um parâmetro sempre irá ter o mesmo valor, e o outro parâmetro será resultado de um SELECT. Segue abaixo a QUERY que elaborei: INSERT INTO tabelaAlvo (cdCodigo, cdItem) VALUES (8, (SELECT cdItem FROM outraTabela WHERE cdXxx IN (27) AND cdYyy IN ( 3, 16, 63, 121, 256, 257, 258, 259, 260, 261, 262, 263, 264))) O primeiro atributo sempre deverá ser preenchido com o valor = 8, enquanto o segundo atributo deverá ser preenchido com o resultado do SELECT. Poderiam me ajudar, por gentileza? Tentei localizar alguma pergunta semelhante, mas não encontrei.
<sql><sql-server>
2019-08-05 23:16:00
LQ_EDIT
57,368,497
find even or odd number without modulo operator in php
<p><strong>find even or odd number without modulo operator in php</strong></p> <p>I am having problem to find even or odd numbers without modulo sign. so that i cant prepare my code.</p>
<php><modulo>
2019-08-06 03:22:34
LQ_CLOSE
57,369,187
Grid layout like pinterest using css only and without javascript
<p>I need a grid layout like Pinterest. How am I going to achieve such layout? </p> <p>I tried using <code>flex</code> but each element has space and I want the grid layout like in Pinterest.</p> <pre><code>&lt;style&gt; .flex{ width: 100%; display: flex; flex-direction: row; flex-wrap: wrap; } .flex-item{ width: 20%; background: #dddddd; } &lt;/style&gt; &lt;div class="flex"&gt; &lt;div class="flex-item"&gt;content.....&lt;/div&gt; &lt;div class="flex-item"&gt;Lorem ipsum dolor sit amet consectetur adipisicing elit..&lt;/div&gt; &lt;div class="flex-item"&gt;Lorem ipsum dolor sit..&lt;/div&gt; &lt;div class="flex-item"&gt;Lorem ipsum dolor sit amet consectetur..&lt;/div&gt; &lt;div class="flex-item"&gt;Lorem ipsum..&lt;/div&gt; &lt;/div&gt; </code></pre> <p>I really want the layout to be like pinterest I'm not sure if the flex is the practical way to achieve this. Any solution or advice will be much appreciated. Thanks in advance!</p>
<html><css>
2019-08-06 04:57:24
LQ_CLOSE
57,371,342
how to set color to button group by focus on one of buttons
<p>I have one button group with 5 button, I need to set color to button group with focus on one of theme, for example if I hover on third button I need change first there will be change color, I try to do it with this button group code : </p> <pre><code>&lt;div class="btn-group"&gt; &lt;button type="button" class="btn btn-default"&gt;&lt;i class="far fa-star"&gt;&lt;/i&gt;&lt;/button&gt; &lt;button type="button" class="btn btn-default"&gt;&lt;i class="far fa-star"&gt;&lt;/i&gt;&lt;/button&gt; &lt;button type="button" class="btn btn-default"&gt;&lt;i class="far fa-star"&gt;&lt;/i&gt;&lt;/button&gt; &lt;button type="button" class="btn btn-default"&gt;&lt;i class="far fa-star"&gt;&lt;/i&gt;&lt;/button&gt; &lt;button type="button" class="btn btn-default"&gt;&lt;i class="far fa-star"&gt;&lt;/i&gt;&lt;/button&gt; &lt;/div&gt; </code></pre>
<javascript><jquery><css><twitter-bootstrap-3>
2019-08-06 07:52:55
LQ_CLOSE
57,372,353
How to get nth-of-type patterns to work like 1-2-2-1?
<p>Trying to get nth-of-type to style elements with this pattern: 1-2-2-1.</p> <p>For example, it needs to look like this:</p> <p>blue red</p> <p>red blue</p> <p>blue red</p> <p>red blue</p> <p>blue red</p> <p>red blue</p> <p>I have a lot of links set in 1 container, I am trying to get it to be in 2 columns and to be designed in alternating colors (like shown in the red-blue list here).</p> <p>I tried messing around with nth-of-type, but couldn't figure it out, for now, I am using something like this:</p> <pre><code>.post-link:nth-of-type(2) {code...} .post-link:nth-of-type(3) {code...} .post-link:nth-of-type(6) {code...} .post-link:nth-of-type(7) {code...} .post-link:nth-of-type(10) {code...} .post-link:nth-of-type(11) {code...} </code></pre> <p>But this manual approach only takes me so far, links are being added to the page all the time and I need it to work without setting a specific rule for each box.</p> <p>I tried something like this with no success as well:</p> <pre><code>.post-link {background: #3c6d84;} .post-link:nth-of-type(2n) {background: #fe7625;} .post-link:nth-of-type(3n) {background: #fe7625;} </code></pre> <p>Trying to get the right pattern as mentioned above.</p>
<css>
2019-08-06 08:54:47
LQ_CLOSE
57,373,634
What's the code for ```&gt;``` pointing downwards?
In HTML, greater than is rendered by code: ```&gt;```, what is the code for the same symbol but pointing upwards and downwards?
<html><css><unicode>
2019-08-06 10:06:18
LQ_EDIT
57,374,754
Am i using reduce method in a wrong way?
In this problem, i trying to sum up the values inside an array of each object. I expect the output of [{name: "Bob", scores: [75], {name: "Bill", scores: [95], {name: "Charlie", scores: [95]] ````function winner(c1, c2, c3) { var customerArr = []; customerArr.push(c1, c2, c3); // console.log(customerArr); customerArr.forEach(customer => { customer.scores = customer.scores.reduce(function(total, scores) { return total + scores; }, 0) // console.log(Array.isArray(customer.scores)) }); return customerArr; } c1 = {"name": "Bob", "scores":[10, 65]} c2 = {"name":"Bill", "scores":[90, 5]} c3 = {"name":"Charlie", "scores":[40, 55]}; console.log(winner(c1, c2, c2)); O/P: TypeError: customerArr[i].scores.reduce is not a function
<javascript><javascript-objects><reduce>
2019-08-06 11:13:48
LQ_EDIT
57,374,784
Hosting Spring-cloud-config server as a micro service in docker
How to host a spring cloud config server registered as Eureka Client in docker containers ? My spring boot micro services architecture includes the below components, 1. eureka-server (Eureka as Service Registry) 2. config-server (registered as Eureka client) 3. Business Logic App (registered as Eureka client) These spring boot applications are working fine in my windows local machine. The same needs to be hosted in docker containers. Config server is not getting registered with Eureka server while running in docker container. I have tried including the below key-value in my config-server properties as suggested in many blogs, trail 1: eureka.client.service-url.defaultZone=http://localhost:8761/eureka/ trail 2: eureka.client.service-url.defaultZone=http://eureka-server:8761/eureka/ Both these suggestions doesn't work. **I would like to get a working example to host the config server registered with Eureka in docker containers.**
<spring-boot><docker><microservices><netflix-eureka><spring-cloud-config>
2019-08-06 11:15:23
LQ_EDIT
57,374,919
Pythonic way to get the max difference between any 2 consecutive elements of a list
<p>I have a list which stores scores of a game which is played in rounds. At each index, the score is stored such that it's equal to the total score scored up to and including that round.</p> <ul> <li>round 1 - 5 points are scored in this round</li> <li>round 2 - 3 points are scored in this round</li> <li>round 3 - 7 points are scored in this round</li> <li>round 4 - 4 points are scored in this round</li> </ul> <p>This will result in</p> <pre><code>total_score = [5, 8, 15, 19] </code></pre> <p>How can I convert this neatly into a list which has the score of each round at each index, instead of the total score up to that round.</p> <p>So I want to turn the above list into:</p> <pre><code>round_scores = [5, 3, 7, 4] </code></pre> <p>It's not particularly hard to do with just iterating over it and subtracting the score at the previous index from the score at the current index. But is there a neater way to do this? Maybe a one liner list comprehension? I'm fairly new to Python but I've seen some magic being done in a single line in other answers.</p>
<python><list><list-comprehension>
2019-08-06 11:23:23
LQ_CLOSE
57,375,690
How to convert JSON to Object format in JAVA
I have a link https://jsonplaceholder.typicode.com/posts to which giving JSON format returned. that I have to be convert in Object format. Can anyone suggest me to convert in Object format? public String ExposeServices() { RestTemplate restTemplate= new RestTemplate(); String forresouseURL="https://jsonplaceholder.typicode.com/posts"; ResponseEntity<String> response= restTemplate.getForEntity(forresouseURL, String.class); Gson gson = new Gson(); // Or use new GsonBuilder().create(); String target2 = gson.toJson(response, User.class); HashMap<String, String> jsonObject= response; System.out.println(target2); //response.getBody(). return target2; } This is what I have tried but its not returning any value. I have to get JOSN value in Object formate then have to insert In MYSQL DB.
<java><spring-boot>
2019-08-06 12:04:59
LQ_EDIT
57,376,059
How can I clear the variable after while loop is done
<p>I'm writing a program that multiplies matrices. And here I have got two variables "i" and "q" which at the beginning are both 0. While the loops proceed variables ("i" and "q") change their values. However after the loops are done I need "i" and "q" to come back to the value 0, so the loops can repeat themselves for different "w" and "k" . How can I do so??</p> <pre class="lang-cpp prettyprint-override"><code> int wynik[x][z]; //table that holds the result of the multiplication int i=0; int q=0; int wyn=0; for(int w=0; w&lt;x; w++) { for(int k=0; k&lt;z; k++) { while((i&lt;y) &amp;&amp; (q&lt;v) ) { wyn = (tab1[w][i] * tab2[q][k]) + wyn; i++; q++; } wynik[w][k] = wyn; } } </code></pre>
<c++><variables>
2019-08-06 12:27:10
LQ_CLOSE
57,377,518
When I try to apply a certain git stash in VS2019, I get an error saying there are uncommitted changes (there aren't) and only one file is applied
<blockquote> <p>Git operation failed because there are uncommitted changes. Commit or undo your changes before retrying. See the Output window for details.</p> </blockquote> <p>However there are no uncommitted changes. One file that was added is restored from the stash, but that's it - the rest of them are stuck in limbo.</p> <p>How can I get the rest of my files from the stash? (Short of opening them one by one and copypastaing them into my project...)</p>
<git><visual-studio><visual-studio-2019>
2019-08-06 13:45:18
HQ
57,377,591
Sql server to db2 conversion
I'm converting the SQL server to db2.. Pls provide solution for stuff and for xml path Ex Select stuff(select something from table name Where condition For xml path(''),1,1,'') Pls convert this into db2.
<db2><db2-400>
2019-08-06 13:48:37
LQ_EDIT
57,377,625
plsql insert 10000 data into 3 tables
I have 3 tables. tours, tour_hotels and tour_transfers. Tour table has columns named id, tour_name, start_date. Tour_hotels table has columns named id, tour_id, hotel_name. Tour_transfers table has id, tour_id, from_where, to_where columns. Now I need to insert 10000 rows into each table. My code must be plsql and for loop. I must use only one for loop to insert all datas into 3 tables. And I must pay attention, id in tours table must match with tour_id in tour_hotels and tour_transfers tables. I am new learner in plsql, so please write sample and simple code for me. begin for i in 1 .. 10000 loop insert into tour.tours values (i, ('Tour ' || i), trunc(to_date('01/01/2019', 'mm/dd/yyyy')+i/15, 'ddd'), trunc(to_date('01/03/2019', 'mm/dd/yyyy')+i/15+i/777, 'ddd'), trunc(2+i/777), trunc(100 + i/6), trunc(to_date('01/01/2019', 'mm/dd/yyyy')+i/99, 'ddd'), trunc(to_date('01/01/2019', 'mm/dd/yyyy')+i/98, 'ddd'), 1, ('Country ' || trunc(i/60))); if(mod(i, 300) = 0) then insert into tour.tour_hotels values (i, i, ('Hotel ' || i), ('Country ' || trunc(i/60)), 3 + mod(i, 3), 0, 0, 1, trunc(to_date('01/01/2019', 'mm/dd/yyyy')+i/99, 'ddd'), trunc(to_date('01/01/2019', 'mm/dd/yyyy')+i/98, 'ddd'), 1); elsif (mod(i, 200) = 0) then insert into tour.tour_hotels values (i, i, ('Hotel ' || i), ('Country ' || trunc(i/60)), 3 + mod(i, 3), 1, 0, 0, trunc(to_date('01/01/2019', 'mm/dd/yyyy')+i/99, 'ddd'), trunc(to_date('01/01/2019', 'mm/dd/yyyy')+i/98, 'ddd'), 1); elsif (mod(i, 700) = 0) then insert into tour.tour_hotels values (i, i, ('Hotel ' || i), ('Country ' || trunc(i/60)), 3 + mod(i, 3), 1, 1, 1, trunc(to_date('01/01/2019', 'mm/dd/yyyy')+i/99, 'ddd'), trunc(to_date('01/01/2019', 'mm/dd/yyyy')+i/98, 'ddd'), 1); else insert into tour.tour_hotels values (i, i, ('Hotel ' || i), ('Country ' || trunc(i/60)), 3 + mod(i, 3), 1, 0, 1, trunc(to_date('01/01/2019', 'mm/dd/yyyy')+i/99, 'ddd'), trunc(to_date('01/01/2019', 'mm/dd/yyyy')+i/98, 'ddd'), 1); end if; insert into TOUR.TOUR_TRANSFERS values (i, i, ('Buradan ' || i), ('Buraya ' || i), trunc(to_date('01/01/2019', 'dd/mm/yyyy')+i/99, 'ddd'), trunc(to_date('01/01/2019', 'dd/mm/yyyy')+i/98, 'ddd'), 1); end loop; end;
<oracle><plsql><sql-insert>
2019-08-06 13:50:28
LQ_EDIT
57,379,026
Creating a show-more/show-less info box with + and - sign
<p>I want to create a box that has information in it that expands onclick of a '+' icon at the top right. The box should expand and include more information about that specific section and the '+' should transition into a '-' to allow the user to collapse the box to the original format that it was before.</p> <p>The animation would be similar to <a href="https://www.w3schools.com/howto/howto_css_menu_icon.asp" rel="nofollow noreferrer">https://www.w3schools.com/howto/howto_css_menu_icon.asp</a> </p> <p>In simple terms: I need a "show-more/show-less" box that expands/collapses but with a '+' and '-' sign instead of 'show-more' or 'show-less'</p> <p>How can I achieve this?</p>
<javascript><html><css><animation>
2019-08-06 15:07:03
LQ_CLOSE
57,379,389
on click to move on next variable
<p>How can I move from one variable called <code>trench1</code> to <code>trench2</code> with click I made this code but not working </p> <pre><code>var playthis = new Audio(); var trench1 = 'songs/example1.m4a'; var trench2 = 'songs/example2.m4a'; var trench3 = 'songs/example3.mp3'; i = 0; $('.next').click(function(){ playthis.src = trench + i++; }) </code></pre> <pre class="lang-html prettyprint-override"><code>&lt;button class="next"&gt;&lt;i class="fas fa-caret-right"&gt;&lt;/i&gt;&lt;/button&gt; </code></pre>
<javascript><jquery>
2019-08-06 15:28:25
LQ_CLOSE
57,379,397
Why is "Application permissions" disabled in Azure AD's "Request API permissions"?
<p>I'm trying to give a console app permission to call an API in Azure AD.</p> <p>When I go to "Add permissions," "application permissions" is grayed out and I can only select "delegated permissions."</p> <p>My understanding is that application permissions is right for the console app because it runs on the back-end and users don't sign into it.</p> <p>From the help text for "application permissions":</p> <blockquote> <p>Your application runs as a background service or daemon without a signed-in user.</p> </blockquote> <p>The help text for "delegated permissions":</p> <blockquote> <p>Your application needs to access the API as the signed-in user.</p> </blockquote> <p>Why is "application permissions" disabled?</p> <p><a href="https://i.stack.imgur.com/lZbGL.png" rel="noreferrer"><img src="https://i.stack.imgur.com/lZbGL.png" alt="Azure&#39;s &quot;Request API permissions&quot; dialog with a disabled &quot;application permission&quot; button"></a></p>
<azure><azure-active-directory><azure-ad-b2b>
2019-08-06 15:28:42
HQ
57,379,722
how to select random dropdown in angularjs application in selenium using java
I'm learning automation using Selenium. I'm testing angularjs application. How do I write a java code to select random options from a dropdown <select ng-model="attribute" ng-disabled="disabled" ng-required="draftstatus !== 'Incomplete' &amp;&amp; isrequired" ng-show="isrequired" ng-change="change" class="ng-pristine ng-invalid ng-invalid-required ng-touched" required="required" xpath="1" style=""><option value="">Please Select</option><!-- ngRepeat: option in collection --><option ng-repeat="option in collection" ng-selected="option === attribute" class="ng-binding ng-scope" value="Apple">Apple</option><!-- end ngRepeat: option in collection --><option ng-repeat="option in collection" ng-selected="option === attribute" class="ng-binding ng-scope" value="Mayo">Mayo</option><!-- end ngRepeat: option in collection --><option ng-repeat="option in collection" ng-selected="option === attribute" class="ng-binding ng-scope" value="Orange">Orange</option><!-- end ngRepeat: option in collection --><option ng-repeat="option in collection" ng-selected="option === attribute" class="ng-binding ng-scope" value="Colorado">Colorado</option><!-- end ngRepeat: option in collection --><option ng-repeat="option in collection" ng-selected="option === attribute" class="ng-binding ng-scope" value="Utah">Utah</option><!-- end ngRepeat: option in collection --><option ng-repeat="option in collection" ng-selected="option === attribute" class="ng-binding ng-scope" value="Mt.Titlis">Mt. Titlis</option><!-- end ngRepeat: option in collection --></select>
<angularjs><selenium><select><xpath><webdriverwait>
2019-08-06 15:46:17
LQ_EDIT