• Breaking News

    Saturday, February 10, 2018

    Refused to connect '[microsoft website]' because it violates the following Content Security Policy directive ect Ask Programming

    Refused to connect '[microsoft website]' because it violates the following Content Security Policy directive ect Ask Programming


    Refused to connect '[microsoft website]' because it violates the following Content Security Policy directive ect

    Posted: 10 Feb 2018 10:13 PM PST

    Has anyone experienced this? I currently have a google chrome extension (attempting) to use the microsoft text analytics api. I'm able to ping the website with postman so I know it exist.

    Changing my manifest.json file doesn't seem to be helping: "manifest_version": 2, "content_security_policy":"script-src 'self' https://twitter.com https://eastus.api.cognitive.microsoft.com/text/analytics/v2.0/sentiment 'unsafe-inline' 'unsafe-eval';", "name": "Twitter Save", "permissions": [ "activeTab", "tabs", "https://twitter.com/*" , "storage" ], "short_name": "Tsave", "version": "1.0.0"

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

    getting results of zero dollars within my switch statements?

    Posted: 10 Feb 2018 09:54 PM PST

    hey guys, i had a question about my program. for some reason, i am getting results of zero dollars for a lot of variables when the program runs, and i don't know why.

    https://pastebin.com/V7ZvSKTj

    for some reason, a lot of my results are ending up like this.

    How many hours did you work this week? 1 Your gross salary is $14.85. The total tax of your salary is $0.00 which brings your salary to $0.00 After our $27.85 deduction for health insurance, your total net salary is -27.85 i don't know why im getting a result of zero for a lot of these, especially since i have a working formula for each variable. any help would be appreciated.

    submitted by /u/2kool4jewschool
    [link] [comments]

    Getting 'Permission denied' for certain commands in Documents folder.

    Posted: 10 Feb 2018 06:07 PM PST

    I'm new to all of this so I'm hoping this is a relatively simple question. It seems like I don't have write permission inside my own Documents folder when using Cygwin. I first tried to clone a GitHub repo to a folder on my computer which didn't work. I also can't seem to make or remove directories. I get something like this:

    mkdir: cannot create directory 'testfolder': Permission denied

    I've tried running Cygwin as administrator which didn't work and I've checked permissions for my Documents folder and it seems like all users have Full Control. For some reason, I don't get these permission errors if I move up to C:. Any help would be greatly appreciated.

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

    Workplace coding standards lacking in office should I suggest improving?

    Posted: 10 Feb 2018 02:12 PM PST

    Not sure if this is the exact spot to post this. But I am a relatively new developer at a small company and I am noticing that there isn't a lot of structure with the coding standards so that makes the organization of the code poor in my experience. I don't have enough experience with workplace coding standards so if anyone has suggestions or documentation I can take a look at related to this that would be helpful.

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

    Help differentiating between full screen windows with WinApi.

    Posted: 10 Feb 2018 04:00 PM PST

    Hello everybody. I am writing an application in C# that activates the WIN+TAB menu with keyboard hooks. It works well except now I want to make it so it does not activate when an application is fullscreen. I got that mostly working by checking the bounds of the active foreground window against the desktop window with GetForegroundWindow, GetDesktopWindow, and GetWindowRect. If they are the same size, then the program is fullscreen.

    The problem is that the WIN+TAB menu itself is detected as a fullscreen application. Once it is brought up, I want the same action to make it go away. Does anybody with some experience with windows api know how I can differentiate between things like fullscreen games and this WIN+TAB screen? I was looking at GetWindowInfo, but I'm not sure which of the properties in the WINDOWINFO struct might be useful.

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

    SQL/PHP How to combine three tables into one?

    Posted: 10 Feb 2018 06:48 PM PST

    Here are three tables, please let me know how to write my SELECT statement. Im kind of confused on how to use my inner joins (1) tblDVDActors https://gyazo.com/ec37fb0050bc6604a2c93e83c66e0012

    (2) tblDVDTitles https://gyazo.com/5d1de0ec7e88045008634c7d70a2346c

    (3) This table (tblDVDActorsTitles) is a composite key table that combines ASIN (from tblDVDTitles) and ActorID (from tblDVDActors) https://gyazo.com/2c9eb5810ba907232eccdcd410dac564

    I want it to be combined like this: https://gyazo.com/da222495523655e4b99d23e649dc4f7f

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

    [Powershell] trying to display information before I start disabling accounts

    Posted: 10 Feb 2018 06:07 PM PST

    Trying to get this command to display the SAMAccountName, DistinguishedName, and LastLogonDate before it prompts me to confirm disabling each account. However, it prompts into confirming disabling the inactive accounts, and then displays the information after. Any help would be appreciated.

     Search-ADAccount –AccountInActive –DateTime $stale | Select-Object SamAccountName, DistinguishedName, LastLogonDate | Set-ADUser -Enabled $false -confirm 
    submitted by /u/Ridicadonkey
    [link] [comments]

    How to make an app that redirects to a website?

    Posted: 10 Feb 2018 05:42 PM PST

    Hello, I would like to make an app that redirects to a website. How do i accomplish this?

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

    [JAVA] Caesar Cipher Help!

    Posted: 10 Feb 2018 05:02 PM PST

    Hello!

    I am currently writing a non-static class that does a Caesar Cipher. The user inputs any String and any key they want.

    I'm having some difficulty with my code. Here is what I have:

    public String changeString(){ StringBuilder strBuilder = new StringBuilder(); for (int i=0;i<enteredString.length();i++) { if(Character.isLetter(enteredString.charAt(i))) { char encipherChar = (char)((enteredString.charAt(i)+shiftParameter)); strBuilder.append(encipherChar); } else { strBuilder.append(enteredString.charAt(i)); } } return strBuilder.toString(); } 

    If I use modulo 26 on the shift, it won't print anything(like when I call this method within a print statement). Also, I need to be able to shift using a negative parameter, so for instance, if it was -1, a would become z, and 0 would become 9. Can anyone help?

    submitted by /u/50mac50
    [link] [comments]

    Is there thread-safe string to float parsing in C?

    Posted: 10 Feb 2018 10:55 AM PST

    I'm parsing a csv file, getting the 5th column, and then calling strtod(val, NULL) on it but ____strtod_l_internal() from usr/lib/libc is causing a segmentation fault.

    Is there a way to convert from string to double in a thread safe manner?

    The threads are only sharing an index counter and a array of strings that are the file names and those are protected by mutex_lock and unlock.

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

    Schooling?

    Posted: 10 Feb 2018 04:19 PM PST

    Hello!

    I am interested in programming, and pursuing it as a career.

    What is the best route to take, though? I can:

    Attend my local community college and get a AAS in Computer Information Technology, with a focus on programming and web/app development.

    Attend a University and get a BS in Computer Science.

    Attend a University and get a BS in Software Engineering.

    If you work as a programmer, what education do you have, and/or what education level do jobs look for?

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

    what does this Linux command mean?

    Posted: 10 Feb 2018 03:34 PM PST

    I have a C# code that sends linux commands. I am new to linux so not sure what these commands do.

    " | xxd -p -c 1000" xxd - make a hexdump. Is -p the same as -ps? what does "-c 1000" do? There is some other command before the pipe line.

    "find / -name redis-cli 2>&1 | grep -v \"Permission denied\""

    "2>&1" redirect STDERR to STDOUT, so that means if there is an error, it would write it out to STDOUT?

    "|" makes the output of the first command the input of the second command.

    -v means "invert the match" in grep, in other words, return all non matching lines.

    This means you want to find all the names that have "redis-cli" then return all the info besides \"Permission denied\"?

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

    Trying to comprehend Structures in C?

    Posted: 10 Feb 2018 01:03 PM PST

    I'm currently taking Compsci 201 in my college. We just learned structures. For our lab, we need to write a program that inserts a node in a linked list after a given node.

    At the beginning of the file, it lists this line:

    #include "part5.h" extern struct list_node *alloc_node(void); 

    part5.h:

     struct list_node { int value; struct list_node *next; } 

    I learned in class that to create an instance(or whatever C calls an "object", I know they don't have objects) of a structure, you need to write this: struct (structure name) (name of instance);

    But this line extern struct list_node *alloc_node(void); Says something different. What is extern, and more importantly, what is *alloc_node(void) in this question?

    Thank you for your help,

    -Jonathan Kim

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

    [Python 3] Multiprocessing doesn't run the target subroutine.

    Posted: 10 Feb 2018 12:07 PM PST

    def PeopleGen(): #THIS SUBROUTINE randFirstName = randint(0,len(firstNames) - 1) randLastName = randint(0,len(lastNames) - 1) name = str(firstNames[randFirstName] + " " + lastNames[randLastName]) people[name] = {} people[name]["name"] = name #NameData age = int(normalvariate(AvAge,AgeDev)) people[name]["age"] = age #AgeData FetchJob() people[name]["income"] = income #IncomeData people[name]["job"] = finaljob #JobData filename = str(location) + ".csv" file_exists = os.path.isfile(filename) if not file_exists: with open (str(location + ".csv"), "a") as csvfile: fieldnames = people[name] writer = csv.DictWriter(csvfile, fieldnames = fieldnames) writer.writeheader() writer.writerow(people[name]) if file_exists: with open (str(location + ".csv"), "a") as csvfile: fieldnames = people[name] writer = csv.DictWriter(csvfile, fieldnames = fieldnames) writer.writerow(people[name]) print(people[name]["name"],"-",people[name]["age"],"-",people[name]["status"], people[name]["job"],"-",people[name]["income"]) def GenNew(): #THIS SUBROUTINE global population population = int(input("How many people to you want to generate? \n")) PeopleGenInit() for i in range(population): p = multiprocessing.Process(target=PeopleGen) p.start() def main(): ProgramInfo() if __name__ == "__main__": GenNew() main() 

    For some reason, the multiprocess in GenNew() doesn't call the PoepleGen() subroutine. It just pauses for a moment, then goes onto a new input line.

    EDIT: There is more to the program than this, but these are the relevant sections. It won't work to test it, because it relies on csv files, which i have disabled the creation of for now.

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

    Been on a haitus from programming, where can I go to learn the "latest" technologies for languages, databases, frameworks, etc?

    Posted: 10 Feb 2018 10:24 AM PST

    How to write my own instagram bot?

    Posted: 10 Feb 2018 02:05 PM PST

    Hi there, I want to know how to write the simpliest instagram bot possible. I have some programming experience, as far as I understand, this bot has to be in python, no? I have tried google and github, but all i get are already written bots and no guide on how to create it yourself. I am also not that experienced, since i don't get how to do it just by reading the code, which also seem complicated for me.

    I want it to have this basic function :

    Log in, open a profile, open its followers and simply follow them in a row.

    And also - is it possible when opening the followers, to continue the list from where I left last time, or from the bottom->top?

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

    How can I improve this flowchart?

    Posted: 10 Feb 2018 09:05 AM PST

    Hi all,

    I'm attempting to write a FORTRAN program that calculates the surface integral for the magnetic field B at any point outside of a bar magnet.

    This is the method I will be using for the surface integral: http://prntscr.com/icuqtj

    And the key equation, just in case it's helpful: http://prntscr.com/icuqka

    Here is my flowchart at the moment: http://prntscr.com/icur0u

    I really struggled to make this, and know it's a bad flowchart. How can I improve it? Any suggestions?

    Thank you

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

    Is it allowed to host a twitter bot on a Namecheap shared hosting server?

    Posted: 10 Feb 2018 08:11 AM PST

    Implementing multiple dropdowns in a navbar in CSS

    Posted: 10 Feb 2018 06:19 AM PST

    Hi, been fiddling with this code to try and get multiple drowndowns on the top bar but it won't work can anyone show me what way I should have the code to use multiple dropdowns? https://www.w3schools.com/css/tryit.asp?filename=trycss_dropdown_navbar

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

    Need help with this piece of code i have

    Posted: 10 Feb 2018 01:42 AM PST

    i am trying to get my computer to do this for me every time i start my computer or log into it. the idea is that i want my computer to speak it a little quicker in rate, and i would like it a female voice instead of male. this is the code below.

    Set Sapi = Wscript.CreateObject("SAPI.SpVoice") dim str if hour(time) < 12 then Sapi.speak "Good Morning Colin " else if hour(time) > 12 then if hour(time) > 16 then Sapi.speak "Good evening Colin " else Sapi.speak "Good afternoon Colin " end if end if end if Sapi.speak "The current time is" if hour(time) > 12 then Sapi.speak hour(time)-12 else if hour(time) = 0 then Sapi.speak "12" else Sapi.speak hour(time) end if end if if minute(time) < 10 then Sapi.speak "o" if minute(time) < 1 then Sapi.speak "clock" else Sapi.speak minute(time) end if else Sapi.speak minute(time) end if if hour(time) > 12 then Sapi.speak "P.M." else if hour(time) = 0 then if minute(time) = 0 then Sapi.speak "Midnight" else Sapi.speak "A.M." end if else if hour(time) = 12 then if minute(time) = 0 then Sapi.speak "Noon" else Sapi.speak "P.M." end if else Sapi.speak "A.M." end if end if end if

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

    Help needed.

    Posted: 10 Feb 2018 12:59 AM PST

    Hello!

    I am just asking for some tips on some good and free programming software that I can just play around with. I know of unity but are there anything else?

    For creating games.

    submitted by /u/Alto-AI
    [link] [comments]

    No comments:

    Post a Comment