• Breaking News

    Tuesday, February 25, 2020

    Got rejected again learn programming

    Got rejected again learn programming


    Got rejected again

    Posted: 24 Feb 2020 02:46 PM PST

    Starting to take its toll on me now. I keep getting passed over or rejected with jobs im applying for. I applied for a job and got 3 rounds deep and was ghosted for 2 weeks to be told they are moving on with someone else. Went to a reverse career fair, had projects to show, made a sweet board display my skills. All my friends got interviews, except for me.

    I know this is part of the process but man it sucks hard. I feel like all this work im putting in is for nothing. How does everyone stay positive during this whope thing?

    EDIT: Was not expecting this post to blow up like this! Just wanted to say thanks to everyone who gave great advice and encouraging words. Honestly honored to be part of this community.

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

    Keep learning web dev or move to c#?

    Posted: 24 Feb 2020 02:17 AM PST

    I'm in the UK and going down the self taught route and like most people I've started with web dev. I'm ok at it so far and learnt some html, css and javascript but on a very basic level. I'm not really sure what I want to do yet but web dev does kind of bore me to be honest and I'm really not good at design so I struggle to make pretty websites. Alot of the jobs in the area are for c# engineers so I thought maybe I should stop either web dev and concentrate on learning c#.

    Would it be easier to learn if I had a solid grasp of javascript? I don't want to swap now, struggle for a few weeks and end up back on javascript having wasted my time.

    What do you guys think?

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

    is it possible to go form zero to decent in web development in a few months?

    Posted: 24 Feb 2020 11:23 PM PST

    So I want to get a web development job this coming Fall, an on-campus web development job. But it requires me to be able to have the ability to make a full-stack web application.

    Is this doable in three months? Can I be a proficient web developer in that time? I need to know:

    1. HTML & CSS
    2. One or more of the following: PHP, JavaScript, Ruby, Java
    3. Familiarity with relational databases and SQL
    4. Familiarity with the LAMP development stack (a plus)
    5. Familiarity with a web development framework, i.e. Laravel, Ruby on Rails (a big plus)
    6. Familiarity with software development life cycle / agile web development (not required, but a plus)

    How much of that could I be good at in three months and which of this stuff should I prioritize?

    Thanks in advance by the way.

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

    Learning to code while being dyslexic is incredibly frustrating and incredibly hard.

    Posted: 24 Feb 2020 01:19 PM PST

    Is anyone else dyslexic or anyone else have any handy tips to making the learning process less frustrating and difficult?

    I started with Wed dev but couldn't deal with JS's syntax it made no sense in my brain at all, at a fundamental level and I just got angry and quite (this was after 6 months of reading, coding, practising, building websites) I just had to go over basic concepts over 20 times. I gave up and thought programming wasnt for me (still don't think it is).

    Now I'm doing something more visually based data analyics with python and matplotlib which is less stressful but still frustrating.

    It's getting to the point where at the base level I do not understand what is being sad in basic tutorials, all this random language is thrown at me without any foundation to establish this language, as someone with dyslexia who needs to understand the base meaning/why/how a word is used I cant even follow instrctions.

    I don't understand the terms like prase this, index that, return this, call that. I can copy and do what it says but i don't understand it, to me those words don't compute with my brain my dyslexic ass has trouble redefining meaning to words.

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

    Feeling like I've wasted time.

    Posted: 24 Feb 2020 11:23 AM PST

    So for about 3 years I've been jumping from project to project in python(exclusively) and know seeing people say "python is super easy", "python is a bad starting language". I'm wondering if I should branch out to other languages. If I should, what languages?

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

    Number of Iterations of Nested For Loops - Combinatorics

    Posted: 24 Feb 2020 11:09 PM PST

    n = 10 count = 0 for i in range(n): for j in range(n): for k in range(n): if i < j and j < k: count += 1 print(count) 

    How do we count the number of 3 digit numbers in the format ijk where i>j>k. So, the first number in this series would be 012 and the last number would be 789.

    The answer for this is 120. I can count on a case by case basis. But how would you do the same for n = 100 or n = 1000.

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

    What's a high quality video you recommend?

    Posted: 24 Feb 2020 08:06 PM PST

    I watched CppCon 2019: Chandler Carruth "There Are No Zero-cost Abstractions" which was very good and explained why there's overhead in places you don't except (obviously for C++).

    Andrei Alexandrescu has a bunch of videos about optimizations and I remember enjoying Herb Sutter Atomic Weapons back in the day (it's about writing atomic code).

    I want to watch something new. I don't really care what language it's about but generally I write in C++ and C#. Occasionally typescript and JS. Do you guys have any recommendations?

    Also there was a video about slowing down code to find spots to optimize. If anyone has any idea what video that might be I'd love to see it again

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

    C# .NET whatsapp group

    Posted: 25 Feb 2020 12:46 AM PST

    Hi all,

    As anyone from the UK knows C# .NET is (one of) the most wanted programming language and framework currently on sites like indeed and totaljobs, so I have created a group for any newbies wanting to make the switch to share notes and ideas on getting our foot in the door.

    If you are interested in joining drop me a message and ill send you the join link,

    Good luck in your learning,
    B

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

    Scrap forum threads and create a directed graph from the results - need advices

    Posted: 25 Feb 2020 12:22 AM PST

    Hey guys, I need your help in picking the right tools and languages for this small project of mine.

    Given a link to a thread in a forum (not reddit BTW), scrap the first comment in the thread. Keep the text and title, extract all links to other threads in the same forum.

    For each link to a thread, do previous stage.

    Continues until no new threads are linked.

    I want to visualise the result with a directed graph - each vertex would be a thread(*), the edges would be the linking between threads - (original thread, link thread) (i.e from which thread was the current thread linked).

    (*) Each vertex would show the title of the thread, upon clicking a vertex the text of the first comment would pop up.

    I was thinking of using python for the scraping but I'm not sure it'll handle the visualisation. So I was thinking of creating a local client-server, with React as client side, to visualise the data received from the Python "server". In React I'll use cytoscape to create graphs, in python - networkX.

    I thought of simply using nodejs for everything as the scraping is basic and it should be rather easy to visualise the results.

    But both solutions feel cumbersome to me.. I'd love to hear more opinions!

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

    Help me deconstruct a "career prep" program into something I can do at home

    Posted: 25 Feb 2020 12:21 AM PST

    I'm an expat who has to move back to the US (probably NYC) so to keep costs low I will be building a career prep program for myself. I have 2.5 years with Typescript, React, Express, , noSQL, Jest and a few other things. My portfolio is weak so I'll only be working on that.

    Current Career Prep Plan

    1. Build out the portfolio. Priority 1
    2. Work through those "cracking the coding interview" books

    Would you guys add anything?

    My ideal job is full remote. I don't think I'll get it but I'll strive for it.

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

    Recconect to MQTT server after it's restart

    Posted: 24 Feb 2020 11:45 PM PST

    I have simple foreground service MQTT client service based on Paho library for Android. System reconnects fine when phones wifi or GSM data goes down with help of MQTTBroadcastReceiver
    . But in case MQTT server temporary goes down this not helps. I was expecting options.setAutomaticReconnect(true)
    enables some reconnect functionality, but in current case it does not work. Why?

    Reconnect mqttClient.connect() in MqttCallback also not connects. Why?

    What is the best way to solve reconnect problem when MQTT server restarts?

    Whole code:

    public class MqttGndService extends Service { private String ip="ssl:myserver",port="8887"; private final IBinder mBinder = new LocalBinder(); private Handler mHandler; private static final String TAG = "mqttservice"; private static boolean hasWifi = false; private static boolean hasMmobile = false; private ConnectivityManager mConnMan; private volatile IMqttAsyncClient mqttClient; private String uniqueID; class MQTTBroadcastReceiver extends BroadcastReceiver { u/Override public void onReceive(Context context, Intent intent) { IMqttToken token; boolean hasConnectivity = false; boolean hasChanged = false; NetworkInfo infos[] = mConnMan.getAllNetworkInfo(); for (int i = 0; i < infos.length; i++) { if (infos[i].getTypeName().equalsIgnoreCase("MOBILE")) { if ((infos[i].isConnected() != hasMmobile)) { hasChanged = true; hasMmobile = infos[i].isConnected(); } Timber.tag(Utils.TIMBER_TAG).v( infos[i].getTypeName() + " is " + infos[i].isConnected()); } else if (infos[i].getTypeName().equalsIgnoreCase("WIFI")) { if ((infos[i].isConnected() != hasWifi)) { hasChanged = true; hasWifi = infos[i].isConnected(); } Timber.tag(Utils.TIMBER_TAG).v(infos[i].getTypeName() + " is " + infos[i].isConnected()); } } hasConnectivity = hasMmobile || hasWifi; Timber.tag(Utils.TIMBER_TAG).v( "hasConn: " + hasConnectivity + " hasChange: " + hasChanged + " - " + (mqttClient == null || !mqttClient.isConnected())); if (hasConnectivity && hasChanged && (mqttClient == null || !mqttClient.isConnected())) { Timber.tag(Utils.TIMBER_TAG).v("Ready to connect"); doConnect(); Timber.tag(Utils.TIMBER_TAG).v("do connect done"); } else { Timber.tag(Utils.TIMBER_TAG).v("Connection not possible"); } } } public class LocalBinder extends Binder { public MqttGndService getService() { // Return this instance of LocalService so clients can call public methods return MqttGndService.this; } } u/Override public IBinder onBind(Intent intent) { return mBinder; } public void publish(String topic, MqttMessage message) { SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(this);// we create a 'shared" memory where we will share our preferences for the limits and the values that we get from onsensorchanged try { mqttClient.publish(topic, message); } catch (MqttException e) { e.printStackTrace(); } } u/Override public void onCreate() { Timber.tag(Utils.TIMBER_TAG).v("Creating MQTT service"); mHandler = new Handler();//for toasts IntentFilter intentf = new IntentFilter(); setClientID(); intentf.addAction(ConnectivityManager.CONNECTIVITY_ACTION); registerReceiver(new MQTTBroadcastReceiver(), new IntentFilter(ConnectivityManager.CONNECTIVITY_ACTION)); mConnMan = (ConnectivityManager) getSystemService(CONNECTIVITY_SERVICE); } u/Override public void onConfigurationChanged(Configuration newConfig) { Timber.tag(Utils.TIMBER_TAG).v( "onConfigurationChanged()"); android.os.Debug.waitForDebugger(); super.onConfigurationChanged(newConfig); } u/Override public void onDestroy() { super.onDestroy(); Timber.tag(Utils.TIMBER_TAG).v("Service onDestroy"); } private void setClientID() { uniqueID = android.provider.Settings.Secure.getString(getContentResolver(), android.provider.Settings.Secure.ANDROID_ID); Timber.tag(Utils.TIMBER_TAG).v("uniqueID=" + uniqueID); } private void doConnect() { String broker = ip + ":" + port; Timber.tag(Utils.TIMBER_TAG).v("mqtt_doConnect()"); IMqttToken token; MqttConnectOptions options = new MqttConnectOptions(); options.setCleanSession(true); options.setMaxInflight(100);//handle more messages!!so as not to disconnect options.setAutomaticReconnect(true); options.setConnectionTimeout(1000); options.setKeepAliveInterval(300); options.setUserName("cc50e3e91bf4"); options.setPassword("b".toCharArray()); try { options.setSocketFactory(SocketFactoryMQ.getSocketFactory(this,"")); } catch (KeyStoreException e) { e.printStackTrace(); } catch (NoSuchAlgorithmException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } catch (KeyManagementException e) { e.printStackTrace(); } catch (CertificateException e) { e.printStackTrace(); } catch (UnrecoverableKeyException e) { e.printStackTrace(); } Timber.tag(Utils.TIMBER_TAG).v("set socket factory done"); try { mqttClient = new MqttAsyncClient(broker, uniqueID, new MemoryPersistence()); token = mqttClient.connect(options); token.waitForCompletion(3500); mqttClient.setCallback(new MqttCallback() { u/Override public void connectionLost(Throwable throwable) { try { mqttClient.disconnectForcibly(); mqttClient.connect(); } catch (MqttException e) { e.printStackTrace(); } } u/Override public void messageArrived(String topic, MqttMessage msg) throws Exception { Timber.tag(Utils.TIMBER_TAG).v("Message arrived from topic " + topic+ " msg: " + msg ); } u/Override public void deliveryComplete(IMqttDeliveryToken iMqttDeliveryToken) { System.out.println("published"); } }); Timber.tag(Utils.TIMBER_TAG).v("will subscribe"); mqttClient.subscribe("sensors/s1/", 1); } catch (MqttSecurityException e) { Timber.tag(Utils.TIMBER_TAG).v("general connect exception"); e.printStackTrace(); } catch (MqttException e) { switch (e.getReasonCode()) { case MqttException.REASON_CODE_BROKER_UNAVAILABLE: mHandler.post(new ToastRunnable("WE ARE OFFLINE BROKER_UNAVAILABLE!", 1500)); break; case MqttException.REASON_CODE_CLIENT_TIMEOUT: mHandler.post(new ToastRunnable("WE ARE OFFLINE CLIENT_TIMEOUT!", 1500)); break; case MqttException.REASON_CODE_CONNECTION_LOST: mHandler.post(new ToastRunnable("WE ARE OFFLINE CONNECTION_LOST!", 1500)); break; case MqttException.REASON_CODE_SERVER_CONNECT_ERROR: Timber.tag(Utils.TIMBER_TAG).v( "c " + e.getMessage()); e.printStackTrace(); break; case MqttException.REASON_CODE_FAILED_AUTHENTICATION: Intent i = new Intent("RAISEALLARM"); i.putExtra("ALLARM", e); Timber.tag(Utils.TIMBER_TAG).v("b " + e.getMessage()); break; default: Timber.tag(Utils.TIMBER_TAG).v( "a " + e.getMessage() +" "+ e.toString()); } } mHandler.post(new ToastRunnable("WE ARE ONLINE!", 500)); } u/Override public int onStartCommand(Intent intent, int flags, int startId) { Timber.tag(Utils.TIMBER_TAG).v("onStartCommand"); String input = intent.getStringExtra(INTENT_ID); Timber.tag(Utils.TIMBER_TAG).v("onStartCommand "+ input); Intent notificationIntent = new Intent(this, MainActivity.class); PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, notificationIntent, 0); Notification notification = new NotificationCompat.Builder(this, CHANNEL_ID) .setContentTitle("Example Service") .setContentText(input) .setSmallIcon(R.drawable.ic_android) .setContentIntent(pendingIntent) .build(); startForeground(1, notification); PowerManager powerManager = (PowerManager) getSystemService(POWER_SERVICE); PowerManager.WakeLock wakeLock = powerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "MyApp::MyWakelockTag"); wakeLock.acquire(); return START_STICKY; } } 
    submitted by /u/columncolumn
    [link] [comments]

    QoS=1 with MqttAsyncClient from Paho MQTT library subscription miss messages

    Posted: 24 Feb 2020 11:43 PM PST

    I have foreground service acting as MQTT client. I'm using MqttAsyncClient mqttClient
    for this purpose.
    I'm using QoS=1 on subscribe to topic:

    mqttClient.subscribe("sensors/s1/", 1); 

    But in case my phone gets offline for some period of time it miss current period messages. Whole code is below.

    Im my another application I'm using MqttAndroidClient mqttAndroidClient and in this case QoS=1 brings all missed messages.

    mqttAndroidClient.subscribe(topic, 1, null, new IMqttActionListener() {...}) 

    Why subscription with MqttAsyncClient with QoS=1 not retrieves all messages?

    Whole code :

    public class MqttGndService extends Service { private String ip="ssl:myserver",port="8887"; private final IBinder mBinder = new LocalBinder(); private Handler mHandler; private static final String TAG = "mqttservice"; private static boolean hasWifi = false; private static boolean hasMmobile = false; private ConnectivityManager mConnMan; private volatile IMqttAsyncClient mqttClient; private String uniqueID; class MQTTBroadcastReceiver extends BroadcastReceiver { u/Override public void onReceive(Context context, Intent intent) { IMqttToken token; boolean hasConnectivity = false; boolean hasChanged = false; NetworkInfo infos[] = mConnMan.getAllNetworkInfo(); for (int i = 0; i < infos.length; i++) { if (infos[i].getTypeName().equalsIgnoreCase("MOBILE")) { if ((infos[i].isConnected() != hasMmobile)) { hasChanged = true; hasMmobile = infos[i].isConnected(); } Timber.tag(Utils.TIMBER_TAG).v( infos[i].getTypeName() + " is " + infos[i].isConnected()); } else if (infos[i].getTypeName().equalsIgnoreCase("WIFI")) { if ((infos[i].isConnected() != hasWifi)) { hasChanged = true; hasWifi = infos[i].isConnected(); } Timber.tag(Utils.TIMBER_TAG).v(infos[i].getTypeName() + " is " + infos[i].isConnected()); } } hasConnectivity = hasMmobile || hasWifi; Timber.tag(Utils.TIMBER_TAG).v( "hasConn: " + hasConnectivity + " hasChange: " + hasChanged + " - " + (mqttClient == null || !mqttClient.isConnected())); if (hasConnectivity && hasChanged && (mqttClient == null || !mqttClient.isConnected())) { Timber.tag(Utils.TIMBER_TAG).v("Ready to connect"); doConnect(); Timber.tag(Utils.TIMBER_TAG).v("do connect done"); } else { Timber.tag(Utils.TIMBER_TAG).v("Connection not possible"); } } } public class LocalBinder extends Binder { public MqttGndService getService() { // Return this instance of LocalService so clients can call public methods return MqttGndService.this; } } u/Override public IBinder onBind(Intent intent) { return mBinder; } public void publish(String topic, MqttMessage message) { SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(this);// we create a 'shared" memory where we will share our preferences for the limits and the values that we get from onsensorchanged try { mqttClient.publish(topic, message); } catch (MqttException e) { e.printStackTrace(); } } u/Override public void onCreate() { Timber.tag(Utils.TIMBER_TAG).v("Creating MQTT service"); mHandler = new Handler();//for toasts IntentFilter intentf = new IntentFilter(); setClientID(); intentf.addAction(ConnectivityManager.CONNECTIVITY_ACTION); registerReceiver(new MQTTBroadcastReceiver(), new IntentFilter(ConnectivityManager.CONNECTIVITY_ACTION)); mConnMan = (ConnectivityManager) getSystemService(CONNECTIVITY_SERVICE); } u/Override public void onConfigurationChanged(Configuration newConfig) { Timber.tag(Utils.TIMBER_TAG).v( "onConfigurationChanged()"); android.os.Debug.waitForDebugger(); super.onConfigurationChanged(newConfig); } u/Override public void onDestroy() { super.onDestroy(); Timber.tag(Utils.TIMBER_TAG).v("Service onDestroy"); } private void setClientID() { uniqueID = android.provider.Settings.Secure.getString(getContentResolver(), android.provider.Settings.Secure.ANDROID_ID); Timber.tag(Utils.TIMBER_TAG).v("uniqueID=" + uniqueID); } private void doConnect() { String broker = ip + ":" + port; Timber.tag(Utils.TIMBER_TAG).v("mqtt_doConnect()"); IMqttToken token; MqttConnectOptions options = new MqttConnectOptions(); options.setCleanSession(true); options.setMaxInflight(100);//handle more messages!!so as not to disconnect options.setAutomaticReconnect(true); options.setConnectionTimeout(1000); options.setKeepAliveInterval(300); options.setUserName("cc50e3e91bf4"); options.setPassword("b".toCharArray()); try { options.setSocketFactory(SocketFactoryMQ.getSocketFactory(this,"")); } catch (KeyStoreException e) { e.printStackTrace(); } catch (NoSuchAlgorithmException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } catch (KeyManagementException e) { e.printStackTrace(); } catch (CertificateException e) { e.printStackTrace(); } catch (UnrecoverableKeyException e) { e.printStackTrace(); } Timber.tag(Utils.TIMBER_TAG).v("set socket factory done"); try { mqttClient = new MqttAsyncClient(broker, uniqueID, new MemoryPersistence()); token = mqttClient.connect(options); token.waitForCompletion(3500); mqttClient.setCallback(new MqttCallback() { u/Override public void connectionLost(Throwable throwable) { try { mqttClient.disconnectForcibly(); mqttClient.connect(); } catch (MqttException e) { e.printStackTrace(); } } u/Override public void messageArrived(String topic, MqttMessage msg) throws Exception { Timber.tag(Utils.TIMBER_TAG).v("Message arrived from topic " + topic+ " msg: " + msg ); } u/Override public void deliveryComplete(IMqttDeliveryToken iMqttDeliveryToken) { System.out.println("published"); } }); Timber.tag(Utils.TIMBER_TAG).v("will subscribe"); mqttClient.subscribe("sensors/s1/", 1); } catch (MqttSecurityException e) { Timber.tag(Utils.TIMBER_TAG).v("general connect exception"); e.printStackTrace(); } catch (MqttException e) { switch (e.getReasonCode()) { case MqttException.REASON_CODE_BROKER_UNAVAILABLE: mHandler.post(new ToastRunnable("WE ARE OFFLINE BROKER_UNAVAILABLE!", 1500)); break; case MqttException.REASON_CODE_CLIENT_TIMEOUT: mHandler.post(new ToastRunnable("WE ARE OFFLINE CLIENT_TIMEOUT!", 1500)); break; case MqttException.REASON_CODE_CONNECTION_LOST: mHandler.post(new ToastRunnable("WE ARE OFFLINE CONNECTION_LOST!", 1500)); break; case MqttException.REASON_CODE_SERVER_CONNECT_ERROR: Timber.tag(Utils.TIMBER_TAG).v( "c " + e.getMessage()); e.printStackTrace(); break; case MqttException.REASON_CODE_FAILED_AUTHENTICATION: Intent i = new Intent("RAISEALLARM"); i.putExtra("ALLARM", e); Timber.tag(Utils.TIMBER_TAG).v("b " + e.getMessage()); break; default: Timber.tag(Utils.TIMBER_TAG).v( "a " + e.getMessage() +" "+ e.toString()); } } mHandler.post(new ToastRunnable("WE ARE ONLINE!", 500)); } u/Override public int onStartCommand(Intent intent, int flags, int startId) { Timber.tag(Utils.TIMBER_TAG).v("onStartCommand"); String input = intent.getStringExtra(INTENT_ID); Timber.tag(Utils.TIMBER_TAG).v("onStartCommand "+ input); Intent notificationIntent = new Intent(this, MainActivity.class); PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, notificationIntent, 0); Notification notification = new NotificationCompat.Builder(this, CHANNEL_ID) .setContentTitle("Example Service") .setContentText(input) .setSmallIcon(R.drawable.ic_android) .setContentIntent(pendingIntent) .build(); startForeground(1, notification); PowerManager powerManager = (PowerManager) getSystemService(POWER_SERVICE); PowerManager.WakeLock wakeLock = powerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "MyApp::MyWakelockTag"); wakeLock.acquire(); return START_STICKY; } } 
    submitted by /u/columncolumn
    [link] [comments]

    Is Web Development Dying or is that just a meme?

    Posted: 24 Feb 2020 04:09 PM PST

    I know this question is probably a meme question at this point but I've been trying to put it to rest once and for all in my head. Currently I have taken classes in Java, C#, html/css/javascript, MySql and PHP and the languages I've been drawn towards the most is Javascript and php.

    I would like to make that as a career and become a Web Developer/Javascript Developer/Web Designer however every single week in some forum I see a post talking about web development is dying, it's going to be dead in a few years, there's no way you can make a career out of that.

    I was also trying to see what skills would be needed to break into the industry and find a decent job.

    Currently I have a mastery of HTML/CSS (I know they're not actual coding languages but I remember them like the back of my hand at this point), I have a decent grasp of javascript and I'm just learning PHP. I was going to buy the Web Developer Bootcamp on Udemy and work through that:

    https://www.udemy.com/course/the-complete-web-development-bootcamp/

    Also to complete my AS. I plan to take a web scripting course. I was wondering if there are any other skills I should learn in order to thrive in the market?

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

    How should I alter this code to make it work as intended?

    Posted: 24 Feb 2020 11:33 PM PST

    I am making a simple survey of which the answers will be sent to a database. Currently I have a working script for sending the survey results to the database but I am now trying to solve this one (or two) aspect(s) in it:

    I want to prevent people submitting twice. The person who submits is identified by their name which is $employee in the script below. I currently have the script so that if "Matt Myself" submits multiple times, only the first submit will be visible in the database. The problem with this currently is that if someone else submits after "Matt Myself" their $employee_id will be more than one number higher than Matt's because the other submits by Matt increase the ID despite them not being visible in the database. So I'd probably have to make the $employee_id and $employee tied to each other somehow?

    The other problem this generates is that I have to tell the user that his/her submission didn't get through because only one submission is allowed. This will be done by redirecting the person to failed.php instead if thankyou.php. I have made the variable $exists for checking if the employee name already exists in the table but it seems so that it is not exactly the correct syntax. :D I think I have understood how it should be done but I don't know how exactly I should write it.

    Here's the php script for sending survey results to the database:

    <?php #include database connection file include_once "dbconnect.php"; #declare variables for the form entries $windows_startup = $_POST["windows_startup"]; $windows_update = $_POST["windows_update"]; $program_startup = $_POST["program_startup"]; $program_performance = $_POST["program_performance"]; $game_performance = $_POST["game_performance"]; $program_optional = $_POST["program_optional"]; $employee = $_POST["employee"]; #declare variable for inserting data inserted by the user to the database $sql = "INSERT INTO results (employee, windows_startup, windows_update, program_startup, program_performance, game_performance, program_optional) VALUES ('$employee', '$windows_startup', '$windows_update', '$program_startup', '$program_performance', '$game_performance', '$program_optional');"; #declare variable for checking if employee has already his/her name in the table $exists = mysqli_query("SELECT employee_id FROM results WHERE employee = '$employee'"); #check the connection if (!$conn) { die("Connection failed: " . mysqli_connect_error()); } #print message if connection successful echo "Database connection established successfully! "; #check if the employee name exists in the table already, if it does, change the page to failed.php if ($exists->num_rows > 0) { header("Location: ../failed.php"); #print message if database record was added successfully } elseif (mysqli_query($conn, $sql)) { echo "Record added successfully!"; #print error message if database connection failed } else { echo "Error: " . $sql . mysqli_error($conn); } #change the url to say success to indicate everything went successfully header("Location: ../thankyou.php?success"); 

    Here's what I used to create the table:

    CREATE TABLE results ( employee_id int(1) UNIQUE AUTO_INCREMENT not null, employee varchar (50) UNIQUE not null, windows_startup int (3), windows_update int (3), program_startup int (3), program_performance int (3), game_performance int (4), program_optional varchar (5000) ); 

    I am aware that I may get comments telling me to learn the more of the basics before but I am on kind of a tight schedule with the project so I hope you'll be understanding.

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

    Application Architecture / Design Material

    Posted: 24 Feb 2020 11:26 PM PST

    Hi,

    I have 6 years of experience in Enterprise Application Development(Java, Spring, etc). Now I want to apply for an Architect position.

    Is there any good book, blog or links that can help me hone my Application Architect / Design skills and help me in acing interview.

    Cheers :)

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

    Is a 6 to 8 week course enough to get a decent grasp of python?

    Posted: 24 Feb 2020 11:14 PM PST

    I'm thinking of taking a python class in my summer semester and I was wondering if 6 to 8 weeks (with each week consisting of 4 days) is enough time to get a decent grasp on python.

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

    Web vs mobile dev

    Posted: 24 Feb 2020 11:12 PM PST

    Hi.I don't know which path to chose and hope you guys can help me.I am 15 right now and I know the basics of programming in c++ and python and i have no problem to learn another language.So let's start:

    1.Mobile development-i want to do it for android with kotlin.I am interesed in making,publishing and using my own apps.Plus i heard that lots of people even made some money from it but there is a problem.I heard that mobile dev is not for future and i am a young boy and i don't know if it is worth learning mobile dev if it is not for future.

    2.Web development-i want to do it with django.I am interesed in making websites too but there is way to much to learn:python,html,css,javascript and i heard that it is way harder to make money out of sites.But i heard that web dev is for the future.

    So which one do you guys recommand me to chose and learn?I want to mention that i am not all for money but if i can make money while doing what i like it get's me way more motivated.

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

    Is the possible to embed a java code on Reddit Comments ��

    Posted: 24 Feb 2020 10:56 PM PST

    I just want to know can anyone help me for this if i want to use a java code on reddit comment the subreddits are allow or is possible to use URL for redirection ?

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

    ArrayList populated in one class but empty in another

    Posted: 24 Feb 2020 10:42 PM PST

    I have 3 classes: WeatherForecaster, Location and WeatherForecasterUI. Location contains variables and access modifiers. WeatherForecaster retrieves JSON data and populates the Location ArrayList with the parsed JSON data. However, when I call the method to get the ArrayList in the WeatherForecasterUI class, the ArrayList is empty. As far as I know I've initialized the Location object correctly within the UI class. The only issue I can think of is that it's pointing to a fresh Location, without any data. In which case I'd have to somehow copy the state of the ArrayList from WeatherForecaster. In which case some guidance on how to do so would be great.

    EDIT: Have added code for 3 files without imports to reduce length.

    WeatherForecaster:

    public class WeatherForecaster { private static String userLocation; private final static String key = "f87f47d11e46005d4e94af73a8ff2eee"; private static String output = ""; static LocalDate date; private static final int MYTHREADS = 45; ExecutorService executor = Executors.newFixedThreadPool(MYTHREADS); Location locs = new Location(); String icon = ""; static Image image = null; Image flag = null; private void fetchJSON(){ try { System.out.println("Please enter the name of a location"); Scanner scanner = new Scanner(System.in); userLocation = scanner.nextLine(); URL url = new URL("http://api.openweathermap.org/data/2.5/forecast? q=" + userLocation + "&units=metric&appid="+key); HttpURLConnection conn = (HttpURLConnection) url.openConnection(); conn.setRequestMethod("GET"); conn.setRequestProperty("Accept", "application/json"); if (conn.getResponseCode() != 200) { throw new RuntimeException("Failed : HTTP Error code : " + conn.getResponseMessage()); } else{ try (Scanner sc = new Scanner(url.openStream())) { while(sc.hasNext()) { output+=sc.nextLine(); } sc.close(); conn.disconnect(); JSONObject jobj = new JSONObject(output); JSONArray jArr = jobj.getJSONArray("list"); for (int i = 0; i < jArr.length(); i++) { Location loc = new Location(); JSONObject dailyForecast = jArr.getJSONObject(i); Long forecastDate = dailyForecast.getLong("dt"); LocalDateTime dateTime = LocalDateTime.ofInstant(Instant.ofEpochSecond(forecastDate), TimeZone.getDefault().toZoneId()); loc.setDateTime(dateTime); loc.setTemp(dailyForecast.getJSONObject("main").getDouble("temp")); loc.setTemp_min(dailyForecast.getJSONObject("main").getDouble("temp_min")); loc.setTemp_max(dailyForecast.getJSONObject("main").getDouble("temp_max")); 

    loc.setFeelsLike(dailyForecast.getJSONObject("main").getDouble("feels_like")); loc.setWindSpeed(dailyForecast.getJSONObject("wind").getDouble("speed")); loc.setHumidity(dailyForecast.getJSONObject("main").getInt("humidity")); JSONArray weather = dailyForecast.getJSONArray("weather"); loc.setMain(weather.getJSONObject(0).getString("main")); loc.setDescription(weather.getJSONObject(0).getString("description")); icon = weather.getJSONObject(0).getString("icon"); String imgURL = "http://openweathermap.org/img/wn/" + icon + "@2x.png"; loc.setImgURL(imgURL); locs.getLocations().add(loc); } for(Location location1 : locs.getLocations()){ String iconURL = location1.getImgURL(); Runnable worker = new MyRunnable(iconURL); executor.execute(worker); } executor.shutdown(); System.out.println("\nFinished all threads"); }

     } } catch (MalformedURLException e) { System.out.println("Location doesn't exist"); } catch (IOException e){ System.out.println("City not found"); } catch (RuntimeException e){ e.printStackTrace(); } } public static void main(String[] args) { WeatherForecaster forecaster = new WeatherForecaster(); forecaster.fetchJSON(); WeatherForecasterUI ui = new WeatherForecasterUI(); ui.setVisible(true); } public class MyRunnable implements Runnable { private final String url; public MyRunnable(String url){ this.url = url; } public void run(){ try { URL urlImg = new URL(url); image = ImageIO.read(urlImg); locs.setIcon(image); } catch (IOException imageEx) { System.out.println("Cannot find image"); } } } } 

    Location:

    public class Location { private String main; private String description; private String imgURL; private Image icon; private Image flag; private double temp; private double temp_max; private double temp_min; private double feelsLike; private int humidity; private double windSpeed; private String code; private LocalDateTime dateTime; private List<Location> locations; public Location() { this.locations = new ArrayList<>(); } public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } public Image getIcon() { return icon; } public void setIcon(Image icon) { this.icon = icon; } public double getTemp() { return temp; } public void setTemp(double temp) { this.temp = temp; } public double getTemp_max() { return temp_max; } public void setTemp_max(double temp_max) { this.temp_max = temp_max; } public double getTemp_min() { return temp_min; } public void setTemp_min(double temp_min) { this.temp_min = temp_min; } public double getFeelsLike() { return feelsLike; } public void setFeelsLike(double feelsLike) { this.feelsLike = feelsLike; } public int getHumidity() { return humidity; } public void setHumidity(int humidity) { this.humidity = humidity; } public String getMain() { return main; } public void setMain(String main) { this.main = main; } public double getWindSpeed() { return windSpeed * 3.6; } public void setWindSpeed(double windSpeed) { this.windSpeed = windSpeed; } public String getCode() { return code; } public void setCode(String code) { this.code = code; } public Image getFlag() { return flag; } public void setFlag(Image flag) { this.flag = flag; } public LocalDateTime getDateTime() { return dateTime; } public void setDateTime(LocalDateTime dateTime) { this.dateTime = dateTime; } public List<Location> getLocations() { return locations; } public void setLocations(List<Location> locations) { this.locations = locations; } public String getImgURL() { return imgURL; } public void setImgURL(String imgURL) { this.imgURL = imgURL; } } 

    WeatherForecasterUI:

    public class WeatherForecasterUI extends JFrame { static Location loc; JFrame frame; JLabel iconLabel, dateLabel, tempLabel, mainLabel, descLabel, minTempLabel, maxTempLabel, windLabel; public WeatherForecasterUI(){ loc = new Location(); frame = new JFrame("Weather"); if(loc.getLocations().isEmpty()){ System.out.println("Arraylist empty"); } else{ JPanel mainPanel = new JPanel(new GridLayout(5,8)); frame.add(mainPanel); System.out.println(loc.getLocations().size()); loc.getLocations().forEach((location1) -> { JPanel top = new JPanel(new BorderLayout()); JPanel second = new JPanel(new GridLayout(0,2)); JPanel third = new JPanel(new GridLayout(2,0)); JPanel fourth = new JPanel(new GridLayout(0,2)); JPanel panel1 = new JPanel(new GridBagLayout()); JPanel panel2 = new JPanel(); BoxLayout boxlayout = new BoxLayout(panel2, BoxLayout.Y_AXIS); panel2.setLayout(boxlayout); GridBagConstraints gbc = new GridBagConstraints(); LocalDateTime dateTime = location1.getDateTime(); iconLabel = new JLabel(new ImageIcon(location1.getIcon())); DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd-MM h:m a"); String formatDateTime = dateTime.format(formatter); dateLabel = new JLabel(formatDateTime); tempLabel = new JLabel(String.valueOf((location1.getTemp()) + "ͦC")); mainLabel = new JLabel(location1.getMain()); descLabel = new JLabel(location1.getDescription()); minTempLabel = new JLabel("ꜜ" + String.valueOf(location1.getTemp_min()) + "ͦC"); maxTempLabel = new JLabel("ꜛ" + String.valueOf(location1.getTemp_max()) + "ͦC"); windLabel = new JLabel("Wind speed is: " + location1.getWindSpeed() + " KM/H"); top.add(dateLabel, BorderLayout.CENTER); third.add(mainLabel); third.add(descLabel); second.add(iconLabel); second.add(third); fourth.add(minTempLabel); fourth.add(maxTempLabel); gbc.gridx = 0; gbc.gridy = 1; panel1.add(iconLabel,gbc); gbc.gridx = 0; gbc.gridy = 2; panel1.add(mainLabel,gbc); gbc.gridx = 1; gbc.gridy = 2; panel1.add(descLabel,gbc); gbc.gridx = 0; gbc.gridy = 3; panel1.add(tempLabel,gbc); gbc.gridx = 1; gbc.gridy = 3; panel1.add(minTempLabel,gbc); gbc.gridx = 2; gbc.gridy = 3; panel1.add(maxTempLabel,gbc); Border border = BorderFactory.createLineBorder(Color.black); panel1.setBorder(border); panel1.setBackground(Color.cyan); mainPanel.add(top); mainPanel.add(second); mainPanel.add(fourth); }); } frame.setDefaultCloseOperation(EXIT_ON_CLOSE); frame.pack(); } } 

    Any guidance would be appreciated. Cheers.

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

    Motivation on bootcamps

    Posted: 24 Feb 2020 10:40 PM PST

    I run training in HTTP, TDD, Design Patterns, JSP and Java Basics on bootcamps. Usually, in a group of 15/18 people, 2 - 5 of them are working at home with additional exercises and private projects. Sometimes those people don't have any CS background and it's not an issue for me, but sound like they are not interested in CS or even programming overall - just want to get a certificate and a job.
    I already tried games as projects, bugs in my commercial projects as real-life examples, offered help after the course (like "just send me a GitHub link and I will check it"), added CI to TDD exercises. Even personal projects during the course with my help are not working.

    How your trainers keep you motivated? What could motivate you to do additional exercises after full time work? What do you need to do something more?

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

    I don’t totally get initialization like I thought I did

    Posted: 24 Feb 2020 10:07 PM PST

    So I really thought I understood initialization of variables but I have this code right here

    1) Quaternion lookdirection = player.transform.localRotation; 2) 3) if (m_CurrentVelocity == Vector3.zero) 4) { 5) lookdirection = Quaternion.identity; 6) } 7) else 8) { 9) lookdirection = Quaternion.LookRotation(m_CurrentVelocity, transform.up); 10) player.transform.localRotation = lookdirection; 11)} What this is all supposed to do is simply store the player rotation in a quaternion, if there is no change in velocity don't add any rotation, else rotate in the direction of velocity.

    Now all this code actually does work. That's not what I'm confused about. What I'm confused about is on line 1 it's telling me "Unnecessary assignment of a value to 'lookdirection'". Idk if this is the right place to post about this because I just wanted to have a better understanding of why it says this. Sometimes I get a similar message that says the value is never assigned to it will have a value of zero. I didn't think I was doing this wrong but I just feel like that shouldn't be there. Thanks for anyone that can help!

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

    Hellpp

    Posted: 24 Feb 2020 10:03 PM PST

    I am trying to practice coding on chrome webpage using notepad and also tried sublime 3. Every time I type in my code and refresh the page all the codes are on the web page. Im putting index.html on my file and it is still doing this. Iv researched and tried all day to fix this. help plz

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

    What are the best key combinations for custom hotkeys?

    Posted: 24 Feb 2020 10:01 PM PST

    Hey guys,

    I'm writing a python script that uses a lot of hotkeys.

    Originally I was usually Shift + F1-F9 to run these hotkeys however combinations like shift-f5 in a browser refreshes, shift-f3 is find, etc. I was thinking of using ctrl + F keys instead but many of the ctrl + F combinations also have many random uses in other applications.

    What key combinations would be the best to be completely uninteractive with browsers, game, excel, windows itself, etc. so that I can dedicate to the sole function of activating a function script?

    Thanks!

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

    MySQL HELP: Backed Up All Folder Contents, Reinstalled MAMP but Now I get 'Error #1146 - Table Doesn't Exist'?

    Posted: 24 Feb 2020 09:16 PM PST

    Any MySQL geniuses out there that might know how to correct this? I thought I did everything right...

    I backed up my whole MAMP folder and once I reinstalled MAMP, I replaced the MySQL folder with all of its previous contents.

    The Databases and their respective Tables are appearing in PHP MyAdmin but when I try to click them - I get an error #1146 stating the table does not exist...

    I've got a bunch of sites that I really hope to recover! Would be very grateful for some advice on how to solve this!

    Running Windows 10 and MAMP v 4.1.1...

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

    Javascript question that has been bugging me all night

    Posted: 24 Feb 2020 09:08 PM PST

    This is from the google maps API docs. Can someone please tell me how the "calculateAndDisplayRoute" function can access the "directionsService" and "directionsRenderer"parameters? Are they not local to the "initMap" function?

    Thanks in advance.

    </div>
    <div id="map"></div>
    <script>
    function initMap() {
    var directionsService = new google.maps.DirectionsService();
    var directionsRenderer = new google.maps.DirectionsRenderer();
    var map = new google.maps.Map(document.getElementById('map'), {
    zoom: 7,
    center: {lat: 41.85, lng: -87.65}
    });
    directionsRenderer.setMap(map);

    var onChangeHandler = function() {
    calculateAndDisplayRoute(directionsService, directionsRenderer);
    };
    document.getElementById('start').addEventListener('change', onChangeHandler);
    document.getElementById('end').addEventListener('change', onChangeHandler);
    }

    function calculateAndDisplayRoute(directionsService, directionsRenderer) {
    directionsService.route(
    {
    origin: {query: document.getElementById('start').value},
    destination: {query: document.getElementById('end').value},
    travelMode: 'DRIVING'
    },
    function(response, status) {
    if (status === 'OK') {
    directionsRenderer.setDirections(response);
    } else {
    window.alert('Directions request failed due to ' + status);
    }
    });
    }
    </script>
    <script async defer src="https://maps.googleapis.com/maps/api/js?key=YOUR\_API\_KEY&callback=initMap">
    </script>
    </body>
    </html>

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

    No comments:

    Post a Comment