• Breaking News

    Tuesday, November 6, 2018

    How do marketplaces like Amazon recommend me products based on items I have googled? Ask Programming

    How do marketplaces like Amazon recommend me products based on items I have googled? Ask Programming


    How do marketplaces like Amazon recommend me products based on items I have googled?

    Posted: 06 Nov 2018 08:42 PM PST

    Based on my browsing history, I see relevant items on the Amazon frontpage. Maybe Google tracks and is a partner

    submitted by /u/Bulbasaur2015
    [link] [comments]

    Need Advice, how much should I pay a computer programmer to set up an automation bot for my businesses social media pages (details in description)?

    Posted: 06 Nov 2018 04:36 PM PST

    From what I have read, the job is considered easy if you are familiar with python? But I am not. Couldn't find anywhere of how long the job was, but looked like you just do a simple copy paste of the script from Github into my MacBooks VM terminal, and then the process of filling in the specific automation keywords/boundaries.

    Basically looking for generalities here, but whats the typical job time to have a bot like this (instabot.py on Github) fully functional and running for 1, 2 and 3 Instagram accounts? (don't know if doing a second or third page would be much quicker since the first account would already be set up)

    and the average rate per hour for this type of job?

    PS Not looking to be cheap either, I just want to make my ad enticing/attractive enough to get a quality programmer, but also don't want to get cracked/scammed and pay way more than I should have. Thank you in advance.

    submitted by /u/billfrugal
    [link] [comments]

    Why do people say that Python is slower than C++?

    Posted: 06 Nov 2018 10:27 AM PST

    Here's my understanding of what happens to code (so far):

    1. Code is written
    2. Code is compiled (or interpreted. Either way, it is translated into machine language)
    3. Code is executed

    So if I write code in both C++ and Python, and both of the pieces of code perform the same function, and I wrote the pieces of code at the same level of quality, shouldn't the code after being compiled run at the same speed? Since both have been translated into machine language?

    Does Python perhaps produce more lines of code after being compiled, and so it takes longer to run? Maybe I'm missing something and when people say 'Python is slower than C++' they are not talking about the compiled code, and are talking about something else?

    submitted by /u/SenseDeletion
    [link] [comments]

    Material Design: Programmatically create a Material Button in Android Studio

    Posted: 06 Nov 2018 09:45 PM PST

    I know how to create a normal button and textview programmtically. However, the documentation for Material design components is a bit lacking. How would I dynamically create a Material Button (and other Material Design components).

    Was referring to the official documentation here but it only shows xml creation. Seems like it should be fairly straightforward but I haven't found anything on google / stackoverflow covering this.

    submitted by /u/RainbowKittenz
    [link] [comments]

    C++ Overloading the Increment (++) Operator, but getting error.

    Posted: 06 Nov 2018 04:54 PM PST

    I'm trying to overload the ++ operator and make its new function cube some numbers. However, I keep getting this "error: postfix 'Complex Complex::operator++(Complex)' must take 'int' as its argument|"

    Heres my code: #include<iostream> #include<iomanip> using namespace std;

    class Complex { friend istream &operator>>(istream&, Complex&); friend ostream &operator<<(ostream&, Complex&); public: Complex(float = 0, float = 0); Complex operator+ (Complex); Complex operator- (Complex); Complex operator* (Complex); 

    This is where the issue lies

    Complex operator++(Complex); private: float real, imag; }; Complex::Complex(float a, float b) { real = a; imag = b; } Complex Complex::operator+(Complex one) { Complex two; two.real = real + one.real; two.imag = imag + one.imag; return(two); } Complex Complex::operator-(Complex one) { Complex two; two.real = real - one.real; two.imag = imag - one.imag; return(two); } Complex Complex::operator*(Complex one) { Complex two; two.real = (real * one.real) + (imag * one.imag * (-1)); two.imag = (real * one.imag) + (one.real * imag); return(two); } Complex Complex::operator++(Complex a) { Complex two; two.real = (real * real * real) + (3 * real) * (imag * imag * (-1)); two.imag = 3 * (real * real)*imag + (imag * imag *imag * (-1)); return(two); } //Extraction Operator istream &operator>> (istream &input, Complex &one) { input >> one.real >> one.imag; } //Insertion Operator ostream &operator<<(ostream &output, Complex &one) { output << one.real <<"+"<< one.imag <<"i" << endl; return output; } //Write stream insertion and extraction operators int main() { Complex c1,c2,c3,sum,diff,prod; cout << "Enter first complex number: "; cin >> c1; cout <<"Enter second complex number: "; cin >> c2; cout << "The first complex number is: " <<c1; cout <<"The second complex number is: " <<c2; sum = c1 + c2; cout<<"The sum is: " <<sum; diff = c1 - c2; cout<<"The difference is: " <<diff; prod = c1*c2; cout<<"The product is: " <<prod; /*if (c1==c2) cout <<"Equal"; if (c1!=c2) cout <<"Not equal"; */ //Cube function is the ++ operator cout << "Preincrement: " <<++c1<<++c2; cout << "Postincrement: " <<c1++<<c2++; cout << "After post increment: "<<c1<<c2; return 0; } 
    submitted by /u/VexxySmexxy
    [link] [comments]

    C++: assignment to print a 10x10 table without indexing

    Posted: 06 Nov 2018 04:24 PM PST

    The assignment provides a template which uses indexing to print the table so I assume using it there is ok.

    Here is my code, which currently works. I'm wondering if there's a way to get a pointer to the array without using *ptrMatrix = &matrix[0][0] ?

    #include <iostream>

    using namespace std;

    int main(void) {

    int matrix[10][10] = { }; //declare the array

    // Insert your code here

    int *ptrMatrix = &matrix[0][0]; //get location of matrix

    for(int i = 0; i < 10; i++) { //for each col

    for(int j = 0; j < 10; j++) { //for each row

    *ptrMatrix = (i+1)*(j+1); //set value based on location

    ptrMatrix ++; //increment the pointer to point to the

    //next item in the array

    //cout statement provided by assignment

    cout.width(4);

    cout << matrix[i][j];}

    cout << endl; //enter new row for each line

    }

    return 0;

    }

    submitted by /u/gli3247
    [link] [comments]

    CLLocation keeps returning nil but only the first time I run the app in simulator.

    Posted: 06 Nov 2018 07:28 PM PST

    Like the title says it will crash due to CLLocation holding nil the first run in the simulator but if I stop it and run again the CLLocation is no longer nil. Any advice? Here is a snippit

    class CityList : NSObject, CLLocationManagerDelegate { // stored properties var cities: [City] var currentLocation: CLLocation? = nil static let sharedInstance = CityList() static let firstNotif = Notification.Name(rawValue: "test") static let secondNotif = Notification.Name(rawValue: "test2") let locationManager = CLLocationManager() // initializers override init () { cities = [ City(name: "Medford", state: "Oregon", latitude: 42.3266667, longitude: -122.8744444), City(name: "Seattle", state: "Washington", latitude: 47.6063889, longitude: -122.3308333), City(name: "Grants, Pass", state: "Oregon", latitude: 42.4391667, longitude: -123.3272222), City(name: "Applegate", state: "Oregon", latitude: 42.2570662, longitude: -123.1683833), City(name: "San Francisco", state: "California", latitude: 37.775, longitude: -122.4183333) ] super.init() locationManager.delegate = self locationManager.requestWhenInUseAuthorization()// request user authorization locationManager.requestAlwaysAuthorization() locationManager.startUpdatingLocation() currentLocation = locationManager.location print(currentLocation?.coordinate) cities.append(City(name: "test", state: "test", location: currentLocation!)) } 

    submitted by /u/bipidiboop
    [link] [comments]

    Multiple programs on the same Server

    Posted: 06 Nov 2018 03:41 PM PST

    Say if I have a golang application that serves an API. And I want to set up say a rust or python web server on the same machine, how would i go about it?

    submitted by /u/ll01dm
    [link] [comments]

    I need help with a recursion method

    Posted: 06 Nov 2018 06:52 PM PST

    So I'm trying to make a recursion method that takes a string of letters and returns it like

    ABACABADABACABA

    This is all I have so far.

    public static void letters(char c) // Precondition: c is one of the characters 'A' through 'Z'. // Postcondition: The method has printed a pattern of letters // as follows: // 1. If the parameter c is 'A', then the output is 'A'. // 2. For other values of c, the output consists of three parts: // -- the output for the previous letter (c-1); // -- followed by the letter c itself; // -- followed by a second copy of the output for the previous letter. // There is no '\n' printed at the end of the output. 

    Any help is greatly appreciated! Also if someone can help me format this code so that it shows up horizontally like a box like this.

    THERBLIG1.1.THERBLIG1.2.THERBLIG1.3.THERBLIG1.4.THERBLIG1.5.THERBLIG1.6.THERBLIG1.7.THERBLIG1.8.THERBLIG1.9.

    THERBLIG2.1.THERBLIG2.2.THERBLIG2.3.THERBLIG2.4.THERBLIG2.5.THERBLIG2.6.THERBLIG2.7.THERBLIG2.8.THERBLIG2.9.

    THERBLIG3.1.THERBLIG3.2.THERBLIG3.3.THERBLIG3.4.THERBLIG3.5.THERBLIG3.6.THERBLIG3.7.THERBLIG3.8.THERBLIG3.9.

    THERBLIG4.1.THERBLIG4.2.THERBLIG4.3.THERBLIG4.4.THERBLIG4.5.THERBLIG4.6.THERBLIG4.7.THERBLIG4.8.THERBLIG4.9.

    THERBLIG5.1.THERBLIG5.2.THERBLIG5.3.THERBLIG5.4.THERBLIG5.5.THERBLIG5.6.THERBLIG5.7.THERBLIG5.8.THERBLIG5.9.

    THERBLIG6.1.THERBLIG6.2.THERBLIG6.3.THERBLIG6.4.THERBLIG6.5.THERBLIG6.6.THERBLIG6.7.THERBLIG6.8.THERBLIG6.9.

    THERBLIG7.1.THERBLIG7.2.THERBLIG7.3.THERBLIG7.4.THERBLIG7.5.THERBLIG7.6.THERBLIG7.7.THERBLIG7.8.THERBLIG7.9.

    THERBLIG8.1.THERBLIG8.2.THERBLIG8.3.THERBLIG8.4.THERBLIG8.5.THERBLIG8.6.THERBLIG8.7.THERBLIG8.8.THERBLIG8.9.

    THERBLIG9.1.THERBLIG9.2.THERBLIG9.3.THERBLIG9.4.THERBLIG9.5.THERBLIG9.6.THERBLIG9.7.THERBLIG9.8.THERBLIG9.9.

    That would also be greatly appreciated!

    public static void numbers(String prefix, int levels) { // The method prints output consisting of the String prefix followed by "section numbers" of the form 1.1., 1.2., 1.3., and so on. // The levels argument determines how many levels the section numbers have. // The stopping case occurs when levels reaches zero (in which case the prefix is printed once by itself followed by nothing else). if (levels <= 0) return; else if (levels == 1) { printLevelsSub(prefix, 1); } else { for (int i = 1; i <= 9; i++) { printLevelsSub(prefix + i + ".", levels-1); } } } public static void printLevelsSub(String prefix, int count) { if (count >= 10) { return; } else { System.out.println(prefix + count + "."); printLevelsSub(prefix, count + 1); } } public static void main1(String[] args) { printLevelsSub("Box:", 3); } 

    submitted by /u/Criaden
    [link] [comments]

    Need help with "illegal escape character in string literal" while trying to put a string inside a json object in android

    Posted: 06 Nov 2018 05:38 PM PST

    i have a wcf rest service where the dates it recieves have this format

    \/Date(1539147600000)\/

    is there a way to accomplish this format in android studio using java?

    this is my string

    String date = "\\/Date("+simpleFormatDate.getTime()+")\\/";

    then i put this in

    JSONObject postData = new JSONObject();

    postData.put("date",date);

    when i print the object on the console i get

    {"date":"\\\/Date(1539147600000)\\\/"}

    which is not valid for my service, if i take out 1 of the " \ " i get the "illegal escape character in string literal" from my String "date"

    submitted by /u/HeroOfWind
    [link] [comments]

    High quality, custom GUIs?

    Posted: 06 Nov 2018 03:55 AM PST

    This is really difficult to explain properly and I know it's a really complex question that has many answers, but I'm curious to know what technology is used to make GUIs such as:

    1.) Steam Big Picture Mode

    2.) Kodi

    3.) Xbox 360 Dashboard Library

    I know you can do it with C# and XAML but it doesn't seem "real" in the sense that I haven't seen any way to make a a true/real fullscreen application. Most of the solutions I've been able to find for "true" fullscreen just involve setting WindowState to maximum and using some code to make sure the taskbar doesn't overlap and other such tricks. What I'd like to know is how to make true fullscreen applications like you would find in games or steam big picture. The kind where you can have a 640x480 game take up the entire screen while running the desktop in a completely different resolution. If you tab between the two, you get a momentary pause as the monitor switches video resolution.

    So what technology do I need to learn for this? SDL? D3D/DirectX ? OpenGL? Windows API programming?

    I know this wasn't a great description but hopefully you get the idea.

    Thanks!

    submitted by /u/-CJF-
    [link] [comments]

    I'm majoring in CPIS. Is it a programming degree like computer science?

    Posted: 06 Nov 2018 12:36 PM PST

    So my end goal after i graduating is to head towards the dev field. They dont offer a comp sci degree where i go so this is the best thing. CPIS stand for computer programming and information systems. You basically get to pick which area you want take more classes in ether system, network, programming, web or database. each one basically gives you 4 different classes then the other choices. I obviously picked the programming track. So far these are the programming classes in order i would have taken by the time i graduate.

    1. intro c++
    2. unix (basically intro batch programming)

    3. c++

    4. java

    5. intro sql

    6. java andriod app dev

    7. sql

    8. pearl

    9. XML or PHP (i havent decided yet)

    10. Data Structures c++

    11. big group project developing application for senior project.

    Compared to Computer Science majors how many did you take and is this an appropriate amount of programming classes/exposure to head towards that field? Some of the other classes required are like Networking and other computer related stuff.

    submitted by /u/Sociallyflyingbutter
    [link] [comments]

    What coding programs are most necessary in robotics?

    Posted: 06 Nov 2018 10:17 AM PST

    As someone who knows absolutely NOTHING about code, what steps can I take during my free time to develop the skills necessary to get a job?

    Posted: 06 Nov 2018 09:49 AM PST

    I apologize in advance if this is the wrong place to ask and if so, I will gladly redirect my question to the appropriate sub. I also realize this answer may be easily googled instead of posted on reddit. However I decided to post because I prefer real life answers as opposed to the random articles that popped up when I googled this question that didn't really give me any personal experience in the answer. Plus, I would like the opportunity to ask questions if need be.

    I work as a restaurant manager. I love my job and enjoy going to work every day. With that being said, I'm not convinced it's my passion. It pay the bills just fine and leaves me with plenty left over. I don't take a lot of work home with me so during my days off I'm left pretty free. This is very nice but also leaves me feeling hollow sometimes. I have pc just I feel just stares at me, waiting for me to learn how to program and code it. I think it would be so cool to learn computer language and how to manipulate/control/fix it. My issue is that I work 40-50 hours a week and can't go to school full time for programming. I'm not opposed to school, but it would be difficult for me at the moment to complete a degree. This begins my first question: is it possible to enter a programming or even IT career without a degree in the beginning?

    My second question is this: what can I do now to develop my coding skills? I'm currently in Barnes n noble as I type this and see a ton of books on how to program. Would purchasing these books, and learning them inside and out, actually help me? Sure it would teach me how to program, but without a degree how would I use this to get a job?

    And for my final question, one that's probably ignorant so I do apologize: what is it exactly that you guys do all day? The idea of programming really interests me, but other than that I have no clue what a day in the life of someone who programs entails

    Again, if this is the wrong place to post I do apologize and will happily move my question. I'm engaged and want to have a family I can spend lots of time with some day. I know the world today is technologically based and only progresses to stay that way. I see sustainability and security in this field and that's all I want in life. Thanks for taking the time to read this and I look forward to your answers, advice, and direction.

    submitted by /u/sonnybrew
    [link] [comments]

    Designing an interactive chemistry app in python, but having difficulty using npyscreen

    Posted: 06 Nov 2018 03:45 PM PST

    I am trying to create an interactive program using npyscreen. The end result is going to be an interactive periodic table, but for now I am trying to trigger a form to open when enter is pressed on a cell in the grid. I have been attempting to add handlers like in the docs, but the documentation for this library is extremely vague and lacks good examples. I don't think there is a way to map actual button objects to a grid. I am planning on using a hotkey to trigger a function using the value of the current cell as input.

    The commented widget in the main function is the popup I want to trigger. I am attempting to even trigger an exit hotkey, but no dice.

    Here is my code:

    import npyscreen import curses # Modified grid class rigged to show periodic table class pTable(npyscreen.GridColTitles): # 2D array of cells that represent the elements in the periodic table elements = [['H ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', 'He'], ['Li', 'Be', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', 'B ', 'C ', 'N ', 'O ', 'F ', 'Ne'], ['Na', 'Mg', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', 'Al', 'Si', 'P ', 'S ', 'Cl', 'Ar'], ['K ', 'Ca', 'Sc', 'Ti', 'V ', 'Cr', 'Mn', 'Fe', 'Co', 'Ni', 'Cu', 'Zn', 'Ga', 'Ge', 'As', 'Se', 'Br', 'Kr'], ['Rb', 'Sr', 'Y ', 'Zr', 'Nb', 'Mo', 'Tc', 'Ru', 'Rh', 'Pd', 'Ag', 'Cd', 'In', 'Sn', 'Sb', 'Te', 'I ', 'Xe'], ['Cs', 'Ba', '↓ ', 'Hf', 'Ta', 'W ', 'Re', 'Os', 'Ir', 'Pt', 'Au', 'Hg', 'Tl', 'Pb', 'Bi', 'Po', 'At', 'Rn'], ['Fr', 'Ra', '↓ ', 'Rf', 'Db', 'Sg', 'Bh', 'Hs', 'Mt', 'Ds', 'Rg', 'Cn', 'Nh', 'Fl', 'Mc', 'Lv', 'Ts', 'Og'], [' ', ' ', '↓ ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '], [' ', ' ', '→ ', 'La', 'Ce', 'Pr', 'Nd', 'Pm', 'Sm', 'Eu', 'Gd', 'Tb', 'Dy', 'Ho', 'Er', 'Tm', 'Yb', 'Lu'], [' ', ' ', '→ ', 'Ac', 'Th', 'Pa', 'U ', 'Np', 'Pu', 'Am', 'Cm', 'Bk', 'Cf', 'Es', 'Fm', 'Md', 'No', 'Lr'] ] # Array of numbers used to lable the periods of the table periods = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18'] def exit_application(self, *args): self.parent.shutdown() self.editing = False raise SystemExit def create(self): self.add_handlers({curses.KEY_RIGHT: self.exit_application}) # Main function def myFunction(*args): values = {"values": ['test', 'values']} # Initializes blank form F = npyscreen.ActionFormV2(name='Periodic Table') # Initializes Periodic Table F.add(pTable, col_titles=pTable.periods, values=pTable.elements, relx=5, rely=2, width=80, columns=18) # Code to display generic info panel #F.add(npyscreen.BoxTitle, _contained_widget='TitlePager', name='ELEMENT NAME', contained_widget_arguments=values) # Begins user interaction mode F.edit() # Launches "myFunction" in npyscreen wrapper if __name__ == '__main__': npyscreen.wrapper_basic(myFunction) 

    I also replicated this setup using the "NPSApplicationManaged" setup method, but even attempting to 'setnextform' gives me errors.

    submitted by /u/Ken_Mcnutt
    [link] [comments]

    Is there a such thing as disabling certain queries against an SQL server for security purposes?

    Posted: 06 Nov 2018 02:18 PM PST

    I was wondering if any SQL server types has the ability/feature to disable certain queries such as DROP DATABASE <db> to enhance security.

    Thanks.

    submitted by /u/HelloImQ
    [link] [comments]

    What are the best PHP frameworks to build an e-commerce website ?

    Posted: 06 Nov 2018 12:45 PM PST

    How would I condense this? Trace an expression tree. I did it step by step but it needs to be one.

    Posted: 06 Nov 2018 12:21 PM PST

    https://imgur.com/a/P3hhcWN Here is what I have done. How would I make this into one tree?

    submitted by /u/spiritewolf
    [link] [comments]

    How to make a simple app that searches for vertical pictures?

    Posted: 06 Nov 2018 05:23 AM PST

    I need to make an app that searches for vertical pictures, apparently its simple but i cannot find anything about it on google. Can anybody guide me into the correct path on how to make it ? Thank you for help !

    submitted by /u/-i3arty-
    [link] [comments]

    "Scroll to Top" Div to Appear on Scroll

    Posted: 06 Nov 2018 07:40 AM PST

    I am trying to create a Scroll to Top button that will appear in the bottom right-hand corner once the user has scrolled down a certain number of pixels. Unfortunately, the button is simply not appearing. I know it's there because if I remove display: none; from the div properties, it shows and works. However, I don't want it to show when the user's position is at the top of the page.

    I am using the following code as borrowed from W3Schools (https://www.w3schools.com/howto/tryit.asp?filename=tryhow_js_scroll_to_top):

    CSS:

    #myBtn {

    `display: none;` `position: fixed;` `bottom: 20px;` `right: 30px;` `z-index: 99;` `font-size: 18px;` `border: none;` `outline: none;` `background-color: red;` `color: white;` `cursor: pointer;` `padding: 15px;` `border-radius: 4px;` 

    }

    HTML:

    <button onclick="topFunction()" id="myBtn" title="Go to top">Top</button>

    JS:

    <script>

    `// When the user scrolls down 20px from the top of the document, show the button` `window.onscroll = function() {scrollFunction()};` `function scrollFunction() {` `if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) {` `document.getElementById("myBtn").style.display = "block";` `} else {` `document.getElementById("myBtn").style.display = "none";` `}` `}` `// When the user clicks on the button, scroll to the top of the document` `function topFunction() {` `document.body.scrollTop = 0;` `document.documentElement.scrollTop = 0;` `}` 

    </script>

    JSFiddle - Working in JSFiddle but not on my page... are there any common errors that I might have made and might not be aware of?

    Any help would be greatly appreciated!

    Many thanks!

    submitted by /u/RelevantOpposite
    [link] [comments]

    Algorithm/Data Structure to join lines that intersect

    Posted: 06 Nov 2018 06:26 AM PST

    Hello, I have a series of vertical and horizontal lines (see below image). I want to group all lines that intersect into separate groups. So if a horizontal line intersects a vertical line they become part of a group 0, then if another line intersects any lines in group 0 then they also get accumulated into the group 0.

    Edited with another image to remove broken lines
    https://imgur.com/a/4VDLNHv

    Eventually I will have segments, ie, a series of points (start and end of each line) that I can then convex hull to produce segments (in the above image see the red areas).

    Can you suggest algorithms, data structures or even naive iterative solutions? I have attempted to implement a naive iterative solution however its harder than it appears, I seem to join all lines into the same group/segment.

    Details: In the above images, the 'broken' lines, ie, the dots are still considered part of the preceeding line. What criteria constitutes an intersection? If 2 lines that are perpendicular touch in any way it is considered an intersection, so an L shape counts. But parallel lines that touch do not count.

    def find_signal_intersections(src): global segments tmp_h_signals = h_signals tmp_v_signals = v_signals v_label_map = {} h_label_map = {} label_index = 1 for i, signal in enumerate(tmp_h_signals): for j, v_signal in enumerate(tmp_v_signals): inter = intersection(signal, v_signal) if not inter: continue # if the vertical line already has a label/class/group: then the horiz line should assume this label/class/group # a problem arises when both intersecting lines already have a label/class/group. What to do? if j in v_label_map: lbl = v_label_map[j] h_label_map[i] = lbl if not lbl in segments: segments[lbl] = [] segments[lbl].append(signal[0]) segments[lbl].append(signal[1]) segments[lbl].append(v_signal[0]) segments[lbl].append(v_signal[1]) # if the horiz line already has a label/class/group: then the vertical line should assume this label/class/group elif i in h_label_map: lbl = h_label_map[i] v_label_map[j] = lbl h_label_map[i] = lbl if not lbl in segments: segments[lbl] = [] segments[lbl].append(signal[0]) segments[lbl].append(signal[1]) segments[lbl].append(v_signal[0]) segments[lbl].append(v_signal[1]) # create new label/class/group else: lbl = label_index label_index += 1 v_label_map[j] = lbl h_label_map[i] = lbl if not lbl in segments: segments[lbl] = [] segments[lbl].append(signal[0]) segments[lbl].append(signal[1]) segments[lbl].append(v_signal[0]) segments[lbl].append(v_signal[1]) # Show segments found for lbl, pts in segments.items(): tmp = src.copy() p = cv2.convexHull(np.array(pts), False) cv2.drawContours(tmp, [p], -1, (255,0,0), -1) cv2.imshow('segment', tmp) cv2.waitKey(0) 
    submitted by /u/sqzr2
    [link] [comments]

    10 minute watch preview bypass

    Posted: 06 Nov 2018 05:55 AM PST

    i need your help

    there is a page where you can watch a preview livestream for 10minutes. after the 10 minutes you have to log in with your provider. but if you open icognito and reload the page you get another 10 minutes. so basically you can do this as often as you wish but you have to open a new tab everytime.

    is there a way to get the source code or something so i dont have to reload everytime ?

    submitted by /u/MetroBoominGG
    [link] [comments]

    How do i get a webelement to show me its content?

    Posted: 06 Nov 2018 01:35 AM PST

    Hey

    so im using firefox inspect element and with a lot of hard work i have come up with this code/console command that i use to get the latest message/chat message sent by a freind:

    pizza = document.getElementsByClassName('message-text','textContent') lastSelect = pizza [pizza .length-1]; getnumberlasttext= pizza .length-1 gwt = document.getElementsByClassName('message-text','textContent')[getnumberlasttext]

    so what it does is, it gets all the text messages in the chat room then it shows me the most recent one and its here the problem is it shows me the latest message but its not the webelement it shows me

    this is the output: https://pastebin.com/6Y5rqcEv

    and this is what i want the output to show me: textContent: "Lippy😍👅"

    aka the inside of textContent but i dont know what im doing wrong i have tried switching around the commands and other web elements and all.

    how it looks in the browser: https://ibb.co/cF4GFA

    submitted by /u/GitFloowSnaake
    [link] [comments]

    No comments:

    Post a Comment