Function: create an array through initial/step/number of elements
Does LabVIEW have the function which directly creates an array by giving intial value, step and number of elements?
thanks,
WT
Solved!
Go to Solution.
You can use the Build Waveform function.
It is located in the Programming >> Waveform palette
Cory K
Similar Messages
-
I am trying to go through an array but instead of autoindexing I want to skip every other element or maybe a number of elements that will be specified for the user.
Basic functionality that I want to acheive is the following in C code.
int temp_var = 10;
int i=0;
for(i=0; i<=1000; i=i+temp_var)
I am very new to LabVIEW and I did not know how to use internal variables.
Can this be acheived using shift registers?
I am attaching the code I currently have for this. Let me know what you think.
Thanks guys.
Solved!
Go to Solution.
Attachments:
24_Sep_NchanNSamp.vi 44 KBtbob wrote:
I have been asking for a new For Loop style that would allow us to specify start, stop, and step conditions, but it seems that many people are just not for this idea. Don't know why?
See here.
I wouldn't say there aren't many people for it. The idea you linked to was one of a half dozen of basically duplicate ideas, including another one of your own.
These two ideas have a fairly large number of kudoes showing people want the idea.
Smart Iterators with Loops
For Loop Increment -
Save EAN11 field while creating POrder creation through Function module
Hi All,
I want to update EAN11 field in material master while creating Purchase Order through function module. I am using function module BAPI_PO_CREATE1 for creating purchase order. There are no structures in the PO creation FM in which EAN11 field is there. I have also tried using function module MEPO_DOC_ITEM_PROCESS for updating EAN11 field. It is not working. Please suggest some method to do that.
Note: I am receiving EAN11 through an external system by proxy.
Thanks,
ChinmayHi,
Use BAPI_MATERIAL_SAVEDATA to updat ean numbers for materials.
tables INTERNATIONALARTNOS is used to update EAN.
Regards,
Shanmugavel Chandrasekaran -
How can I create arrays through the same recursive process?
Hello again!
I want to create some arrays with names like array1, array2, array3 etc
through the same for loop.
Do you know how this can be done? Thanks!
for (int i = 0; i < 32; i++) {
byte[] array???=new byte[400];
}I want to create some arrays with names like array1,
array2, array3 etc
through the same for loop.
Do you know how this can be done? Thanks!
for (int i = 0; i < 32; i++) {
byte[] array???=new byte[400]; You cannot create new names during runtime (array1, array2 are names).
You can create a map that associates Strings with byte arrays though:Map<String, byte[]> map= new HashMap<String, byte[]>();
for (int i= 0; i < 32; i++)
map.put("array"+i, new byte[400]);
// get array associated with array26:
int j= 26;
byte[] oneOfTheArrays= map.get("array"+j);kind regards,
Jos -
How to create an array of functions
normally I use
repository.getFunctionTemplate(functionName);
to get a function object.
Is there a way to get an array of function objects for a function name.
I am trying to execute multiple functions in the same connection to reduce calls for logging on and off for each call.
Thanks,
Aditya PanditHi Aditya,
From
<a href="https://media.sdn.sap.com/javadocs/NW04s/SPS7/jc/com/sap/mw/jco/IFunctionTemplate.html">JavaDoc</a>:
<i>getFunction
public JCO.Function getFunction()
<b>Creates</b> a function object from the template and returns it
Returns:
the function created from the template
</i>
So, you can reuse function template to create multiple fuctions.
Best regards, Maksim Rashchynski. -
Before this last upgrade, when I would create a file and do a "Save As" it would always open "My Documents" by default, which is what I prefer. But since the upgrade it opens in some anonymous file, to which I have to go through several steps to get to My Documents, and I can't seem to select the default in my preferences. HELP PLEASE!!!
Before this update of what software from what version to what version using which OS?
-
Hi All,
I was trying to create Instance for SAP Application Server ABAP 7.4 SP5 incl. Business Warehouse on SAP HANA 1.0 SP7 [Developer Edition] in SAP HANA Enterprise Cloud / Cloud Appliance Library when I got this message 'Operation Start failed on step Allocate elastic IPs with message: Error creating static IPs; AMASON: The maximum number of addresses has been reached'.
I tried looking for an answer or solution for this issue but no success.
Can anyone please help me with this?
Regards,
Deep TanwarHi Deep,
you need to check your Elastic IP limits within the AWS console and how to release them if they are used:
Elastic IP Addresses (EIP) - Amazon Elastic Compute Cloud
AWS Service Limits - Amazon Web Services
Regards,
Hannes -
In iTunes I'm having problems changing the "Media Kind" in the OPTIONS menu from "Music" to "Audiobook". After going through the steps, the next time I check, the items have reverted back to "Music". What must I do to save it as an "Audiobook"?
After more digging in the Support section here and some Google work, I turned off iTunes Match and lo and behold! I can change the media kind to Audiobook! So, it looks like iTunes Match locked the files up somehow and for some reason.
I went into iTunes Store > iTunes Match > "No, Thanks" to disable it on the local PC. -
Hi, this is my first post here.
I have been using Java for a few classes at Texas A&M and always seem to get stuck on the same and simplest steps in my programs.
I have a program where input is taken from a file about students. Then information about students is assigned, and by user choices either sorted, displayed , searched and so on.
I need to create an Array of students. so far the class layout of my code is this
class Course{
//set and get methods of grades and other information
class Student{
//set and get of student name and ID
class groupOfStudents{
//display information, read input file and keyboard input
public Testing{
main()
I have to create an array of students and do things like
for(int i = 0; i < MAXQUIZ; i++){
student[1].setQuiz(i, Integer.parseInt(currentLine[3 + i]));
there would be a higher for loop to go through all students, and the currentLine array is readLine().split(" ").
I tried like Course[] student = new Course[numberOfStudents]; and other things of that sort, I bet this is a very simple idea but for some reason an array of non-primitive data types is hard for me because when I use new ClassName all I can see being run is the class constructor.
Any help appreciated thanks :)
nullWhat I need is an array that is sort of like
Student students[] = new Student[];
I need an array of students with size
numberOfStudents. You're almost there:
Student students[] = new Student[numberOfStudents];
Then for each student I will take
the file input and call set functions for course
information and student information.Well, I'd strongly avoid putting course information into objects that represent students. Rather, create course objects, and put pointers in your student objects to the course objects. Course details would go in course objects. The student class would have something like this in it:
private Course[] courses;
My main question really is how do you create an array
of a non primative data type? Basically the above.
How do you call on a
class and create an array of that class...I've been
doing it, and so far it seems to "work" but it tells
me it can not see the methods in that class. for
instance i'll tell the program...
student[ i ].setQuiz(0, 100); and it tells me can not
find method setQuiz(int, int) in class Course or
Student, and what not and then I tried using extends
(not very good with extends and interface usage).
The method is there, correct spelling, correct type
and number of arguments.Err..my guess is that you're not actually allocating the Student and Course objects, and you're getting NullPointerExceptions and that's confusing you. When you create an array of an object type, the values of the array are initially all null. You have to instantiate them yourself, like this:
Student students = new Student[numberOfStudents];
for(int i = 0; i < numberOfStudents; i++) {
students[i] = new Student();
}Except for one thing. It's generally a bad idea to create empty objects like that (new Student() without student info in them) and I'm guessing that you really don't know the number of students anyway until you read the file. So a better approach is usually to use a java.util.Collection subclass rather than an array, and then to add to it while you read the data file and create the Student objects on the fly, using data you read from the file.
If this isn't your problem...then please post what you're trying to do (as short and simple as possible) and also the compiler error messages if it won't compile, or the stack traces if it will compile but not run. Wrap the code in [code][/code] tags when you post it. -
Error in creating web application through power shell
hi,
i have taken the ps script from the below url :
credits to Roger :
http://blogs.msdn.com/b/rcormier/archive/2012/09/01/how-to-create-sharepoint-web-applications-with-powershell.aspx
http://gallery.technet.microsoft.com/Create-SharePoint-Web-742a8fb9
But when i am running the script, i am getting many errors:
Note: i am not using appln pool account password [as i dont know the password]
want to know whether this paramter is necessary.
$ver = $host | select version
if($Ver.version.major -gt 1) {$Host.Runspace.ThreadOptions = "ReuseThread"}
if(!(Get-PSSnapin Microsoft.SharePoint.PowerShell -ea 0))
Write-Progress -Activity "Loading Modules" -Status "Loading Microsoft.SharePoint.PowerShell"
Add-PSSnapin Microsoft.SharePoint.PowerShell
Write-Progress -Activity "Creating Web Application" -Status "Setting Variables"
#Set Individual Web App Variables
#This is the Web Application URL
$WebApplicationURL = "http://mysrvr:2020/"
#This is the Display Name for the SharePoint Web Application
$WebApplicationName = "myweb1"
#This is the Content Database for the Web Application
$ContentDatabase = "myContentDB"
#Set Common Variables
#This is the Display Name for the Application Pool
$ApplicationPoolDisplayName = "mapppool2020"
#This is identity of the Application Pool which will be used (Domain\User)
$ApplicationPoolIdentity = "mydomain\myidd"
#This is the password of the Appliation Pool account which will be used
#$ApplicationPoolPassword = "Pass@word1"
#This is the Account which will be used for the Portal Super Reader Account
$PortalSuperReader = "i:0#.w|in\hariharan.venugopalk"
#This is the Account which will be used for the Portal Super User Account
$PortalSuperUser = "i:0#.w|in\spinstall.dev"
Write-Progress -Activity "Creating Web Application" -Status "Loading Functions"
#Create Functions
Function CreateClaimsWebApp($WebApplicationName, $WebApplicationURL, $ContentDatabase, $HTTPPort)
#AppPoolUsed is set when calling the ValidateAppPool function. This will be true if the application pool is already running SharePoint web appplications
#If the application pool is already being used in web applications, the syntax for New-SPWebApplication changes
if($AppPoolUsed -eq $True)
#Create the web application, assign it to the WebApp variable. The WebApp variable will be used to set object cache user accounts
Write-Progress -Activity "Creating Web Application" -Status "Using Application Pool With Existing Web Applications"
Set-Variable -Name WebApp -Value (New-SPWebApplication -ApplicationPool $ApplicationPoolDisplayName -Name $WebApplicationName -url $WebApplicationURL -port $HTTPPort -DatabaseName $ContentDatabase -HostHeader $hostHeader
-AuthenticationProvider (New-SPAuthenticationProvider)) -Scope Script
#Call the SetObjectCache function, which sets the object cache.
Write-Progress -Activity "Creating Web Application" -Status "Configuring Object Cache Accounts"
SetObjectCache
else
#Create the web application, assign it to the WebApp variable. The WebApp variable will be used to set object cache user accounts
Write-Progress -Activity "Creating Web Application" -Status "Using Application Pool With No Existing Web Applications"
Set-Variable -Name WebApp -Value (New-SPWebApplication -ApplicationPool $ApplicationPoolDisplayName -ApplicationPoolAccount $AppPoolManagedAccount.Username -Name $WebApplicationName -url $WebApplicationURL -port $HTTPPort
-DatabaseName $ContentDatabase -HostHeader $hostHeader -AuthenticationProvider (New-SPAuthenticationProvider)) -Scope Script
#Call the SetObjectCache function, which sets the object cache.
Write-Progress -Activity "Creating Web Application" -Status "Configuring Object Cache Accounts"
SetObjectCache
Function ValidateURL($WebApplicationURL)
#Find out if a web application with the target URL exists
if(get-spwebapplication $WebApplicationURL -ErrorAction SilentlyContinue)
#If a web application with the specifid URL already exists, wait 5 seconds and exit
Write-Progress -Activity "Creating Web Application" -Status "Aborting Process Due To URL Conflict"
Write-Host "Aborting: Web Application $WebApplicationURL Already Exists" -ForegroundColor Red
sleep 5
#Setting the CriticalError value to $True results in the script to not create anything
Set-Variable -Name CriticalError -Value $True
#If the WebApplicationURL passed is not already a SharePoint web application, find out if it starts with HTTP or HTTPS
elseif($WebApplicationURL.StartsWith("http://"))
#If the string starts with http://, and not https://, trim the protocol from the URL. Set the host as the host header
Set-Variable HostHeader -Value ($WebApplicationURL.Substring(7)) -Scope Script
#If we're using HTTP, use port 80
Set-Variable -Name HTTPPort -Value "80" -Scope Script
elseif($WebApplicationURL.StartsWith("https://"))
#If the string starts with https://, and not http://, trim the protocol from the URL. Set the host as the host header
Set-Variable HostHeader -Value ($WebApplicationURL.Substring(8)) -Scope Script
#If we're using HTTPS, use port 443
Set-Variable -Name HTTPPort -Value "443" -Scope Script
Function ValidateAppPool($AppPoolName, $WebApplicationURL)
#Change the ErrorActionPreference to SilentlyContinue while preserving the original value in a temporary variable
#Failing to do this will result in error messages being displayed if Get-WebAppPoolState does not return an object. The script would still continue
$CurrentErrorActionPreference = $ErrorActionPreference
$ErrorActionPreference = "SilentlyContinue"
#Check to see if an application pool with the name passed by the AppPoolName variable already exists, assign this to a variable.
#This variable will be used in order to determine if the application pool exists, but is not part of SharePoint
$TestAppPool = Get-WebAppPoolState $AppPoolName
#If we have a SharePoint application pool with the value passed by the AppPoolName variable, find out if there are any sites using that app pool
#This changes the syntax used with New-SPWebApplication
if(Get-SPServiceApplicationPool $AppPoolName)
#Return all application pools used by all web applications
$AppPools = Get-SPWebApplication | select ApplicationPool
#Providing there is more than one application pool, find out what their names are
if($AppPools)
foreach($Pool in $AppPools)
#Get The application pool display name for each application pool returned
[Array]$Poolchild = $Poolchild += ($Pool.ApplicationPool.DisplayName)
#If any application pool matches the value passed by ApplicationPoolDisplayName, set AppPoolUsed to True
#This is referenced in the CreateClaimsWebApp function
if($Poolchild.Contains($ApplicationPoolDisplayName))
Set-Variable -Name AppPoolUsed -Value $True -Scope Script
#If the application pool display name does not match the value passed by ApplicationPoolDisplayName, set AppPoolUsed to False
#This is referenced in the CreateClaimsWebApp function
else
Set-Variable -Name AppPoolUsed -Value $False -Scope Script
#Since this is a SharePoint Application Pool, set the AppPool value to the the SPServiceApplicationPool object returned
Set-Variable -Name AppPool -Value (Get-SPServiceApplicationPool $AppPoolName) -scope Script
#Set the AppPoolManagedAccount variable to the name of the managed acount used by the application pool returned
#AppPoolManagedAccount is used in the CreateClaimsWebApp function if the application pool does not have existing web applications that are using it
Set-Variable -Name AppPoolManagedAccount -Value (Get-SPManagedAccount | ? {$_.username -eq ($AppPool.ProcessAccountName)}) -scope Script
#Check to see if the application pool is in IIS, but is not a SharePoint app pool
elseif($TestAppPool)
#If the application pool exists in IIS and is not a SharePoint application pool, abort the script by setting CriticalError to True
Write-Host "Aborting: Application Pool $AppPoolName already exists on the server and is not a SharePoint Application Pool `n`rWeb Application `"$WebApplicationURL`" will not be created" -ForegroundColor
Red
Set-Variable -Name CriticalError -Value $True
#If it's not a SharePoint app pool, and it doesn't exist in IIS, we have to create one
elseif(!($TestAppPool))
#Find out if a managed account exists by calling the ValidateManagedAccount function
validateManagedAccount $ApplicationPoolIdentity
#If the managed account exists, create an application pool using the existing managed account
if($ManagedAccountExists -eq $True)
#Set the AppPoolManagedAccount to the identity of the managed acocunt referenced by the ApplicationPoolIdentity variable
Write-Host "Creating New App Pool using Existing Managed Account"
Set-Variable -Name AppPoolManagedAccount -Value (Get-SPManagedAccount $ApplicationPoolIdentity | select username) -scope "Script"
#Create a new SPServiceApplicationPool, assign that to the AppPool variable
Set-Variable -Name AppPool -Value (New-SPServiceApplicationPool -Name $ApplicationPoolDisplayName -Account $ApplicationPoolIdentity) -scope "Script"
#If there is no managed account matching the account referenced by the ApplicationPoolIdentity, create it
else
#Use the ApplicationPoolIdentity and ApplicationPoolPassword to create a credential object
#This is necessary when creating a new managed account
Write-Host "Creating New Managed Account And App Pool"
$AppPoolCredentials = New-Object System.Management.Automation.PSCredential $ApplicationPoolIdentity, (ConvertTo-SecureString $ApplicationPoolPassword -AsPlainText -Force)
#Create a new managed account, assign that to the AppPoolManagedAccount variable
Set-Variable -Name AppPoolManagedAccount -Value (New-SPManagedAccount -Credential $AppPoolCredentials) -scope "Script"
#Create a new application pool using the new managed account, assign this to the AppPool variable
Set-Variable -Name AppPool -Value (New-SPServiceApplicationPool -Name $ApplicationPoolDisplayName -Account (get-spmanagedaccount $ApplicationPoolIdentity)) -scope "Script"
#Return the ErrorActionPreference to the default value
$ErrorActionPreference = $CurrentErrorActionPreference
Function ValidateManagedAccount($ApplicationPoolIdentity)
#Find out if the manage account referenced by the AppPoolIdentity already exists
#If it does, set ManagedAccountExists to True
if(Get-SPManagedAccount $ApplicationPoolIdentity -ErrorAction SilentlyContinue)
Set-Variable -Name ManagedAccountExists -Value $True -Scope Script
#If it does not, set ManagedAccountExists to False
else
Set-Variable -Name ManagedAccountExists -Value $False -Scope Script
Function ClearScriptVariables
#Set the ErrorActionPreference to SilentlyContinue
#If this is not set, and the script variables referenced have not been set, an error message will be returned. The script would still continue
$CurrentErrorActionPreference = $ErrorActionPreference
$ErrorActionPreference = "SilentlyContinue"
#Remove the CriticalError variable
Remove-Variable $CriticalError -ErrorAction SilentlyContinue
$ErrorActionPreference = $CurrentErrorActionPreference
Function SetObjectCache
#Set object cache user account properties based on the value of the parameters supplied
$WebApp.Properties["portalsuperuseraccount"] = $PortalSuperUser
$WebApp.Properties["portalsuperreaderaccount"] = $PortalSuperReader
#Create a New Policy for the Super User
$SuperUserPolicy = $WebApp.Policies.Add($PortalSuperUser, "Portal Super User Account")
#Assign Full Control To the Super User
$SuperUserPolicy.PolicyRoleBindings.Add($WebApp.PolicyRoles.GetSpecialRole([Microsoft.SharePoint.Administration.SPPolicyRoleType]::FullControl))
#Create a New Policy for the Super Reader
$SuperReaderPolicy = $WebApp.Policies.Add($PortalSuperReader, "Portal Super Reader Account")
#Assign Full Read to the Super Reader
$SuperReaderPolicy.PolicyRoleBindings.Add($WebApp.PolicyRoles.GetSpecialRole([Microsoft.SharePoint.Administration.SPPolicyRoleType]::FullRead))
#Commit these changes to the web application
$WebApp.Update()
#Script
#Call the ClearScriptVariables function to empty out varialbes that should be blank when the script executes.
ClearScriptVariables
#Validate the URL passed by calling the ValidateURL function
Write-Progress -Activity "Creating Web Application" -Status "Validating Web Application URL Variables"
ValidateURL $WebApplicationURL
#Validate the application pool variables by calling the ValidateAppPool function
Write-Progress -Activity "Creating Web Application" -Status "Validating Application Pool Variables"
ValidateAppPool $ApplicationPoolDisplayName $WebApplicationURL
#As long as CriticalError has not been set, create the web application using the variables passed.
if(!($CriticalError))
Write-Progress -Activity "Creating Web Application" -Status "Creating Claims-Based Web Application"
CreateClaimsWebApp $WebApplicationName $WebApplicationURL $ContentDatabase $HTTPPort
error is thrown below:
deployment
S D:\myworkspace\bif> iisreset
ttempting stop...
nternet services successfully stopped
ttempting start...
nternet services successfully restarted
S D:\myworkspace\bif> .\CreateSP2013ClaimsWebApplication.ps1
reating New Managed Account And App Pool
ew-SPWebApplication : "mysrvr:2020/" contains invalid character ':'.
t D:\myworkspace\bif\CreateSP2013ClaimsWebApplication.ps1:68 char:43
Set-Variable -Name WebApp -Value (New-SPWebApplication
ApplicationPool ...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~
+ CategoryInfo
: InvalidData: (Microsoft.Share...PWebApplication:
SPCmdletNewSPWebApplication) [New-SPWebApplication], ArgumentException
+ FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletNewSPWeb
Application
annot index into a null array.
t D:\myworkspace\bif\CreateSP2013ClaimsWebApplication.ps1:235 char:5
$WebApp.Properties["portalsuperuseraccount"] = $PortalSuperUser
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo
: InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : NullArray
cannot index into a null array.
t D:\myworkspace\bif\CreateSP2013ClaimsWebApplication.ps1:236 char:5
$WebApp.Properties["portalsuperreaderaccount"] = $PortalSuperReader
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo
: InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : NullArray
ou cannot call a method on a null-valued expression.
t D:\myworkspace\bif\CreateSP2013ClaimsWebApplication.ps1:239 char:5
$SuperUserPolicy = $WebApp.Policies.Add($PortalSuperUser, "Portal Super
ser ...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~
+ CategoryInfo
: InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull
ou cannot call a method on a null-valued expression.
t D:\myworkspace\bif\CreateSP2013ClaimsWebApplication.ps1:242 char:5
SuperUserPolicy.PolicyRoleBindings.Add($WebApp.PolicyRoles.GetSpecialRole([
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~
+ CategoryInfo
: InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull
ou cannot call a method on a null-valued expression.
t D:\myworkspace\bif\CreateSP2013ClaimsWebApplication.ps1:245 char:5
$SuperReaderPolicy = $WebApp.Policies.Add($PortalSuperReader, "Portal
uper ...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~
+ CategoryInfo
: InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull
ou cannot call a method on a null-valued expression.
t D:\myworkspace\bif\CreateSP2013ClaimsWebApplication.ps1:248 char:5
SuperReaderPolicy.PolicyRoleBindings.Add($WebApp.PolicyRoles.GetSpecialRole
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~
+ CategoryInfo
: InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull
ou cannot call a method on a null-valued expression.
t D:\myworkspace\bif\CreateSP2013ClaimsWebApplication.ps1:251 char:5
$WebApp.Update()
~~~~~~~~~~~~~~~~
+ CategoryInfo
: InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNullHi Benjamin,
If you're getting a Null Value error anywhere, that means a variable you're referencing isn't set to anything. If you're getting that try echoing out each variable after it's assigned to see if it's set to anything.
The link you are referring is for SharePoint 2010 and verified on Windows Server 2008 R2 and 2008, but not Windows Server 2012.
The approach in this case includes the following per the blog:
Check to see if a web application with the current specified URL is already in use – exit if it is
Check to see if an application pool with the name already exists. If so use it, otherwise create one
Create a web application based on the parameters specified
Assign the object cache properties to the new web application
Create policies for the object cache users to the web application
To simplified the code, we could use powershell below to check if web application and application pool have been already in use ahead. And skip the last two steps in the first time.
Get-SPWebApplication | fl displayname, applicationpool
Please refer to New-SPWebApplication
which is used to create a new web application within the local farm:
http://technet.microsoft.com/en-us/library/ff607931(v=office.15).aspx. Only two parameters i.e. ApplicationPool and Name are required, we could try a simple command at first:
Please run Get-SPManagedAccount to check the managed account, then execute the command below:
$ap = New-SPAuthenticationProvider
New-SPWebApplication -Name "Contoso Internet Site" -Port 2014 -ApplicationPool "ContosoAppPool" -ApplicationPoolAccount (Get-SPManagedAccount "Domain\Administrator")
-AuthenticationProvider $ap -SecureSocketsLayer
Regards,
Rebecca Tu
TechNet Community Support -
How to create an array in if/else or case structure without 0's ?
Hello,
I've been trying to do this for a while now.
I only managed to think of this in three ways:
1. (What I'm doing right now Create the array by going through a for loop, which populates the array by auto indexing. It populates with correct number if true and with a '0' if false. The idea was to delete the 0's later on in the code. This however seems highly ineffective.
2. Make use of a shift register, which automatically adds the correct number to an array. The problem is that the array will keep growing and growing and at the very least would tremendously slow down my program. At worst, it would crash.
So, my question is: How do I create an array that if a comparison is true, it puts the element in and if not it does nothing ?
I've attached a PNG snippet of my code.
Kind Regards,
David.
Solved!
Go to Solution.
Attachments:
Get_Indices.png 24 KBPladio wrote:
I've been trying to do this for a while now.
You did not explain what "this" is. Can you give some typical inputs and expected outputs? Populate your controls and indicators with typical data and make it the default efore attaching.
Pladio wrote:
So, my question is: How do I create an array that if a comparison is true, it puts the element in and if not it does nothing ?
Your code show three different comparisons. Which one are you talking about.
Pladio wrote:
I've attached a PNG snippet of my code.
That code makes very little sense. Why is there a shift register if the data in it never changes? What is the purpose of the inner FOR loop? Why are you creating a 2D array?
Do you want to remove all rows where the corersponding SD is zero, for example?
LabVIEW Champion . Do more with less code and in less time . -
Create Purchase Order through EDI
Hello Everybody,
I want to know how to create Purchase order through EDI. I will receive text file from third party system. I have made most of the configuration related to EDI like Port -File, Partner Function etc. I am using message type PORDCR and Idoc type PORDCR05.
But i do not know how the SAP first will convert the text file into IDoc and then create Purchase order. Can any body help me how to go about it? What steps i have to follow. I will have text file from that i have to create Purchase order through EDI.
Thanks in advance.
Regards,
ManishHi,
Create Purchase Order through EDI
Regarding on your query,
You can use the standard ORDERS05 idoc type itself to send outbound idocs.
It will be the middleware or the integration team that will send this IDOC to the receiving system.
or
Maintain Partner Profile in WE20, RFC Connection to the Middleware in SM59 and Port in WE21.
Maintain Output Procedure/Output Type/Access Sequences/Condition Records from NACE
Generate the Outbound 850 (PO) from ME21N
Regards,
Sekhar -
Number of elements in an array
Hi,
I have been trying looking for a simple function to get number of elements is an array. Have gone though older posts but could not find answer to it.
The function should work for following examples:
char* name = "nInstruments"
float state[] = {1.0, 2.0}
I tried sizeof but it returns size of "type" in bytes. For example in example 2, it will just return 4.
Does someone know a way to do it?
Ciao
RB
Solved!
Go to Solution.RB,
In C, if an array is declared on the heap, as opposed to on the stack as in your example above, the sizeof operator only returns the length of the pointer that holds the array which, in a 32-bit program, is always 4 bytes. This is because the compiler has no way of knowing how many elements that array actually holds. The length of a C array is a fairly fluid concept. The real size of the array is usually determined by some memory manager somewhere (usually, malloc), but it's not something that the language itself has anything to say about.
When you declare the entire array as a local variable, however, the compiler must create room for the full array on the stack, and therefore it is able to return the true size of the array via the sizeof operator. (The same is true if it's a global variable, even if it's not on the stack, in that case)
For this reason, using the sizeof(array) / sizeof(array[0]) trick is iffy. It might work, or it might not work, depending on how the array is declared.
For this reason, most C APIs that accept or return arrays, will usually also have some method of communicating the length of the array, usually as an additional parameter of some function. Because .NET APIs usually have no need to do this, the C wrapper for a .NET API in CVI does this for you when it handles .NET arrays. For example, here's what a function signature might look like:
int CVIFUNC Namespace1_Class1_Test1DArrays (Namespace1_Class1 __instance, int * inA, int __inALength, char *** outA, int * __outALength, Namespace1_Class2 ** refA, int * __refALength, double ** __returnValue, int * ____returnValueLength, CDotNetHandle * __exception);
Luis -
How build a function with an array in input and another array in output
Hi, I need to create a function, which receive in input a list of Group's name and retrieve the correspondent list of Group's id.
So I need to have these conditions:
1) The parameter in input has to be only one "p_user_name" (an array of values)
2) the return parameter has to be p_user_id (array of values)
3) in the WHERE condition p_user_name has to be used in order to retrieve the list of user_id I need
Following, a little example:
FUNCTION get_group_id (p_user_name IN VARCHAR2) RETURN p_user_id
IS
BEGIN
SELECT group_id FROM jtf_rs_groups_vl
WHERE group_name = p_user_name
RETURN p_user_id;
END get_group_id;
I think I have to create a new type with p_user_name, but I don't know after, how to join group_name (varchar2) with p_user_name.....
Anybody can help me to find the light ?
Thanks in advance
AlexI need to create a function, which receive in input a list of Group's name and
retrieve the correspondent list of Group's idAt the beginning the argument "p_user_name IN VARCHAR2" is not what you need. You should create global type - nested table of varchar2 values where you
can keep the list of names. And you also need to create nested table of numbers
to return IDs (if you really need collection but not ref cursor !):
SQL> select empno, ename from emp;
EMPNO ENAME
7369 SMITH
7499 ALLEN
7521 WARD
7566 JONES
7654 MARTIN
7698 BLAKE
7782 CLARK
7788 SCOTT
7839 KING
7844 TURNER
7876 ADAMS
7900 JAMES
7902 FORD
7934 MILLER
14 rows selected.
SQL> create type d_v is table of varchar2(10);
2 /
Type created.
SQL> create type d_n is table of number;
2 /
Type created.
SQL> create or replace function get_ids
2 (names d_v) return d_n
3 is
4 ret_ids d_n;
5 begin
6 select empno
7 bulk collect into ret_ids
8 from emp, table(names) t
9 where ename = t.column_value;
10 return ret_ids;
11 end;
12 /
Function created.
SQL> declare
2 d d_n;
3 begin
4
5 d := get_ids(d_v('KING','ALLEN'));
6
7 for i in 1..d.count loop
8 dbms_output.put_line(d(i));
9 end loop;
10
11 end;
12 /
7839
7499
PL/SQL procedure successfully completed.Rgds. -
Get the number of elements in Array
Hi everyone,
Could anyone give me idea on how to get the number of elements in an Array (not number of rows) ?
I tried to find that in both property node and array functions but nothing.
Thanks,
-KunYou are going to have to provide some proof that the Array Size does not work correctly. Right click on the input to it and select 'Create Indicator'. Run the VI. Go to the front panel and select 'Edit>Make Current Values Default'. Save the VI and attach it to your post.
You can also check the array size yourself. Right click on the index display of the array and select 'Advanced>Show Last Element'. I will bet you that number shown is equal to Array Size -1.
p.s. The number of elements in an array is equal to the number of rows in a 1D array. If you define the number of elements as anything else, you are mistaken.
Message Edited by Dennis Knutson on 04-21-2009 10:40 AM
Maybe you are looking for
-
How do i put my apps and music onto my new computer
How do I put apps and music onto my new computer.
-
Tax simplifier statement pdf does not open in chrome, but works in IE
Hi, we are using the Tax simplifier statement http://server:port/sap/bc/webdynpro/sap/hress_a_rep_in_ssitp?sap-wd-configId=HRESS_AC_REP_IN_SSITP&sap-accessibility=X# it is opening properly in Internet explorer, but in google chrome, it is not display
-
Dynamic Class Loading and Stubs
How Dynamic Class Loading is used on Java RMI, since stubs are generated on clients using Reflection API? I was reading Dynamic code downloading using JavaTM RMI (http://java.sun.com/javase/6/docs/technotes/guides/rmi/codebase.html), it seems to be o
-
I Know we cannot use Temp table,table variable in View but i want to know the reason behind it
-
my pc crashed and I replaced it with an iMac, how do i get my iPad and iPhone music and apps back into iTunes?