InterviewSolution
This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.
| 1801. |
Solve : Small issue with using PHP with bootstrap forms.? |
|
Answer» I feel like I am so close to it working but for some reason it isnt. |
|
| 1802. |
Solve : c++ programming? |
|
Answer» Please am facing challenges with two dimensional arrays, especially passing it as an argument to a function. I'll need your help guys.Quote And a two-dimensional array looks like this: int[][] myArray = { {0,1,2,3}, {3,2,1,0}, {3,5,6,1}, {3,8,3,4} }; For our purposes, it is better to THINK of the two-dimensional array as a matrix. A matrix can be thought of as a grid of numbers, arranged in rows and columns, kind of like a bingo board.https://processing.org/tutorials/2darray/ Which version of C++ ? If Visual Studio Express - C++ there are LOTS oof free tutorials. Fir a specific answer, look here: http://stackoverflow.com/questions/9446707/correct-way-of-passing-2-dimensional-array-into-a-function Quote You are doing in wrong way. You can pass 2-d array with the help of pointer to an array, or simply pass an array or through Single pointer. I worked on a program that will accept the HIGH and low temperatures of the month of the year, and the output the AVERAGE high and low temperatures and also the INDEX of the highest of the high temperatures and also the index of the lowest of the low temperatures. But it refused to run, code blocks instead alerted me of the wrong use of the "operator << std::". Please can you help me with ideas of what to do or to give me a working program to achieve that. Please your help will be appreciated. |
|
| 1803. |
Solve : Call Matlab script from Ansys? |
|
Answer» HELLO, For my project I need to CALL a Matlab script to Ansys. In the project the part is created and INNER side is emptied by using Matlab. After that I would like to call this part to Ansys in order to make a STRESS analysis. Is this possible. Thank you in advance. |
|
| 1804. |
Solve : Creating weebly app? |
|
Answer» HI, we are trying to create a website for our company which needs a demand page. The page would CONTAIN a form which the customer has to fill in like name, email or phone NUMBER, and the link of the item they want us to purchase for them. We don't mind using Godaddy, or weebly. But they don't have the service of sending a confirmation email or message to the customer to NOTIFY them of their submission, and also send a unique number of their order. Now as I searched around, only the option of creating our own app would work. My question, if you guys can help, is what do I require to create this app (I have some programming skills and web design knowledge)? Also anyone knows of a hosting service that has that feature? I understand that we will need a DB and java CODING. Also, can't we use yahoo mail to generate this email? Thank you. Note: no, customers in our country can't purchase things online, so our company would purchase the item for them and then deliver it. |
|
| 1805. |
Solve : Linux shell bash- unexpected end of file error? |
|
Answer» I can see two simple syntax errors that I need to correct, but my big question is why do I have an unexpected end of file error? I was able to use this SCRIPS to end a DIFFERENT program: if [ -f "$userFile" ]There is no exit for the program if the user hits the WRONG key? |
|
| 1806. |
Solve : need help writing a script to run a restore program? |
|
Answer» i am trying to write a script to do a restore. can i use a batch FILE to load scr files in an order. is this possible? any help will be greatly appreciated thanks wiz98 |
|
| 1807. |
Solve : Regex pattern for grep? |
|
Answer» I'm trying to write a regular expression that matches "one or more non-tab characters anywhere before the FIRST visible(0x21-0x7E) character in a given line." |
|
| 1808. |
Solve : 486 packardbell restore? |
|
Answer» I am TRYING to do a restore on a 486 packardbell Axcell 2018 but lost the password to unlock the restore SCRIPT. Any idea how i can get the script to do the restore. Any help will be greatly |
|
| 1809. |
Solve : Batch execution question? |
|
Answer» I have a number of NAS disks attached to my windows 10 desktop. For some strange reason, some of them go offline. I have a batch file to re-connect them, issuing "Net Use" commands. If I click on the file "Upnet,bat" I just get a flash of the command prompt window and no results. If I open the editor on the same file and use cntrl-a, cntrl-c then open a command prompt window and paste the results into the command prompt window, it works fine. This two-step process is fine for the task but I was wondering how to get it to run with a one click on the shortcut to the batch file. |
|
| 1810. |
Solve : C++ IDE Suggestion?? |
|
Answer» Looking for a replacement C++ IDE other than Microsoft Visual C++ \ Express. |
|
| 1811. |
Solve : Command Line? |
|
Answer» Hello, |
|
| 1812. |
Solve : VB6 need some help with console events please? |
|
Answer» Hi , |
|
| 1813. |
Solve : Perl is a socially-acceptable form of Visual Basic? |
|
Answer» Raymond Chen says on The Old NEW Thing: Worf noticed that a number of developer tools are written in perl and wonders what's up with that. For years I have been using a tool called Get_iPlayer to download radio and TV programming from the BBC iPlayer service. The engine of this is a perl script with 12,211 lines, and i must say I have felt quite happy HACKING around with it to customise various aspects. Even with no prior exposure I soon felt happy with the syntax, especially as there is a lot of perl guidance out there for the hard bits. Love the second comment in this snippet I just noticed: Code: [SELECT]# Clear all the PVR searches in %{$pvr} sub clear_list { my $pvr = shift; # There is probably a faster way delete $pvr->{$_} for keys %{ $pvr }; return 0; } Microsoft Basic has been around for a long time. It and other Basic dialests did a lot to develop the Personal Computer legacy. Recent versions of Visual Studio can be adapted to serve as a IDE for other computer languages. Quote Search Resultshttps://en.wikipedia.org/wiki/Microsoft_Visual_Studio and... https://msdn.microsoft.com/en-us/library/aa292164(v=vs.71).aspx Quote Microsoft partners with many companies to bring their languages to the .NET Platform. In addition to the languages provided by Microsoft, there are many alternative languages that target the .NET Platform, including:Notice there is an implementation of Perl. This is not new information, But many are not aware of how people are using Visual Studio to do unusual things. It's interesting that the very first comment there does precisely what Raymond Chen says, and starts slagging off Visual Basic developers! I think the comparison falls apart somewhat after .NET, though. With earlier versions of Visual Basic and the comparable tooling it was PRETTY cut and dried that Visual Basic was much faster- it was pretty much called a Rapid Application Development tool, after all. But once we jump to Visual Basic .NET I'm not entirely sure the analogy continues, or if it does it isn't really restricted to Visual Basic, as the "RAD" element applies to almost all .NET languages. I'd argue that the looked-down-upon technology that contributes to fast development of GUI programs on Windows could probably be Windows Forms. It's very poorly regarded because it doesn't properly fellate enterprisey developer methodologies. Fitting into the idea, though, I have a Command-line tool that is about 8 years old now that I use regularly for evaluating math expressions at the Windows command line. It's hardly the only program that does it but I sometimes make use of features like lists and sets whereas most other tools of the same sort are restricted to more standard arithmetic. At any rate, I wrote it in Visual Basic 6 and haven't bothered to replace it. I did rewrite it but I simply don't trust the new version even if it does pass all the unit tests. No unit test can replace 8 years of reliable results, after all. |
|
| 1814. |
Solve : Regedit string value data prefixes? |
|
Answer» Hi, I want set adobe reader "print as image" for all printer by default. reg add "HKCU\Software\Adobe\Acrobat Reader\11.0\General\cPrintAsImage" /v t1 /t REG_SZ /d "HP LaserJet 1018 (redirected xxxx)" /f If so, where does this value reside that you need to read it in from at the local system, and is this value to be read in always at that target location or could it be in different places depending on the printer model or driver etc? More info needed! I am assuming you are system admin as well so you wont be running this from a user privilege, but as admin at each of the systems to implement?Hi thank you for your reply. Yes, I'm system ADMINISTRATOR and I solved it. People working on terminal and when they login to server always changing "redirect value" so I can't to write all.. can be hp laser jet 1020 (redirected 19) or hp laser jet 1020 (redirected 1900) and etc.. So I wrote a script which copy all printers names to file, next step script read from file and copy names to registry. I put this script on group policy log on and every time, when user login to server, it get new value in registry Sorry, my english isn't perfect, but I hope you understood me |
|
| 1815. |
Solve : Java beginner needs a little help? |
|
Answer» Hey im new to java and i just need a little ADVICE. have to make a program that CALCULATES the perimeter and AREA of a TRIANGLE and the area of and ELLIPSE. I have to have a main class that takes in user inputs a triangle and an elipse class that does the computing and a report class with a method that takes the values returned from triangle and ellipse and displays them with a format for 2 decimals. Whats the best way to pass the values to the report class and display them with proper formatting? Any help is greatly appreciated!We do not do homework here. |
|
| 1816. |
Solve : Bloodshed Dev C++ lagging out on a 24,947 line program? |
|
Answer» Working on a C++ project that is 24,947 lines and was created using Bloodshed Dev C++, as the program started getting larger I noticed that going into the code and making a change, if i backspace to change something I am able to make the change, but get a cartwheel for 5 seconds and then bloodshed dev c++ acts fine. This wasnt happening when the program was smaller and to avoid typing all that code mostly switch case statements I copy pasted to replicate the source and then am going back in and editing the logic manually line for line on what to do for each case. Its almost like the change of anything in the program of this size its having to accept the change to the IDE and then run something maybe a cached copy of the 24,947 lines of code before it unfreezes. The freeze lasts about 5 seconds and happens only when editing/altering code. If I create a new line of code there is no lag. Unfortunately there is no way to reduce the size of the program due to the logic complicity of it all. I cannot see the code. I can only go off of what you have shared. If you really have a irreducibly complex, 24,947 line program, It could be the subject of a thesis. More likely is that it is quite reducible. The use of Copy paste during construction seems to make that clear.Quote You could disable syntax highlighting or autocomplete features. These would require static analysis of the source file which would need to be redone every time the source file changes. Thanks BC I will check into disabling these features. Program is pretty much playing with crypto for fun and a use to keep passwords and private data safe. I have a small notebook at home that I made a copy of and use to keep a copy of it in trunk of car in case home ever had a fire etc, I'd still have my many user/password and security questions available to me. However like a diary anyone getting their hands on it has EVERYTHING at their FINGERTIPS. However what looks like pages of random characters if worthless to anyone without the program to decrypt it. I wrote a simple C++ program a while back that looked like an innocent game, but with the correct input it gave access to all my user/password and security info for all the many websites I belong to etc, BUT I dont like having an EXE with this data on a thumb drive that could get lost and someone could say why is this simple game so large in size and decompile to gain access to the private info. So I decided to crypt my information in a book which is worthless without the correct key and program that spits out the correct information. The book alone is garble to anyone if anyone got a hold of it as well as the program is a simple tool that asks for each character and spits out an output for each character based on the key and character location in what is being decrypted. There might be crypto tools already out there, but decided to make my own and go complex with it and use switch and case statements in which each switch function is a separate key value with different combinations of output for upper/lower case letters, numbers, special characters, and spaces. Going with a mathematical crypto solution I didnt like because the world of computing is full of patterns, so while I do not have every combination possible in my crypto, I have ENOUGH of them that without the program, key, and book of what to enter into the crypto decryptor its pretty much worthless information for anyone that gets their hands on it. So thats why it has this many lines of code. If someone was to go with a mathematical crypto, you would just reference an array with all the characters to be used, but for the fact that I am using switch statements its large. Random Generators for anyone who has worked with them are flawed, and your best option to get rid of predictability is to seed the timer. But you dont want to seed a random generator if you want to place piece of data in and get an output that you can then take that output and put it back in to get the original data as for the seeded timer if not executed at the same time interval at the same location in the algorithm cycle you end up with garbage as the output. If you really need a better random generator, you can find one. http://www.rambus.com/intel-random-number-generator/ Quote Good cryptography requires good random numbers. This paper evaluates the hardwarebased Intel Random Number Generator (RNG) for use in cryptographic applications.It uses the Johnson ThermalNoise Source https://en.wikipedia.org/wiki/Johnson%E2%80%93Nyquist_noise Quote Thermal noise in an ideal resistor is approximately white, meaning that the power spectral density is nearly constant throughout the frequency spectrum (however see the section below on extremely high frequencies). When limited to a finite bandwidth, thermal noise has a nearly Gaussian amplitude distribution.[Search for Gaussian amplitude distribution |
|
| 1817. |
Solve : What language should I use?? |
|
Answer» I want to build a front end desktop application that will be able to start Windows applications within it, it needs to be able to manipulate file structures. |
|
| 1818. |
Solve : crowdfunding website? |
|
Answer» Hi, |
|
| 1819. |
Solve : radio button link? |
|
Answer» Hi, another fun project: |
|
| 1820. |
Solve : how to show comment on every post without looping the same comment in php? |
|
Answer» Well, am currently working a on posts and comment system using php language.... when never I comment of a post... comments tend to REPEAT on other post... Please stop posting links and asking us to go see what you did. Cut and paste into this thread. To be fair it was me that suggested using pastebin. I prefer it as it gives line numbers/syntax highlighting and stops the thread getting full of massive blocks of code. However, if using code tags are preferred on here then that's fine.line 55 it was worth trying.... it tends to duplicate every comment in my database let me work on that.. cause you're the second one telling me to do that!!... ill keep you posted it works ...My bad about pastebin linksI failed man... I would be glad if you send me some scripts that I need to work with.... |
|
| 1821. |
Solve : Coding Test Ransomware Help? |
|
Answer» Greetings, |
|
| 1822. |
Solve : vb program not searching? |
|
Answer» i have thisprogram working on 3 computers but wont work on this one. it is windows 10 and is a vb program short and has worked PREVIOUSLY quite well. when I search I input the file name where all names are stored. e.g. horse.dat and then a name it then vanishes off the screen this extract is from one that works on windows 10 on one computer and transferred to the one that doesn't work it is not working on the computer that I want it to work. any clues it seems to find horse.dat it allows the input of the name to search and then it vanishes. Visual Basic .NET (VB.NET or VB .NET) is a version of Microsoft's Visual Basic that was designed, as part of the company's .NET product group ... Geek, read the code. It's VBScript. OP, try running it in a console under Cscript.exe and report any error messages Thanks for responding. I am not a vb programmer so cant answer some of what you are saying. this is the story. i have this program running on 2 other computers. it used to run on this one now windows 10 but was running on 7 and stopped running on 7. When i run it and ask it to search e.g. put in the name to search and hit enter it flashes off the screen and disappears. It gives me the impression it the data file to search is not in the right FOLDER but I am of the impression that it is. I have copied a working copy of the vbprogram to the computer and still the same result. it was working but now it just flashes off the screen. the series that I conduct is click the program (VB) it asks for the data file. i enter the data file hit enter and it then asks for a name to search. I put in the name to search and hit enter and it all disappears. would be INTERESTED on your thoughts.sometimes it gives a wrong filehandle error if i try to run it from the folder but from the BATCH file it behaves as i have said it asks for the datafile name then the name to search and vanishes. I feel it is searching the wrong folder and not finding the target datafile. even if you confirm this i will go back to the drawing board and keep moving it.solved changed horse.dat to horse.txt and it now works. this works with horse.dat on my other computers go figure.changed file to txt and it now searches. wouldn't find dat file. I think what you have got is not a "VB program"; it is a Visual Basic Script (VBScript) script. Possibly the problem you had is that the extension .dat is used by Windows for system data files and possibly on the problematic computer a permission setting or file association setting has resulted in your vbs script being denied access. Or .dat files are hidden by default on that system. To confirm this, try renaming the horses.dat file to any other extension, not just .txt and see if it works. I previously suggested running the script from a command prompt in a console window using the cscript engine e.g. cscript //nologo scriptname.vbs. This might cause an error message to be shown. If you just click on the script you may miss this, especially if the default script engine on the system is wscript.exe. all my computers search for .dat file. so did this one. I changed the data file to a txt file and it now works. thank also had trouble with toolbar not retreating. it was java trying to update. once I dealt with this it was okay. |
|
| 1823. |
Solve : VBS - Remove Desktop Shortcut from any user? |
|
Answer» Code: [Select]'http://www.tek-tips.com/viewthread.cfm?qid=1309939&page=9 |
|
| 1824. |
Solve : PowerShell? |
|
Answer» Hi All, Since it's an MS Cert, the Official MS Documentation is likely a good place to start....... Microsoft certification exam 70-411, Administering Windows Server 2012, which counts toward MCSA/MCSE certification. Question 5: You manage a set of servers for a department in the verigon.com domain. The department has servers that run Windows Server 2012 R2. You have a generation 2 virtual machine NAMED VMSRV55. The boot order for VMSRV55 is as follows: You want to make the DVD drive the first boot device. Which of the following should you type at the PowerShell prompt? I am WORKING on a MCSA to start with. The first test is 70-410. It has questions like remote admin of servers USING powershell. I never used powershell so this is all new to me. I found a few online video training files. They help and I think that going to MS web site will also help. |
|
| 1825. |
Solve : Remove CR LF from standard I/O, with exception.? |
|
Answer» Can SOMEBODY write a simple program for me? If you've copied text from a webpage or a PDF file to an email, you've encountered the PROBLEM associated with formatting being copied along with the text. The result can look very strange indeed, with broken lines and odd fonts.That is the problem I have. I copy from PDF to the clipboard and lines are broken into a locum that was used in the PDF document. It seems somebody else already solved this problem and a few others that you get when trying to copy and paste from PDF. I am going to try this now. After lunch. FIRST things first. I just Google searched for "Remove Formatting From File" https://www.google.com/?gws_rd=ssl#q=remove+formatting+from+file and its 10th one down on the search that looked like what you needed maybe. Hope this helps I too have gone crazy trying to find something on Google... post here for help and others point me back to a Google reference that is the solution. Its all in the search criteria key words! Right! This is a great forum! |
|
| 1826. |
Solve : Visual basic CASE command help? |
|
Answer» I GET a "end of STAEMENT expected" error on all of the "to"s, any ideas? |
|
| 1827. |
Solve : trouble with MYSQLi dropdown? |
|
Answer» Hi, I'm trying for awhile to code up a MYSQLi dropdown from a DATABASE, select a field(url, formatted as "http://www.thisurl.com) and arrive at that destination. I've tried several forums re. compatability (connection/query/output etc..Problem is I blow up at the first query (see screen shot). It's like my PHP isn't working. If someone will advise of the PHP issue maybe I can work out the app code. Any volunteers? Thanks! |
|
| 1828. |
Solve : Convert symbol-file to text-file? |
|
Answer» Hi everyone, |
|
| 1829. |
Solve : java programming. need help.? |
|
Answer» I understand nothing about programming. |
|
| 1830. |
Solve : help== Was not expected at this time (Batch)? |
|
Answer» Ok, Hi! This is my first topic here, so I will go to the point directly: It was 2 AM, I didn't even wanted to think anymore I've been there... |
|
| 1831. |
Solve : Black Debug Screen? |
|
Answer» I am trying to write a C program but every time I run the debugger all I get is a black screen. Personally I am not sure what's wrong, but would appreciate any help. The debugger is Visual Studio 2010 on Windows 10. |
|
| 1832. |
Solve : IDA Psuedocode? |
|
Answer» in IDA.. |
|
| 1833. |
Solve : bat volume settings? |
|
Answer» Hello, I am forwarding this to the attention of a programmer who wrote some code a while back that might be of help to you on this. Slapping the Windows Master Volume Project is on github. Installer can be found here. If you can use 3rd party apps, with the invaluable (British) NirCMD you can at the prompt or in a batch script, mute the volume, set it to max, and set it to any level between 0 and 65535. And lots of other things, not just sound related. http://www.nirsoft.net/utils/nircmd.html You can have the system tray volume control slider visible and make it jump up and down from a command prompt. Thanks BC for linking that project of yours. I'm thinking that would work for them. CREATING a new bookmark so in future I can find it and share with others who can use your solutions. Also going to check into what geek and salmon shared. Thanks Everyone |
|
| 1834. |
Solve : C++ Practical Functions Help? |
|
Answer» Hi there, So, I would really appreciate someone to explain a bit about these "components".You can USUALLY arrive at the appropriate project pages for them with a proper SEARCH. Typically you will want the SDK. They work effectively the same as any other header file, you use an #include and the functions and constants defined therein are available to you. |
|
| 1835. |
Solve : Grab batch prompt context and put it in a variable? |
|
Answer» favorite i took this command to grab a profile and place its name in a variable for /f "tokens=4 delims=: " %%A in ('netsh wlan SHOW profiles') do set "profile=%%A" now i added this to the next line; netsh wlan show profiles "%profile%" key=clear then something that says "key content" (must be administrator) should appear with a WIFI password next to it, how do i get that password to also go into a variable? i TRIED doing something like this but it just DISPLAYS the word "such" for some strange reason... for /f "tokens=4 delims=: " %%A in ('netsh wlan show profiles') do set "profile=%%A for /f "tokens=4 delims=: " %%A in ('netsh wlan show profiles "%profile%" key=clear') do set "profile2=%%A" echo %profile2% |
|
| 1836. |
Solve : Managing usb 3.0 in my 100% assembly operating system? |
|
Answer» Hello, I know what I'm doing and assembler is my choice. Please i need the answer as soon as possible.Spot the contradiction... No one ? |
|
| 1837. |
Solve : .bat plz? |
|
Answer» Hi, |
|
| 1838. |
Solve : about video editing? |
|
Answer» I have a video. On that video I want to ADD picture who would move from 'angle 1' to 'angle 2' and spin slowly. |
|
| 1839. |
Solve : Help with batch file [costum message]? |
|
Answer» so.... Microsoft Windows [Version 6.1.7601] Trying to understand why Ping as it is is not good enough? As far as shaping the output to say WHATEVER you want, it can be done, but not in real time. There would be a slight delay in what is measured and then what is parsed as the output to the display. To get rid of this delay would require writing your own Ping program so that the output is as you want it without having to reshape it to an alternate display layout to user.it is ok if there is a little delay . . . goes fine with me soooo can you learn me something ? [say yes XD] if yes, is it possible to send a personal message on this forum [ill paste in my code so if you want, you can help me a bit] I agree with Dave, but if you must do it then try this By the way, no PMs, whatever help you get or don't get is here in the THREAD that you started. Code: [Select]@echo off SET host=www.google.com echo Pinging %host% set status=disconnected ping -n 1 %host%>nul && set status=connected echo Connection status : %status% if "%status%"=="connected" for /f "tokens=1-7 delims== " %%A in ('ping -n 1 %host% ^| find "Reply from"') do echo Your ping is %%G The output was: Code: [Select]Pinging www.google.com Connection status : connected Your ping is 21msThank you man appreciate that . . . Ill send you finished version score it from 1 to 5 please and tell me what you think i should add in . thnx again 4 reply and support and "PMs" what is this ? i'm from Slovenija so i don't know much about English spech shortcustQuote from: aljax and "PMs"???what is this ? Quote from: aljax if yes, is it possible to send a personal message on this forum [ill paste in my code so if you want, you can help me a bit]Thanks everybody [two man] who replied so fast and with great support |
|
| 1840. |
Solve : is this vbscript code dangerous?? |
|
Answer» I found this code on the internet but it appears to be some sort of malware, anyone entirely sure what it is? by looking at it can anyone tell me how entirely it works? and why exactly does that make this malicious? I never said it was malicious.could you maybe explain in detail what it does? Quote from: zask on December 11, 2015, 11:19:12 PM could you maybe explain in detail what it does? The blog post I linked is from the original author, and provides details about what each PART of the script does. ANTIVIRUS says its malicious?Antivirus' can come up with false positives, but this is probably getting flagged because of Quote WshShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Applets\Regedit\LastKey", cClipBoard, "REG_SZ" I have written programs from scratch such as in C++ and while they are perfectly fine, the antivirus can show false positives based on the behavior of the code to be over protective of the system. I generally have to add exceptions to not quarantine my newly compiled programs as AVG on rare occasion will flag my newly compiled exe as a false positive. |
|
| 1841. |
Solve : Learn Objective C on an OSX virtual box?? |
|
Answer» Hey friends, |
|
| 1842. |
Solve : I think i made an error in the code but cant see where plz help? |
|
Answer» K so well yea if you look at the code you will know what it is but i tried to modify it so that you can make a choose profiles but the profiles doesnt CREATE please help |
|
| 1843. |
Solve : batch programming? |
|
Answer» Hi, |
|
| 1844. |
Solve : shell scripting - sed? |
|
Answer» I want to match 2 REGULAR expressions in a line, separated by some alphanumeric. |
|
| 1845. |
Solve : help with my twitch script (python)? |
|
Answer» so IM making a bot on twitch that play pokemon when someone MAKES an input like up down left right etc. |
|
| 1846. |
Solve : Summarizing Data in Excel? |
|
Answer» Hi |
|
| 1847. |
Solve : Create a bridge between phone calls and a program? |
|
Answer» Hello, |
|
| 1848. |
Solve : NBSTAT in Windows 10? |
|
Answer» Hi All, Nbtstat is a diagnostic tool for NetBIOS over TCP/IP. It is included in several versions of Microsoft Windows. Its primary design is to help troubleshoot NetBIOS name resolution problems.https://en.wikipedia.org/wiki/Nbtstat Ok...it was a typo! My bad. Got my script to work once I put in the right stuff. Thanks! Glad you got it sorted out.Just my two cents. If you put nbstat into a Google search, Google will then say, "Showing results for nbtstat". Amazing how Google reads our minds. |
|
| 1849. |
Solve : Alpha Odometer - Time Waster Curiosity Program? |
|
Answer» Just sharing a program I was messing with to generate all combinations of A thru Z for 26 character length only. { Code: [Select]// http://www.geeksforgeeks.org/write-a-c-program-to-print-all-permutations-of-a-given-string/ #INCLUDE <stdio.h> #include <string.h> #include <cstdlib> #include <iostream> /* Function to swap values at two pointers */ void swap(char *x, char *y) { char temp; temp = *x; *x = *y; *y = temp; } /* Function to print permutations of string This function takes three parameters: 1. String 2. Starting INDEX of the string 3. Ending index of the string. */ void permute(char *a, int l, int r) { int i; if (l == r) printf("%s\n", a); // write to file here current string else { for (i = l; i <= r; i++) { swap((a+l), (a+i)); permute(a, l+1, r); swap((a+l), (a+i)); //backtrack } } } /* Driver program to test above functions */ int main() { system("@echo. Started %date% at %time% >>ABC.log"); char str[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; int n = strlen(str); permute(str, 0, n-1); system("@echo. End %date% at %time% >>ABC.log"); system("PAUSE"); return 0; }That code determines permutations, not combinations, does it not? Quote from: DaveLembke on December 29, 2015, 11:43:31 AM So I do come here with a question though which is..... is it the IDE that compiled the source code that basically governs whether its a single-threaded execution or is it in your source code that you need to add to specify to tap into the use of all cores to get full 100% CPU utilization?You have to write code that uses threads- at least in the case of C. Other languages might work with coroutines or other parallelization options. In a case such as this, it would make sense to have a thread pool. For example, let's say we want to have 4 threads running. In this case the best approach, at least in terms of simplicity to implement, would be to have a rather simplistic thread pool. The top-level call to permute could run four iterations of it's loop as separate threads, wait for them to complete, then run the next four. The primary disadvantage is that the generated sequence wouldn't have a predictable sequence, and it would require some additional synchronization on the output to prevent multiple threads from attempting to print to the standard output simultaneously. While it wasn't with permutations, I took this approach with a File Search class I (re)designed a while ago. Mind you, it's a bit more complicated since it doesn't merely intend to print output, but rather make it available to other pieces of code, but it effectively follows the approach of having multiple HIGHER level Search actions be run via separate threads. (An earlier version made the mistake of spinning a new thread for every single subdirectory search which made things far, far slower) Here's a C# version using Linq, though it is still only runs on a single thread. It's also generic so it works on sequences of any type. Strings are simply a sequence of char (IEnumerable in .NET's case): Code: [Select]class Program { static IEnumerable<IEnumerable<T>> Permutations<T>(IEnumerable<T> list, int length=-1) { if(length==-1) length = list.Count(); //ignore that this is multiple enumeration... if (length == 1) return list.Select(t => new T[] { t }); return Permutations(list, length - 1) .SelectMany(element => list.Where(e => !element.Contains(e)), (item1, item2) => item1.Concat(new T[] { item2 })); } static void Main(string[] args) { int totalcount = 0; String Alphabet = "ABCDEFGHJKLMNOPQRSTUVWXYZ"; foreach(var loopalphabet in Permutations(Alphabet)) { String buildresult = new String(loopalphabet.ToArray()); Console.WriteLine(buildresult); totalcount++; } Console.WriteLine("Count:" + totalcount); Console.ReadKey(); } } Thanks BC for the info also.. Quote (An earlier version made the mistake of spinning a new thread for every single subdirectory search which made things far, far slower) Wow.... sounds like if run in a location targeting a large number of subdirectories could bring the system to its knees depending on if the routine for that thread executed and ended or stayed active and grew larger and larger until all subdirectories are targeted. Interesting thread pool .... so you could create 4 threads and set an core affinity to each thread so that it makes use of the entire CPU, and the top level call that is running manages the 4 threads on what is processed next and plays traffic cop with it all. |
|
| 1850. |
Solve : lazarus (pascal)? |
|
Answer» i am doing a calculator |
|