• Breaking News

    Monday, January 11, 2021

    Webpage gradually zoom according to window size? Ask Programming

    Webpage gradually zoom according to window size? Ask Programming


    Webpage gradually zoom according to window size?

    Posted: 11 Jan 2021 08:31 PM PST

    For my website, I am currently using webpage zoom intervals like so:

    @media only screen and (min-width: 600px) { html { zoom: .8; } } @media only screen and (min-width: 800px) { html { zoom: .9; } } @media only screen and (min-width: 1000px) { html { zoom: 1; } } 

    Is there a way to do this gradually, rather than step by step? Like, using percentages somehow...? I'm sorry if this is a rookie question. I am indeed a rookie.

    Thanks!

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

    Android error java.lang.RuntimeException: Error receiving broadcast Intent

    Posted: 11 Jan 2021 04:36 PM PST

    Im currently working on a project and I keep running into the error

    java.lang.RuntimeException: Error receiving broadcast Intent { act=android.net.wifi.WIFI_AP_STATE_CHANGED flg=0x4000010 (has extras) } in cn.ingenic.glasssync.utils.WifiAPUtils$1@428319e

    Reading the logs further I also see a null pointer exception where it says:

    Caused by: java.lang.NullPointerException: println needs a message

    01-06 10:57:26.272 12372 12372 E AndroidRuntime: at android.util.Log.println_native(Native Method)

    01-06 10:57:26.272 12372 12372 E AndroidRuntime: at android.util.Log.e(Log.java:249)

    01-06 10:57:26.272 12372 12372 E AndroidRuntime: at cn.ingenic.glasssync.utils.WifiAPUtils.getValidApSsid(WifiAPUtils.java:225)

    01-06 10:57:26.272 12372 12372 E AndroidRuntime: at cn.ingenic.glasssync.utils.WifiAPUtils$1.onReceive(WifiAPUtils.java:202)

    When I check line 225 in WifiAPUtils.java and replace it with a valid string I then get the error

    01-11 00:00:50.590 29176 29217 E AndroidRuntime: FATAL EXCEPTION: Thread-2

    01-11 00:00:50.590 29176 29217 E AndroidRuntime: Process: cn.ingenic.glasssync:remote, PID: 29176

    01-11 00:00:50.590 29176 29217 E AndroidRuntime: java.lang.ExceptionInInitializerError

    01-11 00:00:50.590 29176 29217 E AndroidRuntime: at com.baidu.location.Jni.j(Unknown Source:0)

    01-11 00:00:50.590 29176 29217 E AndroidRuntime: at com.baidu.location.t$a.X(Unknown Source:8)

    01-11 00:00:50.590 29176 29217 E AndroidRuntime: at com.baidu.location.ae.run(Unknown Source:10)

    01-11 00:00:50.590 29176 29217 E AndroidRuntime: Caused by: java.lang.IllegalStateException: no found the liblocSDK4d.so file, please correct settings

    Would anyone happen to know what could be the cause of this error here is the snippet of the code that could be potentially causing this error:

    private BroadcastReceiver mWifiStateBroadcastReceiver = new BroadcastReceiver() {

    u/Override
    public void onReceive(Context context, Intent intent) {
    Log.i(TAG,"WifiAPUtils onReceive: "+intent.getAction());
    if(WIFI_AP_STATE_CHANGED_ACTION.equals(intent.getAction())) {
    int cstate = intent.getIntExtra(EXTRA_WIFI_AP_STATE, -1);
    if(cstate == WIFI_AP_STATE_ENABLED) {
    if(mHandler != null)
    mHandler.sendEmptyMessage(MESSAGE_AP_STATE_ENABLED);

    /*notify glass to reconnect*/
    String ssid = getValidApSsid(context);
    String pw = getValidPassword(context);
    int security = getValidSecurity(context);
    SettingModule.getInstance(context).sendWifiApInfo(ssid, pw, security);

    }if(cstate == WIFI_AP_STATE_DISABLED || cstate == WIFI_AP_STATE_FAILED) {
    if(mHandler != null)
    mHandler.sendEmptyMessage(MESSAGE_AP_STATE_FAILED);
    }
    }
    }
    };

    public enum WifiCipherType {
    WIFICIPHER_NOPASS, WIFICIPHER_WPA, WIFICIPHER_WEP, WIFICIPHER_INVALID, WIFICIPHER_WPA2
    }

    public String getValidApSsid(Context context) {
    try {
    Method method = mWifiManager.getClass().getMethod("getWifiApConfiguration");
    WifiConfiguration configuration = (WifiConfiguration)method.invoke(mWifiManager);
    return configuration.SSID;
    } catch (Exception e) {
    Log.e(TAG,"testing" + e.getMessage());
    return null;
    }
    }

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

    I want to automate getting info from a website for work. What problems am I going to run into developing an app to do that?

    Posted: 11 Jan 2021 01:06 PM PST

    My small company has a vendor that we deal with daily. We have to get pricing on items from their website. We will have a list of several items to price each time. It's tedious to log on, type in a part number and wait for the item page with the price to appear for each item we are looking to buy.

    It occurred to me today that this task could be automated. I don't know much about software development so I am aware will be hiring someone to set it up. Still...what am I getting into? Is this a big deal to develop or something rather simple? Am I way off base on the scope?

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

    Need help with a mysterious file that appeared out of nowhere in my GitHub repository

    Posted: 11 Jan 2021 08:15 PM PST

    Alright, so I don't really know if this is the right place to ask, so please redirect me elsewhere if there is a community that could help me with this.

    With that out the way, let me describe my situation. I have discovered an unknown file in the public directory of my next.js project. The file is "wholesome.exe" and I have absolutely no idea where it came from. Here is some information I was able to gather:

    1. The file is not actually an executable. I tried running it in a sandbox environment (so it wouldn't wreck my system if it was a virus) but it did not work. Upon analyzing the file with trid, it reported an ~80% chance of it being a jpg and a ~20% of being an mp3.
    2. The file was created 30 seconds before the New Year. I am 100% sure I did not do it.
    3. It is 24.4 KB
    4. My antivirus does not consider it anything dangerous.

    What can I do to figure out what this is? I am beyond intrigued and really want to get to the bottom of this. Any kind of resource or direction would be greatly appreciated.

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

    has google search gotten less accurate ?

    Posted: 11 Jan 2021 02:42 PM PST

    I don't know if its just me but for the past 1-2 years especially last year I think google search has gotten less accurate for me (with ad block on). Maybe my queries have become more specialized and concise but I am not sure or convinced with that.

    Was curious if anyone else has been thinking/feeling that ?

    Maybe its just in my head 😕

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

    Storing Images in Memory NOT as files

    Posted: 11 Jan 2021 01:36 PM PST

    Hi programming reddit!

    I'm capturing screenshots and am saving them to a folder on the computer. However, i would like them not to be saved to a file, rather be in an array in memory until the user explicitly wants to save them to disk. I capture 1-10 screenshots than after the 10th one is captured, i start overwriting 1-10 again. This way, if the computer crashes, potentially sensitive info is not left on the HDD. Is this even an array? Is this possible? don't mind doing the research but not sure what to look for....

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

    Brain switch?

    Posted: 11 Jan 2021 08:23 AM PST

    Does anyone else feel something "click" when they begin to write complex logic? It feels like a switch somewhere behind my eyes like my brain says, "O.K logic mode activated. Nothing else matters." Am I dying? /s

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

    Programming

    Posted: 11 Jan 2021 04:19 AM PST

    I want to learn about programming, but I don't know anything about it. We don't have a good school here who offers ComSci. Are there any online alternative good to use? Basically explaining everything starting from basics? I don't mind spending money on it.

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

    npm run <command> not working

    Posted: 11 Jan 2021 04:48 PM PST

    C:\dev\proj\angular-atm>npm run server

    npm WARN lifecycle The node binary used for scripts is C:\Program Files\nodejs\node.exe but npm is using C:\Users\mpwes\AppData\Roaming\npm\node_modules\node\bin\node.exe itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.

    > u/benderco/angular-atm@0.0.1 server C:\dev\proj\angular-atm

    > json-server --watch ./server/database.json

    The system cannot find the path specified.

    npm ERR! code ELIFECYCLE

    npm ERR! errno 3

    npm ERR! u/benderco/angular-atm@0.0.1 server: `json-server --watch ./server/database.json`

    npm ERR! Exit status 3

    npm ERR!

    npm ERR! Failed at the u/benderco/angular-atm@0.0.1 server script.

    npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

    npm ERR! A complete log of this run can be found in:

    npm ERR! C:\Users\mpwes\AppData\Roaming\npm-cache\_logs\2021-01-12T00_46_36_061Z-debug.log

    C:\dev\proj\angular-atm>

    Anyone seen this before?

    I have tried following This SO post.

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

    What do you dislike about C# Winforms?

    Posted: 11 Jan 2021 11:57 AM PST

    I'm comparing platforms, I'd like to know what do guys dislike about C# Winforms? technical and "personal" opinions are welcome

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

    How do I choose what's next? and How do I do it?

    Posted: 11 Jan 2021 12:45 AM PST

    I've been interested and "in love" with programming from a very young age. So in the past couple months i decided to finally put my head into it and do my best to try learn. I'm personally an extremely "work and learn" person. Therefore due to the interest i found in making a game or something, I decided to tackle Unity. Well.. I would like to think I did well for a beginner and probably could have pushed further, however due too school I just couldn't find any time to continue. Ultimately I quit. I decided to take on smaller projects that I would be able to maintain regardless of school. Therefore I've been learning python for the past 6 months-ish, and in the past 2 months I've been dedicating my time to a discord bot made in python. So, I'm not so sure, but I'd like to think that its time to perhaps take a look at another language.

    This leads to the big questions:

    • How do I know that I've learned "enough" in a language and must start learning another?
    • How do I figure out what language should I learn next?
    • How could I use my current experience to speed up/improve the learning of a new language?
    • Should I continue the maintenance of a python project to keep myself in touch?

    Thank You

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

    Is Polymorphism just another tool for Abstraction ? and Inheritance is another tool for Composition ?

    Posted: 10 Jan 2021 10:17 PM PST

    Hi all,

    After reading the first 2 chapters of SICP, I stumbled upon this question. It would be delightful, if someone can provide some insights.

    thanks

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

    Keep numbers in a certain range

    Posted: 11 Jan 2021 12:50 PM PST

    Is there a smart way to keep number rotating between 0 and 3 . So if I increment if goes 0 1 2 3 0 1 2 3 (this can be done using mod 4) but what if I am decrementing as well so 3 2 1 0 3 ... (I want it to be able to increment and decrement but say between 0 and 3)

    I know I can just do if statement bu was wondering if there's a mathematical way

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

    How are you staying focused/motivated when working from home?

    Posted: 11 Jan 2021 02:03 AM PST

    People who usually need the office environment to get your brain to realise it's work time; how have you changed your behaviour or home setup to stayed focused on work?

    Towards the end of last year I was really struggling to stay focused on my work. I was hoping that the Christmas/new year break would help me reset and get back into the flow of things but if anything I feel like that's made it worse. I really really struggled to get settled last week and we're back to Monday morning again and it's not feeling any different. I haven't had that "in the zone" programming feeling for some time now and I feel like it starting to become a problem with deadlines approaching.

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

    How can I program a password predicting AI?

    Posted: 11 Jan 2021 10:46 AM PST

    I was thinking about doing a password predicting AI (ignore that it is pretty useless and pointless, for me, it is still beautiful lol) it should guess passwords based on personal information, but I have no background in AI, I was thinking of doing it in Python or C, because those are the languages I'm more familiar with, if you can make it like a tutorial and keep it simple I would appreciate it

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

    [JAVA] select an array at random

    Posted: 11 Jan 2021 12:45 AM PST

    Hi, new to java so I may have this arse about. I have some arrays, eg:

    user1 = {"john","123 fake st", "male"} user2 = {"sally","33 long rd","female"} user3 = {"phil","47 coconut st","male"} 

    I'd like to choose a user at random, then display the elements I choose, eg

    The person's name is $randomlychosenuser[0] and their gender is $randomlychosenuser[2]

    I'm able to generate a random variable, eg user2, but I can't find a way to pull out the info I want. Any thoughts?

    Let me know if there's a better approach to storing/retrieving the data - I looked at some hashtables but they seemed to only support 1:1 key and value. I could end up having 4 or more properties per "item".

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

    What is the benefit of using input iterators in C++? Over the other types of iterators.

    Posted: 11 Jan 2021 03:16 AM PST

    Why not use just bidirectional iterators since they can be incremented and decremented if needed to?

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

    IDE not displaying images

    Posted: 11 Jan 2021 09:13 AM PST

    So I typed a java code on Eclipse IDE from YouTube to read an image and display it as output. I followed exactly what the guy said, he was able to display the image but not me. Do you think I'm lacking any libraries or files something that are related to images? I already got java installed. Is there anything else I'm missing?

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

    Best resource to learn Kotlin.

    Posted: 11 Jan 2021 10:48 AM PST

    I am a complete beginner to any sort of programming. Where would be the best place to learn Kotlin from that tailors to a complete beginner.

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

    React Native, Xamarin, or some other framework for cross-platform mobile app?

    Posted: 10 Jan 2021 10:13 PM PST

    I finally have an idea for a mobile app and I'm wondering what the cool / popular mobile framework is today. React Native and Xamarin both seem to be adequate but I am not sure how they compare to each other (pros/cons). For anyone that has used both, which do you prefer and why? For everyone, what other options might be better?

    I am comfortable in JS and C#. Generally, what's important (in no particular order) to me is relatively low learning curve / time to market, code maintainability, community support.

    Let me know what you all think.

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

    No comments:

    Post a Comment