Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 03/03/2016 in all areas

  1. trancexx

    How computers work

    But that's not it. When you start Windows you actually start a program (I'll underline it from now on). That program is the only thing that ever "touches" your computer's CPU. Then that program creates interface for you (the user) to start application(s). At the same time the program creates time slots in which it then puts tasks. Time slot is a portion of overall time. The program doesn't advertise how big one time-slot is. It can be two ticks, 1 millisecond, 6 instructions, or whatnot. This is done to create impression that it runs more things at the same time. It actually runs only one thing at any given time, but switches too fast for you to notice it. When mentioned applications are "started" the program puts it into one time slot. Sometimes these slots are divided into sub-slots (working threads) of a process. When one time-slot is "active" the program takes binary data (opcodes) from the application and "pushes" it to the CPU onto its behalf. Race condition can occur, for example, if the program has bug and allows two slots to overlap. This usually ends up with BSOD. More common and usual case of race condition occurring is when programmer asks the program to create sub-slots (threads) and then access the same addresses from two different sub-slots. Because the program didn't say for how long one sub-slot will run, it can happen that one sub-slot runs for longer time than another before execution is switched to another sub-slot. First slot might have executed more instructions. The problem for the code in another sub-slot is that the code from the first one may have changed data at the shared addresses. Then that other thread continues, but has no idea that the data it works on has been changed by someone else. Now, that is it in layman's terms.
    2 points
  2. Okay, so everything should be clear now. The @mLipok's mySQL UDF use the latest/ a newer version of mysql driver which use another authentication hashing method that your mysql database does not support, so you need to do some addition step with your database to update that hash (for instruction to solve the problem please follow the link in previous @mLipok's post) If you don't want to mesh with the database and if you use @tarretarretarre's UDF without any problem, just use it -- Translated by Google myself "Được rồi, mọi thứ rõ ràng rồi. UDF của @mLipok dùng với những phiên bản mới nhất của mysql driver, nó dùng phương pháp băm (hashing) khác để xác thực người dùng mà cơ sở dữ liệu mysql của bạn không hỗ trợ, vì vậy bạn cần phải làm một số bước bổ sung với cơ sở dữ liệu của bạn để cập nhật các hash đó (hướng dẫn để giải quyết vấn đề xin vui lòng làm theo các liên kết trong bài trước của @mLipok) Nếu không muốn động đến cơ sở dữ liệu và nếu bạn dùng @tarretarrentarre UDF mà không có vấn đề gì thì cứ dùng nó luôn đi"
    2 points
  3. jaberwacky

    How computers work

    It seems to me that you would be interested in the dining philosophers problem.
    2 points
  4. RTFC

    How computers work

    This might clarify.
    2 points
  5. I want to present BETA Version of my ADO.au3 UDF. This is modifed version of _sql.au3 UDF. For that I want to thanks : ; Chris Lambert, eltorro, Elias Assad Neto, CarlH This is first public release , and still is as BETA DOWNLOAD LINK (in download section): Have fun, mLipok EDIT: 2016-06-03 Below some interesting topics about databases: EDIT 2016/07/04: For more info about ADO look here: https://www.autoitscript.com/wiki/ADO FOR EXAMPLE DATABASE use AdventureWorksDW2016_EXT.bak from: https://github.com/microsoft/sql-server-samples/releases/download/adventureworks/AdventureWorksDW2016_EXT.bak I will relay on this database in my examples. Here is link to post which shows how "ODBC Data Source Administrator" looks like.
    1 point
  6. Now replaced by a new version of the UDF in this link. <hr> [NEW VERSION] - 7 Mar 16 Added: A new option for $iAdded (+ 512) allows you to select just one cell of the ListView rather than the whole row. A new function _GUIListViewEx_SetDefColours allows the user to set the default colours when using either or both the "colour" and "single cell selection" options. Another new function _GUIListViewEx_BlockReDraw which prevents ListView redrawing during looped Insert/Delete/Change calls - this greatly speeds up execution by avoiding lengthy redrawing when using either or both the "colour" and "single cell selection" options, use of which forces the redraw to use a WM_NOTIFY handler within the script. Changed: A number of minor internal changes to speed up the loading of the ListView when using either or both of the "colour" and "single cell selection" options. A slightly modified Example_6 script shows the new functions in use. The LH native ListView can have rows and columns added/removed using both the old and new functions and has a context menu to allow for colour selection. The contents of this ListView can be mirrored to the RH UDF-created ListView which has "single cell selection" enabled and allows the colours of any item (including the selected cell) to be changed programmatically. New UDF in the zip below. Previous changes: ChangeLog.txt Hi, It seemed that I wanted to add, delete, edit or move items in a ListView quite often in my scripts and I got fed up with having to rewrite the code to do it each time. I also wanted to be able to drag items within and between ListViews with the mouse, plus edit the items. So I decided to write a UDF to make life easier and here is the result - GUIListViewEx. If you are interested in how it works, then read this bit - if not, then skip over it: The UDF is pretty easy to use: - You start by creating a ListView (either native or UDF) and passing the returned ControlID/handle and the array you used to fill it to the _Init function of the UDF. You also indicate whether the array has a count in the [0] (or [0][0]) element and if you create an empty ListView, the UDF will still cope and will shadow any items that you insert later. If you have a ListView filled with data but no matching array, there is a function to read that data into an array for you. You can select a colour for the insert mark when dragging items if you are going to use this feature - the default is black - and decide whether to have a shadow of the dragged item follow the mouse. Finally you can set the ListView to be sortable, editable - with various options to determine how the editing process works, determine external drag/drop behaviour and whether user colours are used. - You need to register a few Windows messages, but this is a single call to the _MsgRegister function. If you already have handlers for the relevant messages, there are functions to call within these handlers instead. If you do not want to drag, then you only need the WM_NOTIFY handler loaded. - Then you just need to call the main _Insert($vData), _Delete, _Up, and _Down functions when the appropriate button is pressed, select and drag items, or use one of the edit functions and your ListView responds automatically. - The UDF shadows the contents of the ListView (as explained in the spoiler section above) so you can get its current state at any time with the _ReturnArray function . Many of the functions actually return this data after each call just to help you keep track and there are dedicated Save/Load functions. - If enabled, the user can colour individual items within the ListView - and can set certain elements to be coloured on loading if required. - There are a couple of functions that you need to run in your idle loop if you need the functionality - they detect when items are dragged and edited. - When you have finished with the ListView, you should use the _Close function to clear the memory used by the UDF to shadow its contents. It is not vital, but if you use a lot of ListViews and do not do this, you could end up running out of memory. - You can have as many ListViews as you wish on display at any one time and the same "Insert", "Delete", "Up" and "Down" buttons can be used for them all - you just have to click on the one you want to be active. The UDF also allows you to set the active ListView programatically (_SetActive) - and to determine which is currently active (_GetActive). There are also additional Insert/DeleteSpec functions which allow you to action non-active ListViews. There are 6 example scripts to show the UDF working on native and UDF created ListViews, with single or multiple columns and either filled or empty, along with the UDF itself in this zip file: Credit to martin (for the basic drag code which I found on the forum), the Array UDF authors (for the basis of the array functions) and LarsJ (for the basic colour handler code). Happy for any feedback - hopefully positive! M23
    1 point
  7. trancexx

    A naive question

    assert is just something that the programmer asserts. You can simply remove lines with asserts.
    1 point
  8. Thank you, I look forward to see what you think Oh, i cannot update the script right now, because im not home but for fast fix, you can go into parser.au3 @ line 31 you will find this ; timeout _IELoadWait($oIE, 1, 10000)
    1 point
  9. StringRegExpReplace($str, '(<q\d+=")(.*?)(">)', '${1}907605$3') ; note the "?" after ".*" (look at the StringRegExp help page) or StringRegExpReplace($str, '<q\d+="\K[^"]+(?=")', '907605')
    1 point
  10. If you want to display the password, you're not so lucky. Many framework use an addition layer to protect the password so when hackers have access to the database, they cannot also steal the password from it. In addition, the password cannot be revert to the plain text form. Unless the database and the code to populate data to the database is your code, I think you cannot get the real password -- Translate: Không được đâu sói ạ (don't be evil)
    1 point
  11. $output = StringRegExpReplace($str, '<q\d+="(\d*)">', '907605') @namlunthkl: There're no need to bump the thread. There're many members but nobody can stay all the times in the forum to answer all the question. Just wait politely. If you want replace all the value to a single value, it's easy but you need the right regex pattern $output = StringRegExpReplace($str, '<q\d+="(\d*)">', '907605')
    1 point
  12. TheSaint

    Why sort alpha-numeric?

    Taken from - https://en.wikipedia.org/wiki/Lexicographical_order Perhaps that helps? Me, I continue to struggle with the notion, that numbers can be alphabetical in their numeric state. It seems like an oxymoron to me. To me, the numbers should be ignored or placed at start or end, without sorting ... for the sorting would require being numerical, not alphabetical.
    1 point
  13. 'id db_users' what is this string in your query ? If this is collumn name (with space in name) then try to use: Local $sQUERY = "SELECT password FROM WHERE `id db_users` = 1" http://stackoverflow.com/questions/14190798/how-to-select-a-column-name-with-space-between-in-mysql-on-liunx-ubuntu btw.. on MS SQL this should look like this: Local $sQUERY = "SELECT password FROM WHERE [id db_users] = 1"
    1 point
  14. You could try this, no driver required, just unzip and go
    1 point
  15. Well in my case your suspicion just saved me hours. So I like your nature
    1 point
  16. I assure of no such breaching activity. And thank you for putting me in the right direction, to my surprise there is a way to get the data and the website support team is going to assist me on how to do it. Thank you all for your replies..
    1 point
  17. Hi Rechard You should convert your BMP to JPG or PNG and then add it again. As it should be visible as an image on your post. It is not very helpful to others if we have to download a file to see what you are getting at.
    1 point
  18. There are skinning UDFs for GUIs in the example scripts forum. Other than reskinning your GUI, you'd have to build your own customized scroll bar.
    1 point
  19. #include <Array.au3> $xml = "<root>" & @CRLF & _ " <JoinDomain>{domain}</JoinDomain>" & @CRLF & _ " <MachineObjectOU>OU=Computers,OU={site},DC=Global,DC=Coach,DC=Com</MachineObjectOU>" & @CRLF & _ "</root>" Local $oXML = ObjCreate("Microsoft.XMLDOM") $oXML.LoadXML($xml) $oDomain = $oXML.selectSingleNode("//JoinDomain") $oMachine = $oXML.selectSingleNode("//MachineObjectOU") $oDomain.text = "SomeNewDomain.internal" $sMachineOU = $oMachine.text $aMachineOU = StringSplit($sMachineOU,",",2) For $i = 0 To UBound($aMachineOU)-1 If StringLeft($aMachineOU[$i],2)="OU" And Not ($aMachineOU[$i]="OU=Computers") Then $aMachineOU[$i] = "OU=SomeNewDomain.internal" EndIf Next $oMachine.text=_ArrayToString($aMachineOU,",") ConsoleWrite($oXml.xml & @CRLF) ; $oXML.Save("c:\something\something.xml") If you want to read the XML from a file rather than a string, use $oXML.load("c:\something\something.xml")
    1 point
  20. Damn @mikell I would've never thought about it like that. Good looking out
    1 point
  21. It depends on what you want. In any browser addressbar you can type javascript to execute actions or analyse dom structure. Thats sometime an efficient way to speak to your browser if you want to control all browsers in same way.
    1 point
  22. trancexx

    How computers work

    Race condition on level of cpu doesn't exist in "normal" mode. It can happen with overclocking when components that form logic circuits fail to change state fast enough. JohnOne, I believe you mean operating systems, rather than computers in general. That's where racing conditions can occur, because that's where (artificial) time slicing starts. It's level above CPU.
    1 point
  23. jaeger52

    How computers work

    JohnOne, I was intrigued by your question as I realized i did not know the answer either, and I id a little poking around. I think TheSaint is correct about the correlation between race conditions and bottlenecking. It's definitely a timing issue, and bottlenecking could cause enough chaos to have threads run in the wrong sequence, throwing the error.
    1 point
  24. TheSaint

    How computers work

    My understanding is that it is to do with pipes, bottlenecks and timing, Which to me, means you can have simultaneous processes occurring (cores), but then they share output and input pathways, and that is where timing comes into it. First come first served is where I imagine the racing occurs. I am however far from being an expert, and so could be completely wrong in what my mind has pieced together, from things I have read and what seems logical. It has also been some time between readings ... usually only when considering my next PC. I have forgotten for instance, where the Southbridge fits into all that ... just remember it improves things in that regard ... alternate pathways or something. My advice, is don't get old ... you forget or misremember things ..... oops too late.
    1 point
  25. The best optimization by far would be to use Scripting.Dictionary #include <Array.au3> local $BlackList = ["xxx", "yyy", "zzz"] local $OldFoundMatchesUsernames = ["aaa", "bbb", "ccc", "ddd"] local $FoundMatchesUsernames = ["yyy", "ggg", "aaa", "eee", "xxx", "ddd", "ccc", "zzz", "fff"] ; create dictionary Local $sdFoundMatchesUsernames = ObjCreate("Scripting.Dictionary") ; $sdFoundMatchesUsernames.CompareMode = 1 ; case insensitive (if needed) ; build the dictionary (removing duplicates) For $i In $FoundMatchesUsernames $sdFoundMatchesUsernames.Item($i) Next ; remove blacklisted For $i In $BlackList $sdFoundMatchesUsernames.Remove($i) Next ; add $OldFoundMatchesUsernames (this also removes duplicates) For $i In $OldFoundMatchesUsernames $sdFoundMatchesUsernames.Item($i) Next ; get new $FoundMatchesUsernames array $FoundMatchesUsernames = $sdFoundMatchesUsernames.Keys() _ArraySort($FoundMatchesUsernames) _ArrayDisplay($FoundMatchesUsernames, "$FoundMatchesUsernames") Edit Comments added
    1 point
  26. You're 100% correct. Thanks
    1 point
  27. trancexx

    A naive question

    ++x*2 means to increment value of x and then multiply the result by 2. On the other hand x++*2 means to multiply x by 2 and then increment value of x.
    1 point
  28. I know, I was simply pointing this out for future noob readers.
    1 point
  29. I had to test it because my thought process for reference was it's the same as accessing the variable under a different name, so there should be no performance difference. Though I got that from C++ so it could be different for autoit. So my test, using an array with 16,777,216 elements, had it call a ByRef function and a function with Global access 1,000,000 times, and the function did some random access on the elements in the array. My results: Average: Median: The Script: Global $aTest[16777216] Global $iDiffRef = 0 Global $iDiffGlobal = 0 Global $tTimer $tTimer = TimerInit() For $i = 0 to 1000000 Test1($aTest) Next $iDiffRef = TimerDiff($tTimer) / 1000 $tTimer = TimerInit() For $i = 0 to 1000000 Test2() Next $iDiffGlobal = TimerDiff($tTimer) / 1000 MsgBox("", "", "ByRef = " & $iDiffRef & @CRLF & "Global = " & $iDiffGlobal) Func Test1(ByRef $aArray) $aArray[Random(0, UBound($aArray) - 1)] = Random(0, 255, 1) EndFunc Func Test2() $aTest[Random(0, UBound($aTest) - 1)] = Random(0, 255, 1) EndFunc My conclusion? The difference in time is so minuscule that performance is not an issue
    1 point
  30. guestscripter, Add region_indent=1 to your Tidy.ini or add the /Region_Indent (or /ri) parameter to a #Tidy_Parameters directive in the script. I use it all the time. Sometimes I wonder why I bothered to completely rewrite the SciTE4Autoit3 Help file last year - you can find all this via the <Help - SciTE Help - Extra Utilities - Tidy> menu option. M23
    1 point
×
×
  • Create New...