w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories
VBA to Copy Information From a Folder of Files and Compile Information to a Single Workbook
This is not the full code, but it should help you. When you work with multiple workbooks keep track of them. For example start with: Dim CurrWB As Workbook Set CurrWB = ActiveWorkbook Then in the cycle: Dim WB As Workbook For Each StrFile In var Set WB = Workbooks.Open(loc & StrFile) ... WB.Close Next StrFile Inside the cycle you can find the area to copy doing something like: R1 = 1 Do While WB.Sheets("Sheet name").Cells(R, 2) <> "Starting text" R1 = R1 + 1 Loop R2 = R1 + 1 Do While WB.Sheets("Sheet name").Cells(R2, 2) <> "Ending text" R = R + 1 Loop For R = R1 to R2 CurrWB.Sheets("Report").Cells(RReport, 3) = WB.Sheets("Report").Cells(R, 3) RReport = RReport + 1 Next R

Categories : Excel

Compojure: Trap 500 URL Decoding Error
This issue occurs in war files generated by the Lein-Ring plugin, and has been recently fixed in Lein-Ring 0.8.6 as a result of this report. The cause has to do with the difference in how Java Servlets and Ring deal with the path-info field. The Java Servlet specification has the context path url-encoded, but the path info is decoded. Ring treats both the :context and :path-info keys as url-encoded.

Categories : Clojure

How to find information in powershell?
I am not familiar with powershell scripting but found this, maybe some reference to use: http://technet.microsoft.com/eng-us/scriptcenter/powershell%28en-us%29.aspx http://technet.microsoft.com/en-us/library/hh857339.aspx#BKMK_wps4 On the first link are PowerShell Scripting Webcasts to find and more. Scheduling Jobs with the Windows PowerShell API: http://msdn.microsoft.com/en-us/library/windows/desktop/jj150476%28v=vs.85%29.aspx Guide to getting started with Windows PowerShell: http://technet.microsoft.com/library/ee221100.aspx About Windows PowerShell, following help topics: get-command : Gets information about cmdlets from the cmdlet code. get-member : Gets the properties and methods of an object. where-object : Filters object properties. about_object : Exp

Categories : Powershell

Looking to extract information using powershell
Assuming that each group name is on a line in the file and there are no blank lines, try this: Get-Content c:scriptsmygroups.txt | Foreach {Get-ADGroup $_} | Select DistinguishedName

Categories : Windows

CoreFoundation Trap error "Thread1:EXC_BREAKPOINT (code=EXC_ARM_BREAKPOINT, subcode=0xdefe)"
Premise: THIS IS NOT a solution I just proposed a method to check the problem, not solve it. A way to continue the investigation! Stop downvoting! I'm currently working with @AlanGrant86 the problem seemed to relate to the Autolayout feature of a tableview, so I've redesigned the table and the cells programmatically and the problem seems to be solved. Try to disable the autolayout -> How to disable Autolayout Obviously is a workaround, so please if someone else had this problem please help us understanding the source

Categories : IOS

unix script - unable to trap or interpret error code within sqlplus properly
Try adding exit at the end of your script: WHENEVER SQLERROR EXIT SQL.SQLCODE begin SELECT COLUMN_DOES_NOT_EXIST FROM DUAL; END; EXIT; EDIT: Assuming sqlplus returns the error code, try eliminating the background process in your script. It can be shortened to: /bin/sqlplus ${arr[0]}/${arr[1]} @whenever.sql && /bin/sqlplus ${arr[0]}/${arr[1]} @another.sql || echo "Error..."

Categories : Oracle

i want to get particular information from a text file using powershell
It'd be simpler to extract this information directly from the eventlog: Get-EventLog "System" -EntryType "Error" -InstanceId 1111 | % { $_.Message -replace '[sS]*name:s+(S+)[sS]*','$1' } If you're limited to a textfile like the one you showed, you could try with Select-String: Select-String 'name:s+(S+)' input.txt | % { $_.Matches.Groups[1].Value }

Categories : Windows

Nodejs C++ event emitter. add-on error. Non-function in MakeCallback. method = emit Abort trap: 6
If I understand what you're trying to do correctly, you have a couple of problems in your keylogger.js file; util.inherits(new keylogger, events.EventEmitter); exports = keylogger; You're trying to extend an instance, and your export statement is a bit off. This should work better to export keylogger as an instance which the test file seems to expect; util.inherits(keylogger, events.EventEmitter); exports.keylogger = new keylogger();

Categories : C++

Powershell - View Website Source Information
You can view the source of any website. I am able to see the source for Gmail on Chrome, using the normal method of right click -> View page source. You can also open up Developer Tools -> Elements to see source. In Chrome, you can even use a URL like view-source:https://mail.google.com/mail/u/0/?shva=1#inbox to view source. Going the route of getting the source from Powershell will only get more and more complicated.

Categories : Internet Explorer

How do I find the Collection Membership Information with PowerShell
Rather than connecting to each computer and extracting the information (slow) get it from the straight from the database.... [CmdletBinding()] param ( [string] $hosts = "", [string] $sccmsrv = "", [Parameter(Mandatory=$False,Position=3)] [string] $path = "" ) $usage = "USAGE: List-AdvertCollMembershipSCCM.ps1 -sccmsrv SCCMSERVER -hosts 'host1 host2 host3' -path 'c: empOutfile.csv'" if ($host -and $sccmsrv){ Write-Host "" Write-Host -ForegroundColor Yellow "SCCM Server: $sccmsrv" Write-Host -ForegroundColor Yellow "Looking at hosts: $hosts" #### Function for executing a SQL query with integrated authentication function execSQLQuery ([string]$fSQLServer, [string]$db, [string]$query){ $objConnection = New-Object System.Data.SqlCli

Categories : Powershell

PowerShell write-output missing information - prints only 1st object
I can't explain this behavior, but you can mitigate it by using an explicit formatter for the first output, e.g.: Write-Output $object1 | Format-Table It looks like without explicit formatting PowerShell remembers an implicitly applied table format and omits output that doesn't match this format. For instance, if you add another Write-Output $object1 at the end of the script: $object1 = New-Object PSObject ... write-output $object1 $object2 = New-Object PSObject ... write-output $object2 write-output $object1 you will get this output: PS C:> . est.ps1 pn1 pn2 pn3 --- --- --- pv1 pv2 pv3 pv

Categories : C#

Reading in a full line from .txt file and storing specific information into different strings
If the all words are separated by spaces, then the address alone is not enough information. Consider 123 Biddle Lane Fort Lauderdale FL 33301 How can a "dumb" algorithm know where the division between street and city occurs? It can't. But all is not lost. If all addresses are US, you have a way forward. You can obtain a free database that allows mapping zip codes to city names. This can solve the ambiguity problem in many cases. The algorithm would be something like: Separate the line into words. Say there are N of them. Assume the last is zip code. Look up the zip in database to obtain a state and primary city. Verify N-1'th word is state that matches zip. If primary city from database has M words, assume words N-3-M to N-2 are the city name. Assume the words preceeding th

Categories : C

Copy/transfer file using PowerShell 2.0
One of the nice things about PowerShell is (unlike DOS) it support UNC paths. So you can literary just do: Copy-Item -Path <local file path> -Destination \<server IP><share><path> Of course your account will need to have access to that location. If you need to enter alternate credentials you can pre-authenticate using net use \<server IP><share> /user:[<domain>]<user> <password>

Categories : Powershell

fluent nhibernate copy a full entity
You need to Load entity with NH Clone the entity with method below, and create copy Evict main entity Do changes to copy Update the copy, without any reference to the main entity The clone method is as follows /// <summary> /// Clone an object without any references of nhibernate /// </summary> public static object Copy<T>(this object obj) { var isNotSerializable = !typeof(T).IsSerializable; if (isNotSerializable) throw new ArgumentException("The type must be serializable.", "source"); var sourceIsNull = ReferenceEquals(obj, null); if (sourceIsNull) return default(T); var formatter = new BinaryFormatter(); using (var stream = new MemoryStream()) {

Categories : C#

How to get out of a code if there is no information filtered to copy instead of it copying everything?
Dim NoOfFilteredCells As Long With ActiveSheet.ListObjects("Database").Range NoOfFilteredCells = .Count - .SpecialCells(xlCellTypeVisible).Count End With This will work if you only need to know if anything is hidden or not. All it is doing is subtracting the amount of visible cells from the total amount of cells, this will tell you how many are hidden. Then you could use something like If NoOfFilteredCells > 0 Then 'Put the code that does what you want it to do IF there ARE hidden rows here Else: Exit Sub End If Maybe Something Like this: Sub Sample() Dim NoOfFilteredCells As Long With Range("B12").End(xlDown).Offset(1, 0) .Font.Bold = True .Font.Underline = xlUnderlineStyleSingle .FormulaR1C1 = "ADDERS" .Offset(1, 15).FormulaR1C1 = "ADDERS" .Offs

Categories : Excel

how to copy the current file full name to global clipboard in vim
Use :let @ to write to a register: :noremap <F10> :let @+ = expand("%:p")<CR> I default to :noremap, so that my mappings don't call other mappings unintentionally. End with <CR> for best results.

Categories : Vim

Copy information from Cmd Promt Window into Console Application
You're starting an external process, which is good. What you need to do now is to Redirect the Standard Output. Rather than copy information from the cmd prompt window, you simply want it fed back into your program. You'll have to do a bit of parsing, but here's the sample from microsoft: // Start the child process. Process p = new Process(); // Redirect the output stream of the child process. p.StartInfo.UseShellExecute = false; p.StartInfo.RedirectStandardOutput = true; p.StartInfo.FileName = "Write500Lines.exe"; p.Start(); // Do not wait for the child process to exit before // reading to the end of its redirected stream. // p.WaitForExit(); // Read the output stream first and then wait. string output = p.StandardOutput.ReadToEnd(); p.WaitForExit(); Source: http://msdn

Categories : C#

Creating a shadow copy using the "Backup" context in a PowerShell
Your $shadow has a 5 on return value looking at the error message, your shadow id has all zeros , you would need to add a 1 or a 2 to the end of the volume shadow copy in the registry using binary or dword.. find the folder in the registry named volsnap in your regedit search .volsnap.sys is found in the C:WindowsSystem32drivers directory. The file size is 52,352 bytes.The volsnap file contains Microsoft's digital signature.make sure its the correct bytes. This confirms its authenticity. volsnap.sys appears to be a file that was compressed by an EXE-Packer. This technique is often used by trojans to keep the file size small and also hamper debugging efforts. However, this in itself is not sufficient reason to presume malicious intent, since even well-intentioned, professional soft

Categories : Powershell

When formatting floats in DataGridView to a certain decimal, cannot copy full number
It is impossible to allow users to copy something different than what is being displayed (1-decimal values). A workaround to get what you want might be enabling two different "modes" to show the information in the cells: short and long format. And adding a user-friendly way to switch between both modes; for example: pressing "Enter" in a cell. Sample code: private void dataGridView1_KeyDown(Object sender, System.Windows.Forms.KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { if (shortMode) { dataGridView1.Rows[curRow].DefaultCellStyle.Format = ""; //Number with all the decimals shortMode = false; } else { dataGridView1.Rows[curRow].DefaultCellStyle.Format = "P1"; //Number as percentage with 1 decimal

Categories : C#

How to properly -filter multiple strings in a PowerShell copy script
use the include is the easiest way as per http://www.vistax64.com/powershell/168315-get-childitem-filter-files-multiple-extensions.html

Categories : Powershell

PostgresSQL full text search not using index after importing data with COPY
@Denis pointed me into the right direction. I looked at the VACUUM, ANALYZE command and found the solution: For tables with GIN indexes, VACUUM (in any form) also completes any pending index insertions, by moving pending index entries to the appropriate places in the main GIN index structure. (PostgreSQL Documentation: VACUUM) After running VACUUM account the SELECT query uses the index as excpected.

Categories : Postgresql

Copy files while preserving original file information (creation time etc.)
Robocopy via system2() can keep the timestamps. > cmdArgs<- paste( normalizePath( file.path(getwd()), winslash="/"), normalizePath( file.path(getwd(), "bkup"), winslash="/" ), "*.txt", "/copy:DAT /V" ) > system2( "robocopy.exe", args=cmdArgs ) Robocopy has a slew of switches for all different types of use cases and can accept a 'job' file for the params and file names. The ability of R to call out using system could also be used to execute an elevated session (perhaps the easiest would be by using a powershell script to call Robocopy) so that all of the auditing info (permissions and such) could be retained as well.

Categories : R

Error when using angular.copy() to copy data returned from ngResource
Take a close look at angular.copy doc: destination(optional) – {(Object|Array)=} – Destination into which the source is copied. If provided, must be of the same type as source. The result you got back from service call is probably an array; you however initialized $scope.grid.originalData as an object or something else other than array, so you got this type error. Try to figure out what type the result is, and make $scope.grid.originalData the same type before calling angular.copy.

Categories : Javascript

Copy-item Files in Folders and subfolders in the same directory structure of source server using Powershell
This can be done just using Copy-Item. No need to use Get-Childitem. I think you are just overthinking it. Copy-Item -Path C:MyFolder -Destination \ServerMyFolder -recurse -Force I just tested it and it worked for me.

Categories : Powershell

PowerShell script to copy two files from a static location to a location with two variables in the in path
First of all create CSV with structure like below (users.csv): Name,Sip login1,login1@gmail.com The run following statement: Import-Csv C:PATH_TO_CSVusers.csv | foreach{cp C:YOUR_PATHYOUR_FILE ("C:Users"+$_.Name+"AppDataLocalMicrosoftCommunicator"+$_.Sip)} Update Script for run for current user: $userName = [Environment]::UserName; $domain = [Environment]::UserDomainName; # Look for a user $Rech = new-object System.DirectoryServices.DirectorySearcher $rc = $Rech.filter = "((sAMAccountName=$userName))" $rc = $Rech.SearchScope = "subtree" $rc = $Rech.PropertiesToLoad.Add("mail"); $rc = $Rech.PropertiesToLoad.Add("msRTCSIP-PrimaryUserAddress"); $theUser = $Rech.FindOne() Write-host "Username is" $userName Write-host "Domain is" $domain if ($theUser -ne $null) { Write-Host "Mail is"

Categories : Powershell

websphere 7 shows full error to customer on web app deployment/starting error
If you have an Apache server (or other) in front of your WebSphere, you may use it to redirect error 500 on a custom static web page. Since you're using Spring, if this error can occur often, you can try to use lazy bean initialization on the remoteOMSConnectorWS (See LazyInitTargetSource). This would delay bean instantiation until its first use, most likely after webapp complete startup. In this case, your error configuration from web.xml could be used.

Categories : Spring

How to find, filter and copy directory and contents to a location dictated by part of find result ) in Powershell
This should work: $specialdirectory = "xyz" $Destination = "zyx" $1 = "\fileserverprofiles" | Get-ChildItem $User = $1.Name | where {$_ -Match "User"} $User | foreach { $check = test-path -pathtype Any "\fileserverprofiles$_appdata$Specialdirectory" If ($check -eq $true) {Copy-Item \fileserverprofiles$_appdata$specialdirectory -Destination C:$Destination -Recurse} }

Categories : File

While In-app purchase testing in google play i got an error " Error retrieving information from server [RPC:S-7:AEC-0]"
Finally I got the solution. We need to enter an original credit card details while enter credentials for inApp purchase. Google play will retrieve your information and you will eligible to purchase item, as your application is in testing mode so no amount will deduct from your account.

Categories : Android

Testing full-text search with textacular and cucumber throws PG::Error: ERROR: function similarity(character varying, unknown) does not exist
For anyone else out there who runs into this issue, you can run bundle exec rake textacular:install_trigram all you like, but if you use rake to run cucumber or rspec, then db:test:prepare is invoked, and since trigram is not being installed through a migration, this has the effect of wiping it from the db when the schema is loaded! # install trigram in test db bundle exec rake textacular:install_trigram RAILS_ENV=test # wipe trigram from db rake cucumber rake rspec To stop this from happening, just run cucumber and rspec without rake! # run cucumber and rspec without rake cucumber rpsec What a horrible problem! 2 days to fix etc...

Categories : Ruby On Rails

Why would I want to use the TRAP instruction?
I studied how TRAP work in PDP-11, and want to share with you: Trap could help you with Save current the registers (including PC/PS) into stack, update SP(stack pointer) Set PC(next instrument address) to TRAP handler Set PS(status register) to TRAP status You may refer to this image, https://github-camo.global.ssl.fastly.net/3e636f86530380760fcc784c3178d40723d55a44/687474703a2f2f696b6172697368696e6a696576612e6769746875622e696f2f756e697856362d636f64652d616e616c797a652d6368732f696d616765732f50647031315f696e737472756374696f6e5f545241502e706e67 (Sorry that I need 10 reputation to upload image...)(The chinese character in the image means "Stack") TRAP is to provide processor-level context-switch protection, which means TRAP could save the registers, switch to run from other code address

Categories : Assembly

To create a copy of object in java w/o clone,copy constructor and copy factory
You can just create a new object for NewDog using OldDog Have you considered something like this? NewDog dog = new NewDog(someOldDogObject); While constructor of NewDog can be. public NewDog(OldDog oldDog){ this.dogWeight = oldDog.dogWeight; // keeping the same weight this.dogName = "newDog" + oldDog.dogName; // changing your dog name as per rquirement. }

Categories : Java

PHP error.. the same code used to work a month before and now its showing an error.. copy(): Filename cannot be empty [file]
I can guess, php version has updated on server. b/c $HTTP_POST_FILES is deprecated.(PHP 4 >= 4.1.0, PHP 5) http://php.net/manual/en/reserved.variables.files.php. so this is not there. 4.1.0 Introduced $_FILES that deprecated $HTTP_POST_FILES.

Categories : PHP

$? inside bash trap
I'm not positive, but I think the shell has not yet updated the value of $? at the time the handler for CHLD is called. Consider this script: set -bm trap 'echo "Trap result code $?"' CHLD echo "Script: starting program" (exit 9) (exit 11) echo "Script: result code from program was $?" I replace your C++ program with a simple subshell that simulates a seg fault. When I run it, the CHLD trap prints "Trap result code 9", indicating that the trap is seeing the exit status of the command prior to the one that triggers the trap. Changing the value of the first subshell call to exit changes the value printed by the trap. The question you link to traps the EXIT pseudo-signal. Without diving into the bash source code, I suspect that what happens is this: Set trap for CHLD For each comman

Categories : Bash

How can I trap a particular value of the counter in the for loop
If I understand your question correctly, you can use exactly the same approach you are using to determine maxrange: for (...) { ... if (range > maxrange) { maxrange = range; angle = j; // <-- } }

Categories : Java

C# SNMP trap receiver
have a look at this SNMP lib http://sourceforge.net/projects/snmpsharpnet/files/ . you do not have to reinvent the wheel

Categories : C#

Recover after bash trap
Instead of BASE=$(basename $FILE); Have this one instead: BASE=${FILE##*/} It's also a good idea to place your work functions on the background away from the interface that handles SIGINT. Just avoid asking for input within it. Also quote your variables properly always. #!/bin/bash # Register signal handler ABORT=0; trap ABORT=1 SIGINT; # Create temp dir TEMPDIR=$(mktemp -d -t $0); # Helper functions function do_other_stuff { true; } # Process files for ((COUNTER = 0; COUNTER < 3 && ABORT == 0; COUNTER++)); do ( FILE=/some/directory/$COUNTER.txt BASE=${FILE##*/} cp "$FILE" "$TEMPDIR" > "$FILE" do_other_stuff cp "$TEMPDIR/$BASE" "$FILE" rm "$TEMPDIR/$BASE" ) & CPID=$! # Handle SIGINT bu

Categories : Bash

How To Trap when Autofilter returns nothing
I can't download your code right now, but I am 99% sure you can fix the problem by taking a look at these two statements: Selection.End(xlToLeft).Select Selection.End(xlDown).Select When the filter returns nothing, the second of these will take you all the way to the bottom of the spreadsheet. So right after this statement you need to test the row number - if your row number is greater than the rows used, you have "run off the end". To start with you need to know what the last "valid row" in your spreadsheet is. Somewhere in your module (or in a new one) define a function lastRowUsed like this (note - you can't just use ActiveSheet.UsedRange.Rows.Count since that will return a number < last row if the first rows are blank. If that's never the case for you, you can simplify your life

Categories : Excel

Trap syntax issue in bash
That trap call is creating an interesting recursion, because $BASH_COMMAND (and $?) are being expanded when the trap command executes. However, $BASH_COMMAND at that point is the trap command itself, textually including $BASH_COMMAND (and some quotes and semicolons). Actually figuring out what the command to be executed when the trap fires is an interesting study, but it's not necessary to fix the problem, which you can do like this: trap '{ echo "$BASH_COMMAND failed with status code $?"; handle_error; }' ERR Note that replacing " with ' not only avoids immediate parameter expansion, it also avoids have to escape the inner "s.

Categories : Linux

Why trap didn't work in a pipeline
The command on the left hand side of a pipe is run in a subshell: exit | grep The exit sigtrap seems not to be propagated to subshells. trap 'echo T >&2' EXIT ; (exit) # Nothing.

Categories : Linux

OutOfMemoryException Trap/Event (beside try-catch)
This is exactly the reason you should be fixing an OutOfMemoryException.. not trying to catch it. It can be thrown from anywhere.. at any time. Besides.. it's an Out of memory exception.. what guarantee do you have that the process will have enough memory to handle it? You don't.

Categories : C#

© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.