Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,148,044 members, 7,799,534 topics. Date: Wednesday, 17 April 2024 at 12:09 AM

Share Your Code Snippet - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / Share Your Code Snippet (1897 Views)

Let Me Debug Your Code For You / Share Your Remote Job Experience As A Developer / Gain Confidence In Your Code Through Testing (2) (3) (4)

(1) (Reply) (Go Down)

Share Your Code Snippet by raymod170(m): 10:33pm On Apr 14, 2018
With constant complains about how boring this section is becoming

I may just have a solution to one of the problems for now

Hello to all Senior developers and junior developers
let's share a snippet of our current project or past project and explain it briefly or extensively for educational purposes only

Thanks as you engage for fun as well
Re: Share Your Code Snippet by raymod170(m): 10:53pm On Apr 14, 2018
The code in the image below is the written using C# and sql programming languages

It's function is to update an existing record in a MySQL database to save the newly inputed values

From The image you can see from the second line that an sql query is made

line 3-5 stores each values in those objects (text boxes) in thier data rows respectively

line 6-10 does the task of converting an Image to byte array and saving the array as a blob in its respective datarow

line 11 updates the data adapter

line 12-14 interacts with the user of the system by displaying a timed information notifying the user the operation was successful

line 15 performs another method which was created outside of this method entirely

Re: Share Your Code Snippet by Doughboysss: 2:53am On Apr 15, 2018
The code below is written in php and postgresql. The function of the code is to send a different post to Facebook every time the code is run. The posts are stored in a database and a post consists of a message and an image

1. Firstly you have to install Facebook SDK for php

2. Then , we check for the id of the last sent post. If no post has been sent , we start sending from the first post otherwise we add one to the returned I'd so as to send the next post.



3. Before sending the code checks if all posts have been sent and stops sending if the limit has been reached so that the code won't crash.


4. We then send the post . first we initialise the facebooksdk then send the post.


5. After sending the post we update the table so as to know which posts have been sent.

pic3 shows the config.php file. here you have to supply your appid, appsecret, pageaccesstoken, pageid. you can get these from the developers.Facebook page.

1 Like

Re: Share Your Code Snippet by raymod170(m): 12:24am On Apr 28, 2018
Implementation of conditional statements
the snippet shows the use of if/else statements for a particular function of checking if Various objects are without strings or intergers

Re: Share Your Code Snippet by raymod170(m): 4:48pm On Jun 12, 2018
raymod170:
The code in the image below is the written using C# and sql programming languages

It's function is to update an existing record in a MySQL database to save the newly inputed values

From The image you can see from the second line that an sql query is made

line 3-5 stores each values in those objects (text boxes) in thier data rows respectively

line 6-10 does the task of converting an Image to byte array and saving the array as a blob in its respective datarow

line 11 updates the data adapter

line 12-14 interacts with the user of the system by displaying a timed information notifying the user the operation was successful

line 15 performs another method which was created outside of this method entirely
Re: Share Your Code Snippet by NaHiim: 12:26am On Jul 22, 2018
Hello,
I just wanna ask the Java coders in the house, what this code snippet does. It really beats me.

private int xLevel = DEBUG_MODE ? 8 : 0;
Re: Share Your Code Snippet by abumeinben(m): 6:54am On Jul 22, 2018
NaHiim:
Hello,
I just wanna ask the Java coders in the house, what this code snippet does. It really beats me.

private int xLevel = DEBUG_MODE ? 8 : 0;

This is simplified if else statement.
Expanded is
private int xLevel;

if (DEBUG_MODE is true)
xLevel = 8;
esle xLevel = 0;

1 Like

Re: Share Your Code Snippet by Nobody: 7:26am On Jul 22, 2018
abumeinben:

This is simplified if else statement.
private int xLevel;
if (DEBUG_MODE is true)
     xLevel = 8;
 esle xLevel = 0;
 
shocked
abumeinben:

This is simplified if else statement.
private int xLevel;
if (DEBUG_MODE is true)
     xLevel = 8;
 esle xLevel = 0;
 
Re: Share Your Code Snippet by abumeinben(m): 8:37am On Jul 22, 2018
mosesabah:
shocked

Why?
Re: Share Your Code Snippet by NaHiim: 12:25am On Jul 23, 2018
abumeinben:

This is simplified if else statement. Expanded is private int xLevel;
if (DEBUG_MODE is true)
     xLevel = 8;
 esle xLevel = 0;
 
Thank you very much sir, God bless you

1 Like 1 Share

Re: Share Your Code Snippet by NaHiim: 3:49am On Feb 18, 2019
check out my newly release game on play store
https://play.google.com/store/apps/details?id=com.xploore.coronawars
please review and rate it

(1) (Reply)

Download Vb.net Ide / Where Can I Find Good Programmers In Delta State / Php

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 16
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.