Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

-iSynthesis

Member
  • Content Count

    2,482
  • Joined

  • Last visited


Reputation Activity

  1. Like
    -iSynthesis got a reaction from A Silver in One dusty server   
    Generally, nothing is wrong with it. With this much dust however a vacuum will be much more effective at cleaning out the worst of all. And with this much dust you would not want to stand anywhere near the computer when using canned air, i guarantee you...
  2. Agree
    -iSynthesis reacted to Hekoki in Tearing my hair out over this   
    are you sure that the file path is correct? no typos? is it a jpg instead of a jpeg?
  3. Informative
    -iSynthesis got a reaction from Whosonicus in Which language to learn first?   
    I'd start with C/C++ and then continue with other "easier" languages. I started with java and find it rather difficult to go to C++. You will easily be able to adapt to languages such as C#, java or even Ruby when you have a good foundation like C++.
  4. Informative
    -iSynthesis got a reaction from Whosonicus in Which language to learn first?   
    I'd start with C/C++ and then continue with other "easier" languages. I started with java and find it rather difficult to go to C++. You will easily be able to adapt to languages such as C#, java or even Ruby when you have a good foundation like C++.
  5. Like
    -iSynthesis got a reaction from ElaTheDeveloper in HTML and CSS   
    I'd recommend Brackets. Light weight but very powerful. I personally use PHPStorm for most of the stuff i do now, just because i find the project overview better.
  6. Like
    -iSynthesis got a reaction from Merkey in SQL vs MySQL - any difference?   
    SQL (AFAIK) is the language used. MySQL is an application using SQL that needs a server which is hosting the MySQL database. SQLite for example does not require a server.
  7. Informative
    -iSynthesis got a reaction from Merkey in SQL vs MySQL - any difference?   
    You need a Server hosting it and can then make SQL Querys (e.g. through java or other programs). 
    e.g. 
    SELECT VorlNr, Titel FROM Vorlesung WHERE Titel = 'ET';  
  8. Informative
    -iSynthesis reacted to Electronics Wizardy in Need advice on CPU/APU   
    Id get a pentium g4560. Its faster than the amd apu's, lower power, and about the same gpu power. 
  9. Informative
    -iSynthesis reacted to Chaoix in PHP Help   
    @-iSynthesis Alright. All of this comes with the disclaimer that there are so many things wrong security wise with what you are doing here, but I do understand the importance of learning the wrong way to do something to help you work toward the right solution. I am a professional Web developer.

    Don't use $_GET, use $_POST. There is a character limit on the get array due to it being processed from the browsers URL bar (limit ~2048 characters).
     
    Its probably easier to write to a file (this is basically a flat file database) and in other-site.php put that files contents into the html output.
  10. Informative
    -iSynthesis reacted to LUUD18 in PHP Help   
    This is not the right way to setup a CMS. I would recommend using a database and putting the comments in there. 
  11. Like
    -iSynthesis got a reaction from Dat Guy in PHP Help   
    I don't want to make it too complicated. It is a website for a school project and i want a few others to be able to add text (an article) to one file (other-site.php). 
  12. Informative
    -iSynthesis reacted to mariushm in PHP Help   
    Don't use $_GET , use POST method to submit forms. 

    Then use $_REQUEST to retrieve data , $_REQUEST holds both $_GET and $_POST, so it can be used throughout pages for simple things like $_REQUEST['id']  for pages like viewarticle.php?id=1  or for more complex stuff like whole chunks of text that wouldn't fit inside the URL ( which would be how data is sent to the server and then shows up in $_GET array
     
    Don't replace text within PHP files.  Store the data inside individual text files, see functions like file_get_contents to read the contents of a whole file into a string in memory, or file_put_contents  to store data into a file.
     
    The most complicated part would be having unique IDs for each page in your Wiki. A database would take care of unique IDs very easily but if you don't want to use databases, you can store this information into a separate text file.
     
    For example, your configuration file would be something like this (you make the assumption that the content of page with unique id 1 will be saved in the 1.txt and so on)
     
    1|Main Page
    3|About
    4|Random Page
     
    And when you want to add a unique page you just have to read all those lines in memory and determine the last number  and increment that by one and write it to file.
    Here's some simple code for that

     
    <?php $enter = chr(0x0D).chr(0x0A); // two characters in Windows CR + LF (carriage return and line feed) $cfgfile_contents = file_get_contents('database.txt'); // splits the whole contents of the database.txt wherever it detects the enter character combination, and puts it into an array // so $rows[0] = '1|main page' ; $rows[1]='3|About'; $rows[2]='4|Random Page'; and so on. $rows = explode($enter, cfgfile_contents); $rows_count = count($rows)-1; // because arrays start from 0 .. so if we have two lines in the text file, $last_id = 1; // we assume the last used unique ID was 1 because so far we don't know how many pages there are in the cms // now we go through each entry and separate 1 and the title of the wiki page foreach ($rows as $key => $value) { // key is 0,1,2,3 the unique position in the array, the $row holds the actual value for that position in array // key isn't necessarily equal to the unique id, because you may delete some pages at some point and you won't reuse those numbers $rows[$key] = explode('|',$value); // now $rows[0][0] = 1; $rows[0][1] = 'Main Page'; now $rows[1][0] = 2; $rows[1][1] = 'About'; ... and so on if ($rows[$key][0] > $last_id) $last_id = $rows[$key][0]; } // if you want to add a page to your cms . $last_id = $last_id + 1; $rows_count = $rows_count+1; $rows[$rows_count] = array( 0 => $last_id, 1 => 'New title page'); // if you want to delete a page, just set the title to an empty string and when you save the text file you don't write that line // if you want to save changes $file_handle = fopen('database.txt','w'); // open a file handle with the mode 'w' , write only ) $first_line=TRUE; foreach ($rows as $key => $row) { if ($row[1] !=='') { // page title is not empty aka you didn't delete this page if ($first_line==FALSE) fwrite($file_handle,$enter); // no need to advance to new line if we're writing the first ever line in the text file $first_line=FALSE; fwrite($file_handle,$row[0].'|'.$row[1]); } } fclose($file_handle); // close the file ?> and the page that shows what user entered, would read the text file (1.txt, 3.txt, 4.txt etc ) using something like file_get_contents(filename) but you don't just use echo $file_contents  because some characters are not allowed to be printed directly into a html page.
    Use a function like htmlspecialchars to convert characters that have special meaning like <  and > and & into a combination of characters that's safely parsed by browsers.
     
    if you learn some url_rewrite rules, you can make your cms have nice urls like  www.yoursite.org/pages/1/Main_Page , www.yoursite.org/pages/3/About  and so on
    The web server converts those URLs based on the url_rewrite rules to your viewarticle.php?id=1 , viewarticle.php?id=3 and so on  then your code in viewarticle.php  uses $_REQUEST['id] to get the unique ID from the URL , makes sure the is actually a number, optionally read database.txt to extract the page title for your page if you won't save the title as a first line in your 1.txt, 2.txt , 3.txt and so on
    then echo/print the contents of the unique text file after you escape the contents using functions like the one i mentioned above.
     
  13. Informative
    -iSynthesis reacted to mariushm in PHP Help   
    The problem with non-database CMS systems is that it's more difficult to prevent two or more users simultaneously apply edits to a page. Especially if all the content is stored in a single big file.
    In addition to that, some file systems are slower when there's lots of files inside one folder ... for example, NTFS is much slower at parsing the contents of a folder and reading the first byte of a file if a folder has more than maybe 1000-2000 files in it, regardless of their size. Write a small php script with scandir or a c program with the windows api functions like findfirstfile and so on, and time how long it takes with a large folder and with a small folder.
    That's why lots of websites (for example mediawiki based sites) store files in multiple subfolders,for example they create a unique SHA1 hash for each file and then store the file on disk in "files/01/0156/01560024d4ae.. " in order to reduce the chance of one folder going over around 1000 files.
    When there's a chance multiple users may hit save and change a file at the same time, you'd have to complicate your life with your script LOCKING the file to be read/write only to that thread, make changes, unlock the file ... if another script tries to save at same time it would be unable to open the file because it's locked by another instance of the script (which would be often if you store all pages in a single big file), you'd have to implement a sort of "delay and retry a few times until you obtain a lock on the file"
     
    With a database, you'd have row level locking at least so you can start a transaction and lock that row, read the contents, make the edits, save them , close transaction and you can be sure no other thread messed with the content between the moment you read it from the row and made the changes.
    Think mediawiki (wikipedia and sites like it) and how they make DIFFs between current version and the changes made by user (that he wants to save) where they create revisions and store the changes in order to allow for undo/revert changes .. the creation of such diffs can take time which means those rows can be locked for a few seconds.
     
    With plain files you also have the issue of them being cached by the operating system and not having control over when they're dropped from memory, and if they're not cached but you have lots of people reading different pages, you're limited by the hard drive's i/o throughput especially with small files ,,, run a hdd benchmark tool like Crystal Disk Mark and see how fast a regular hard drive can read 4KB chunks of data (hint: it's below a few MB/s)
     
    A smart database system would cache the whole table in memory and keep it there, if it has the memory to do so, and would only commit changes to disk. it would also cache the queries like "get me the title of the page with the unique id 123456" - you wouldn't have to read the contents of a whole file in memory and parse it to find the line with id 123456 and retrieve the page title from there, the database would know it made that query at some point in the past, so it knowns the data is in row xyz in table abc, already cached in memory at position xxxx so it jumps there, reads the bytes for that row and returns the title of the page. 
     
    So basically, your scripts will retrieve the content of each page much faster.  And, in the case of systems like mediawiki where  a page can be made of multiple other pages, it's way faster to retrieve all components, parse/compile them , then store a "compiled" version of the page in memory using something like "memcached" 
     
    // apologies for typos, damn temporary keyboard (broke my old one and it's not sold anymore so have to search for a new one) ... not used to the layout of the keys on this crap one and it's much harder on the fingers compared to my old one so sometimes i miss some keys by not pressing deep enough
  14. Agree
    -iSynthesis got a reaction from i_build_nanosuits in 1050 Ti for Game design   
    While I have not worked a lot with engines, i highly doubt this. Battlefield 3 was created even before the HD 7000 Series of AMD. After your theory, they must've had a terrible experience creating the game.
    Of course, Engines have become more demanding but OP is (probably) not trying to create the next AAA game so i see no problem. 
     
    Unreal Engine lists "DirectX 11 compatible graphics card" as recommended hardware so...
     
    Edit: As to your question, @Zando Bob: I guess there would only be the RX 460 which is under 140$ and i believe the 1050ti performs better in most cases, though both gpus will be good options.
  15. Like
    -iSynthesis got a reaction from Akamii in Backplate really matters?   
    It looks good, other than that they have little to no use. Until one or two years back almost no GPU had a backplate.
  16. Like
    -iSynthesis got a reaction from madknight3 in Changing code style in Jetbrains Webstorm   
    You honestly saved my life, thought i had to abandon this program already^^
  17. Agree
    -iSynthesis got a reaction from Dat Guy in I'm confused about the commenting part in python   
    Why not. It helps a lot, f.e. when looking at older code of yours to have comments. Saying you don't comment for yourself is stupid because it can help a lot. If you're writing a larger program you will likely not remember what some methods do or what a variable is used for etc. 
    Edit:
    I guess another good example is html. On a website with several <div> tags in a row it helps a lot to comment where which div tag ends, instead of just </div>
  18. Funny
    -iSynthesis reacted to v0nn_toaster in Whats Your Response to this ad   
    thats offensive to me
  19. Funny
    -iSynthesis reacted to FRN in Calculations not printing   
    I certainly hope this isn't the source code of CSGO.
  20. Agree
    -iSynthesis reacted to Arty in Random poll: What text editor do you use?   
    Brackets.io
  21. Agree
    -iSynthesis reacted to TheBestUserName in What can I buy for 500   
    A really great hooker for the evening. 
  22. Agree
    -iSynthesis got a reaction from MrDynamicMan in Click bate with CES content makes it frustrating to know what the product is   
    It's obvious that a title like that draws views. That's what it's for, still doesn't make neutral news though. TBH, the example is quite unfortunate because theres not much to talk about a rgb water cooling fitting, IMO a video on a thing like that is unnecessary. It would be enough to just shortly mention it in another video of EK. I'll give an example where i find the title o.k.: "Slim Gaming Notebook for $800" - Gives precise information. No clickbait, just a short description of what the video will be about. You still want to know more information about the laptop, that's what the video is for. Then i'll give you an example of a worse title: "$599 Cube of DREAMS" - What is this Cube? Is it a Computer? Why would it be a dream of mine? Clickbait at it's finest. The title could just as well be "Cube-shaped computer priced at $599" or something similar and thereby be neutral. 
  23. Agree
    -iSynthesis got a reaction from MrDynamicMan in Click bate with CES content makes it frustrating to know what the product is   
    It's obvious that a title like that draws views. That's what it's for, still doesn't make neutral news though. TBH, the example is quite unfortunate because theres not much to talk about a rgb water cooling fitting, IMO a video on a thing like that is unnecessary. It would be enough to just shortly mention it in another video of EK. I'll give an example where i find the title o.k.: "Slim Gaming Notebook for $800" - Gives precise information. No clickbait, just a short description of what the video will be about. You still want to know more information about the laptop, that's what the video is for. Then i'll give you an example of a worse title: "$599 Cube of DREAMS" - What is this Cube? Is it a Computer? Why would it be a dream of mine? Clickbait at it's finest. The title could just as well be "Cube-shaped computer priced at $599" or something similar and thereby be neutral. 
  24. Agree
    -iSynthesis reacted to mrchow19910319 in Click bate with CES content makes it frustrating to know what the product is   
    Agree. Unsubbed long time ago. Everything feels too cheesy for me. The ridiculous thumbnail, all the obvious product placement, also let's not even forget  about all those "I spend $100000000 on a pc so I am cool" videos. Compare to watching his vids, I prefer sometimes come here and chat with people, see the latest tech related news and stuff. I know I am not the only one who feels this way. So. *hand shake*
  25. Agree
    -iSynthesis got a reaction from dalekphalm in Click bate with CES content makes it frustrating to know what the product is   
    Well it's what differs quality news from click bait. You saying you wouldn't watch the video because the title gives the most important information of the video is like saying you wouldn't read a newspaper article because the title gives the most important information. 
×