• Breaking News

    Saturday, May 25, 2019

    What (old/obscure?) (math-oriented?) language is this? Ask Programming

    What (old/obscure?) (math-oriented?) language is this? Ask Programming


    What (old/obscure?) (math-oriented?) language is this?

    Posted: 25 May 2019 08:01 PM PDT

    From this page on wayback

    Supposedly the file is named lmtwister.gp, and .gp seems to be an extension for Gofer, an earliy dialect of Haskell. But this is way too legible for a Haskell dialect.

    In particular, what is the lift function, and is Mod()^ supposed to be modular exponentiation?

    lmtwister (d, x) = { my (k, a, v, p, m, b, u); if (d < 1 || d % 2 == 0 || x < 1, error ("illegal argument: lmtwister (", d, ", ", x, ")")); k = (d - 1) / 2; x = core (x); \\squarefree part if (x == 1, if (k % 3 == 1, return (0)); \\not used in LM twister return (1)); a = 1; v = factorint (x)[, 1]; for (i = 1, #v, p = v[i]; \\prime factor of squarefree x if (p == 2, m = k % 4; if (m == 1 || m == 2, a = -a), b = k + (p + 1) / 2; if (gcd (b, p) > 1, return (0)); \\not used in LM twister u = (p - 1) / 2; m = p % 8; if ((m == 1 && Mod (b, p) ^ u != 1) || (m == 3 && lift (Mod (b, 2 * p) ^ u) > p) || (m == 5 && Mod (b, p) ^ u == 1) || (m == 7 && lift (Mod (b, 2 * p) ^ u) < p), \\use a faster method than this a = -a))); a } test_lmtwister () = { for (x = 1, 200, for (k = 0, 399, print1 (["-", ".", "+"][lmtwister (2 * k + 1, x) + 2])); print ()) } 1; 
    submitted by /u/o11c
    [link] [comments]

    Why in 2019 does Twitter & other platforms substitute the character “&” with “&amp;”? I mean the character is right in the longer version of the substituted text. Why is this a common thing?

    Posted: 25 May 2019 03:26 PM PDT

    Sorry if this is not the right place for this question.

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

    What should I learn next

    Posted: 25 May 2019 05:31 PM PDT

    I have already learned python, and right now I am thinking of learning one of the C's (C, C#, C++). Which one do you guys think is the most suitable?

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

    How does one get variables from a path?

    Posted: 25 May 2019 07:11 AM PDT

    Hey,

    This might sound like a stupid question but, oh well..

    Like 90% of websites use path to navigate to some content, for example

    https://trello.com/b/d8W7gh46/projectname

    In this example, how are "b" ,"d8W7gh46" and "projectname" variables received to show the specific content I want? Are they directories?

    I'm using Apache2 and PHP as my backend.

    Thanks

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

    Help!!

    Posted: 25 May 2019 06:47 PM PDT

    Hey guys, I'm new to programming in general , currently I'm working on my first project which is a bot for a video game.The only problem I faced until now is that when I tried to locate on screen a monster in the game which can appear in one of his four forms I got lost, because I don't know how to make my coding make decision and choose the right screenshot to start its locating.It would be great if anyone can Help don't hesitate to comment or send me a private message please :)

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

    Hello Friends, I am looking for feedback on the video tutorial. Thanks in advance for your feedback and helping me to share my knowledge with wider tech community.

    Posted: 25 May 2019 06:31 PM PDT

    What is the most efficient way to make a job board for a college club?

    Posted: 25 May 2019 11:52 AM PDT

    We had the idea of making a job board where older graduates of the club who are hiring can post the job for all alumni to see? It doesn't need complete detailed application entry capabilities, the main thing is letting everyone know about openings

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

    The Signal Protocol and AGPL License

    Posted: 25 May 2019 05:18 PM PDT

    I have an application that I am writing that has a chat component to it, so I was looking around at popular messaging protocols. I settled on Signal, and was super happy their code was OS, but their libraries are licensed under AGPL. I found this website#summary) that outlined the stipulations that go along with using AGPL software, but some of them confused me. The main one, being that you are allowed to use it for commercial use, but at the same time, your derivatives or code that implements the software licensed under AGPL has to be open source as well. I was planning on trying to monetize the application I am writing so naturally I wasn't going to make it all open source, but I guess if I want to utilize Signal's official libraries I need to? I'm not exactly sure it would be safe or practical for me to attempt writing an implementation myself.

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

    Help with Graphics display in paintComponent

    Posted: 25 May 2019 09:39 AM PDT

    Here is my predicament:

    I'm trying to code a Tile for my game project that will eventually be incorporated into a double array. My problem lies in the fact that when I instantiate my texture, in this case, a PNG, anywhere other than the paintComponent() method and try invoking g.drawImage() it won't show up on screen. The curious thing is that when I do instantiate the texture inside paintComponent() I can print it just fine. Why is this the case?

    Here is my code for reference, that DOES work:

    public class Skeleton extends JPanel { BufferedImage img = null; public Skeleton() { Thread thread = new Thread() { public void run() { while (true) { repaint(); } } }; thread.start(); } @Override public void paintComponent(Graphics g) { super.paintComponent(g); BufferedImage[][] board = null; board = setup(); // TRUST ME! I know that's bad and super inefficient. But this sort of illustrates // My point of the whole double array thing. g.drawImage(board[1][1], 50, 50, null); g.drawImage(board[1][2], 50, 100, null); } public static void main(String args[]) { JFrame window = new JFrame(); window.setTitle("Game"); window.setResizable(false); window.setSize(900,700); window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); window.setVisible(true); window.setContentPane(new Skeleton()); } public BufferedImage[][] setup() { BufferedImage[][] ret = new BufferedImage[20][20]; for (int i = 0; i < 20; i++) { for (int j = 0; j < 20; j++) { try{ ret[i][j] = ImageIO.read(new File("myTexture.png")); }catch (IOException e){ System.out.println("Loading png failed"); } } } return ret; } } 

    This is what the original looked like, not with the double array:

    public class Skeleton extends JPanel { BufferedImage img = null; public Skeleton() { Thread thread = new Thread() { public void run() { while (true) { repaint(); } } }; thread.start(); } @Override public void paintComponent(Graphics g) { super.paintComponent(g); try{ img = ImageIO.read(new File(myTexture.png)); }catch(IOException e){ System.out.println("Loading texture failed."); } g.drawImage(img, 50, 50, null); } public static void main(String args[]) { JFrame window = new JFrame(); window.setTitle("Game"); window.setResizable(false); window.setSize(900,700); window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); window.setVisible(true); window.setContentPane(new Skeleton()); } } 

    Do you guys understand why this is happening? I'd like to be able to instantiate it elsewhere, not do it inside the paintComponents. That's just super inefficient.

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

    How does this app communicate and interact with other apps like Lyft and Uber (on Android)?

    Posted: 25 May 2019 02:25 PM PDT

    Mystro is an app that lets Uber drivers get optimal rides from each app. You basically make an account, select filters and stuff and it only notifies you when rides from those apps match your filters.

    This is an article explaining how it works: https://therideshareguy.com/can-you-make-more-money-with-the-mystro-app/

    Now, from a development perspective, I'm really curious as to how Mystro can interact with Uber and lyft apps and get the ride information, and even accept the rides and start navigation and know when the driver is in a ride or looking for one etc. I know you can navigate between apps but how do you basically control one from another app in android? Also note that this app isn't for iPhone, so it's probably something that only android allows.

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

    Reading User Profile from Multiple different Social Media services

    Posted: 25 May 2019 07:23 AM PDT

    Just wondering if anyone knows of a service (API) that I can connect to that would allow me to return some very basic info about specific users on various Social Media platforms, like FB and Twitter.

    I want to just pass in the userid and get back thier profile photo, number of followers, maybe recent posts.

    Anyhow...just looking to see if anyone has any ideas.

    I'm fluent in c# and jquery

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

    How can I access a folder through my browser, with XAMPP?

    Posted: 25 May 2019 03:05 AM PDT

    I remember I had to do something within the Apache config, but I forgot what I had to do.

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

    C# - System.Collections.Generic.Dictionary`2.get_Item(TKey key)

    Posted: 25 May 2019 12:38 PM PDT

    I have a project that is using sql server on centOs, its working perfectly on Windows localhost and IIS, but when I deploy the project on centOs 7 and I'm using kestrel web server, it gives me to many errors that I believe are related to the identity that is used for authorization of my project.

    I have no idea what it is saying or what's the problem. Please help me.

    PersonalDataProtector, Line 109 :
    public string Unprotect(string data)

    {

    byte[] plainText;

    // Take our string and convert it back to bytes.

    var payload = Convert.FromBase64String(data);

    var offset = 0;

    // First we extract our key ID and then the appropriate key.

    byte[] keyIdAsBytes = new byte[16];

    Buffer.BlockCopy(payload, offset, keyIdAsBytes, 0, 16);

    var keyIdAsGuid = new Guid(keyIdAsBytes); // Line 109

    var keyId = keyIdAsGuid.ToString();

    var masterKey = Key(keyId);

    offset = 16;

    PostPageAPiController, Line 109:
    var jobUser = await userManager.FindByIdAsync(job.UserId.ToString());

    I have added these codes from other forums, but it didn't work.
    var manager = new ApplicationPartManager();

    manager.ApplicationParts.Add(new AssemblyPart(typeof(Startup).Assembly));

    services.AddSingleton(manager);

    services.AddMvc()

    .SetCompatibilityVersion(CompatibilityVersion.Version_2_2)

    .AddJsonOptions(

    options => options.SerializerSettings.ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore

    );

    The errors are:

    at System.Collections.Generic.Dictionary`2.get_Item(TKey key) at X.Project.DataProtection.PersonalDataProtector.Unprotect(String data) in /root/xProjectFiles/DataProtection/PersonalDataProtector.cs:line 109 at lambda_method(Closure , DbDataReader ) at Microsoft.EntityFrameworkCore.Storage.Internal.TypedRelationalValueBufferFactory.Create(DbDataReader dataReader) at Microsoft.EntityFrameworkCore.Query.Internal.AsyncQueryingEnumerable`1.AsyncEnumerator.BufferlessMoveNext(DbContext _, Boolean buffer, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerExecutionStrategy.ExecuteAsync[TState,TResult](TState state, Func`4 operation, Func`4 verifySucceeded, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.Query.Internal.AsyncQueryingEnumerable`1.AsyncEnumerator.MoveNext(CancellationToken cancellationToken) at System.Linq.AsyncEnumerable.FirstOrDefault_[TSource](IAsyncEnumerable`1 source, CancellationToken cancellationToken) in D:\\a\\1\\s\\Ix.NET\\Source\\System.Interactive.Async\\First.cs:line 144 at Microsoft.EntityFrameworkCore.Query.Internal.AsyncLinqOperatorProvider.TaskResultAsyncEnumerable`1.Enumerator.MoveNext(CancellationToken cancellationToken) at System.Linq.AsyncEnumerable.SelectEnumerableAsyncIterator`2.MoveNextCore(CancellationToken cancellationToken) in D:\\a\\1\\s\\Ix.NET\\Source\\System.Interactive.Async\\Select.cs:line 106 at System.Linq.AsyncEnumerable.AsyncIterator`1.MoveNext(CancellationToken cancellationToken) in D:\\a\\1\\s\\Ix.NET\\Source\\System.Interactive.Async\\AsyncIterator.cs:line 98 at Microsoft.EntityFrameworkCore.Query.Internal.AsyncLinqOperatorProvider.ExceptionInterceptor`1.EnumeratorExceptionInterceptor.MoveNext(CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.ExecuteSingletonAsyncQuery[TResult](QueryContext queryContext, Func`2 compiledQuery, IDiagnosticsLogger`1 logger, Type contextType) at X.Project.Controllers.PostPageApiController.getPrjPostInfos(Int32 id) in /root/xProjectFiles/Controllers/PostPageApiController.cs:line 109 
    submitted by /u/B3HI13
    [link] [comments]

    I need to get a good grasp on Java this summer before transferring schools

    Posted: 25 May 2019 08:50 AM PDT

    Coding Background: So minimal

    Matlab (I was a engineering major) is all I can really claim to be even decent at.

    I've recently decided to go for a CS degree in school and my experience with programming is pretty minimal. I'm transferring from my local community college to University in the Fall and I'll need to be ready to take an "Introduction to Algorithms and Data Structures" class (Java). This summer I am taking an "Introduction to Object Oriented Programming" (Java) course and I was hoping that this would catch me up to be ready for the Algorithms and Data Structures class. Unfortunately the summer course is very lecture heavy and we're two weeks in without even touching code.

    I am not a self taught learner, rather I learn by doing and practice. I'm struggling to find resources that will help prepare me and I'd really hate to start at square one this fall putting off my graduation by maybe two more semesters! I do not mind spending money on resources. I've looked into code academy, and am tempted to purchase their subscription, but I wanted to ask other programmers first what resources they have used to master Java.

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

    C # adding integers to list<> after btn click;

    Posted: 25 May 2019 03:59 AM PDT

    I'm trying to add 2 random dice rolls to a running score for a turn in a dice game.

    I' ve managed to create the random dices and scores, along with the lists. But I'm not able to add the scores to list using loops.

    Could someone explain how to add items to lists using loops? I've posted my code below and in no way asking for someone to do it for me just need an explanation on how to add items to lists using loops.

    Regards.

    CODE:

    private void runScore()

    {

    roll();

    int sum;

    sum = roll();

    List<int> numArray1 = new List<int>();

    List<int> numArray2 = new List<int>();

    int n = Convert.ToInt16(txtBoxPlayerSelect.Text);

    if (n == 1)

    {

    int n1;

    numArray1.Add(sum);

    for (int i = 0; i < numArray1.Count; i++)

    {

    numArray1.Add(sum);

    }

    n1 = numArray2.Sum();

    txtbxP1CumulativeScore.Text = Convert.ToString(n1);

    }

    else if (n == 2)

    {

    int n2;

    numArray2.Add(sum);

    for (int i = 0; i < numArray2.Count; i++)

    {

    //sum = +sum;

    numArray2.Add(sum);

    }

    n2 = numArray2.Sum();

    txtbxP2CumulativeScore.Text = Convert.ToString(n2);

    }

    }

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

    List of places to visit

    Posted: 25 May 2019 04:59 AM PDT

    Me and my girlfriend have a list of places that we wanted to visited, actually, two lists, we keep a Excel document along side with a My Maps map. However, we have to manually sync the two lists, and, for example, we use color coding in My Maps to check the"Already visited" places, where red stands for "Not visited" and green stands for the opposite, so, when we change color in the map, we have to go to the Excel document and mark it as well (and vice-versa). I wanted to make this and every other alteration automaticaly, any tips/ideas?

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

    Exciting Project Ideas

    Posted: 25 May 2019 03:39 AM PDT

    Hello people of reddit,

    I've been looking for a while for a good and exciting project to make. I'm looking to build something advanced and complex, but not a game. Additionally the programming languages don't matter to me.

    p.s: I already tried to google it, but so far couldn't find an idea that I really liked.

    Every idea you have is welcome and also don't hesitate to private message me about it.

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

    Which level is the root folder in this image?

    Posted: 25 May 2019 03:27 AM PDT

    No comments:

    Post a Comment