Questions tagged [spl]
SPL is a collection of PHP interfaces and classes that are meant to solve standard problems.
361
questions
0
votes
0
answers
15
views
spl-token create-token failed to create token
I am trying to create my first token using the Linode website
I created a Linux machine Ubuntu latest version
and I followed some steps to create my token
I used Solana blockchain for that, and I ...
0
votes
1
answer
206
views
saving metadata on private storage instead of metaplex solana
In Ethereum ERC-721 or ERC1155, off-chain metadata can be saved on private storage like S3. In solana, I want to use SPL to mint NFT with metadata on own storage, it is returning type mismatch error. ...
1
vote
1
answer
55
views
Exchange ERC20 (Ethereum) with SPL (Solana) via DEX
I've been searching for a while, but I can't seem to find an answer to this so it would be very helpful if someone can clarify this 😣.
Let's say i have TokenA as an ERC20 deployed to the Ethereum ...
0
votes
1
answer
48
views
PHP8 - SplFixedArray iterator's next() doesn't move key pointer
Please take a look at this code:
<?php
$array = new SplFixedArray(1);
print "\nKey1: " . $array->getIterator()->key();
$array->setSize(5);
$array->getIterator()->...
-1
votes
1
answer
102
views
SPL and U-Boot placement
Storage device for an embedded system is organized as:
Non-partitioned space, saved for U-Boot.
BOOT-VAR6UL - A FAT16 partition containing the Linux image and the device tree blob/s.
"rootfs&...
1
vote
1
answer
787
views
How to search a lookup based on partial match of field values of a base search in splunk
I am trying to combine 2 searches where the outer search passes a value to the inner search and then appends the results. Let me explain:
As of right now, I am searching a set of logs that happens to ...
0
votes
1
answer
89
views
About lookup command when the lookup file contains strings and regular expressions
I have a question about the lookup command when the lookup file contains strings and regular expressions.
The following is an example.
field var_1 : String
field var_2 : String
field var_3 : Regex or ...
2
votes
1
answer
1k
views
How to transfer custom SPL Token (USDC) using @Solana\web3.js (amount issues)
I have been trying to transfer custom SPL tokens using @Solana\web3.js and am having issues with the instruction creation. I created the instruction using the Token.createTransferInstruction method ...
0
votes
1
answer
386
views
What is the alternative of "approve" in evm on Solana?
I have several wallets in evm. I give their X token access to my main wallet by calling Contract(x).approve() function. Thus i can make operations with these wallets. Now i want to do same thing on ...
0
votes
2
answers
89
views
Splunk - "grandparent from process and parent process"
In my data I have process and parent process. As an example, I can get process id and parent process id for "calc.exe". Now I also want to be able to get "grandparent", ie the ...
0
votes
0
answers
48
views
SQLite DateTime type only accepts Python datetime and date objects as input
I tried to update the data of name, description, and date, but it shows an error. When I 'create' my task and add details it works fine. Only when I try to update it.
Here is my working python code
@...
0
votes
1
answer
111
views
How to Alphabetically Sort a SplObjectStorage Set in PHP?
I have an array of letters that must be alphabetically sorted in a SplObjectStorage() set using SPL methods such as rewind(), current(), next(), and valid(). Currently, my while loop runs indefinitely ...
0
votes
0
answers
81
views
Alphabetically Sort a Doubly Linked List in PHP Using SPL Methods
In JS, you can make a Linked List for some books by creating a couple classes:
class Book {
constructor(element) {
this.element = element;
this.next = null;
}
}
class Books {
...
0
votes
0
answers
16
views
How do I get the fiscal year to max at our previous year?
WHERE
AND d.FISYR >= (SELECT MAX(FISYR)-1 FROM SAFP WHERE company = '11')
The above is our "WHERE" clause, we'd like the max fiscal year to be 2021 ONLY. this clause is showing us a ...
0
votes
0
answers
83
views
Splunk regex how to regex mulitple triple backslashes
First fyi, i have searched answers and am having an issue finding something that works. I am an end user (and a newbie) to Splunk and have data from a log looking like this (snippet):
{\\\"...
0
votes
1
answer
138
views
Splunk Streamlined search for specific fields only
I've ran out of GoogleFu, so if anyone can point me in the right direction or a better term or two to Google... I'm trying to figure out Splunk SPL syntax to search 4 different fields for the same ...
2
votes
0
answers
66
views
Does SplMinHeap or SplMaxHeap implement Traversable interface logically?
I noticed that SplMinHeap or SplMaxHeap implements the Iterator interface, which implements Traversable interface, so I can use iterator_to_array (Traversable $iterator) : array or foreach syntax to ...
0
votes
1
answer
199
views
how to check if SplFixedArray contains value?
with a normal array one would use in_array() , but in_array doesn't support SplFixedArray, and i couldn't really find any splFixedArray in_array() equivalent, i could just foreach-loop it myself like
...
0
votes
1
answer
345
views
Adding custom column / field into splunk result
i am new to splunk and i am trying thing out on my own.
This might be an elementary question to most of you , but please be patient in trying to help me out.
| inputlookup "Wsp.csv"
| eval Outage = ...
1
vote
1
answer
300
views
PHP autoload class not found
I'm having a problem with PHP autoload with a specific class, where it keeps saying it's not found.
Error:
Warning: require_once(Models/BaseModel.php): failed to open stream: No such file or ...
3
votes
1
answer
2k
views
Error: Class 'SplEnum' not found in PHP 7
I have a project with PHP 7.3, under Windows 10. I use the PHP from Xampp.
I get the following error:
Fatal error: Uncaught Error: Class 'SplEnum' not found in [...]
for
class BanLevel extends ...
0
votes
1
answer
79
views
PHP SPL RegexIterator how files would be ordered?
Let's say I have a snippet:
<?php
$directoryIterator = new RecursiveDirectoryIterator('some_dir_here');
$iteratorIterator = new RecursiveIteratorIterator($directoryIterator);
$regexp = '/...
0
votes
1
answer
52
views
How to mimic this doubly linked list animation using SplDoublyLinkedList?
I was trying to reverse engineer this Doubly Linked List animation generated using this tool:
So I've tried this:
<?php
$dll = new \SplDoublyLinkedList();
$dll->unshift(200);//inserir no ...
2
votes
0
answers
2k
views
Build U-Boot SPL for custom board
I have built a custom board with a iMX6 Processor.
Unfortunately i have not stripped out the Bootloader Config pins. They are still unconnected BGA-Balls. I do have access to UART1-3, JTAG and SD-Card ...
0
votes
0
answers
42
views
how to pass a parameter to my regex and loop on an array to find the word corresponding to my parameter
I want to add span class to highlight each word on a table corresponding to my parameter value.
Now, I can add a span class only when I tape the word on a regex parameter like this : patt=/40/igm;
I ...
1
vote
3
answers
146
views
SPL InfiniteIterator is not working with next or prev
I wanted to over an array infinitely like a circular array.
I have the following setup using InfiniteIterator1, which iterates over the $players infinitely. But actually, I want to know the next ...
1
vote
1
answer
71
views
Powershell: recurse directories for where a file extension exists if Exist write out comman if not run a command
Specifically, I have a directory with a ton of other random named directories (Not really random but that's not important). In those directories some contain files with a .tsidx extension, some do not....
1
vote
0
answers
46
views
What is causing serialVersionUID errors when integrating Weka, SPL, and Java?
I am trying to update a Weka classifier in SPL, changing the attributes used to classify each case. I updated all SPL files and type definitions, along with a Java file, to use the new set of ...
0
votes
1
answer
151
views
What happens if the same object instance is attached multiple times to SplObjectStorage?
Or in other words, should I bother checking whether it already is in the set before attaching it?
$s = new SplObjectStorage();
foreach($arrayOfObjects as $primaryObject) {
$subObject=$...
0
votes
1
answer
3k
views
how to run a splunk search for every found orderid
I want to first select every ORDERID and then perform a search to every ORDERID I found for that day.
So i need a foreach ORDID. I found just the map command, but it wont work the way I did it.
for ...
0
votes
1
answer
218
views
SPLUNK subsearch 2 CSV Files join together
I have 2 Files with order data saved in two different sourcetypes in splunk.
One file contains an orderid, plnum(praefix + orderid (one ordernumer contains 3 plnum)), model (type of the order). The ...
0
votes
0
answers
297
views
Create a Trigger to change values before insert in Informix
We have a table with a date field. Also there are some old apps we can't modify whose inserts that date field with string ("yyyy-mm-dd") (Yeah, SQL Injectión Party!!). Now it's needed to change that ...
0
votes
0
answers
369
views
Create PHP collection class that extends an array
I am in process of writing a class which contains a collection of other objects. I will create a method to move an element in the collection from one position to another, another to determine what ...
0
votes
1
answer
200
views
How to add SPL library into PhpStorm so that it recognises SPL Exceptions for PHPDoc
I noticed that PhpStorm doesn't recognise SPL Exceptions when I'm generating PHPDoc. How can I fix this? I don't know if my case is specific, I couldn't find anything about this on SO.
I'm using ...
4
votes
0
answers
249
views
The right way to sort SPL collections in PHP
Is there any uniform and efficient way to sort SPL collections like SplFixedArray, SplDoublyLinkedList and etc?
Standard functions like usort doesn't work at all, because they are awaiting that the ...
1
vote
1
answer
878
views
What does everyone mean by: 'spl:_autoload() is default implementation of __autoload()'
I got confused with one thing about php autoloading stuff: the spl_autoload() function. In every answer I found that this function is default implementation of __autoload. Shouldn't PHP define default ...
2
votes
2
answers
712
views
PHP array to string conversion notice with CachingIterator
I have done some searching on Stackoverflow already on this topic, however as far as I can tell, I am not treating an array as a string ?
The message I am getting is :
Array to string conversion in X ...
1
vote
0
answers
315
views
setting Timeout for SplFileObject reading from remote aws s3 file
I am reading a file line by line directly from aws s3 server using SplFileObject.
$url = "s3://{$bucketName}/{$fileName}";
$fileHandle = new \SplFileObject($url, 'r');
$fileHandle->setFlags(...
1
vote
2
answers
716
views
Get original array structure from RecursiveIteratorIterator instance
Set-up:
$array = ['level_one' => [
'level_two' => [
'level_three' => [
'key' => 1
]
]
]];
I prepare it for a filtering process ...
1
vote
1
answer
343
views
SplDoublyLinkedList - how to fetch nodes surrounding current node
Got a question about PHP's SplDoublyLinkedList. If the nature of doubly linked lists is that every node has a reference to nodes on both left and right, why doesn't SplDoublyLinkedList offer methods ...
1
vote
0
answers
40
views
Is it possible to convert XMI file to feature model?
I have xmi file of a variability model. I want to modify it.I need to convert it to grapical feature model for better understandability and easy modification.
How can i do that?
1
vote
1
answer
794
views
What's the difference between SplHeap, SplMinHeap, SplMaxHeap and SplPriorityQueue
Have a bunch of objects I need to go through in a sorted order. Discovered the two sub-classes of SplHeap, SplMaxHeap and SplMinHeap, so figured I could try to use those as an experiment. In a comment ...
1
vote
0
answers
706
views
php 7 spl autoloader not working
recently having to migrate from a php 5.3 to a php 7 server, and i am running into a perplexing issue
a snippet of autoloading that works perfectly fine on 5.3 is not working on 7, it is giving ...
0
votes
2
answers
250
views
OSx php7.1 problems
I am new on OSx and have problem with my php installation and SPL functions. Sometimes when I'm trying to access symfony project through apache I'v got an errors showed below.
When spl_autoloader ...
2
votes
0
answers
269
views
Flatten array of iterators
I tried different combinations of SPL Iterators, but I can't find a way to implement recursive iteration over array of iterators. Here is analog of what I'm looking for but implemented using ...
5
votes
1
answer
1k
views
Install SPL_Types on PHP 7.1 compiled from source
I am trying to install SPL_Types extension in my PHP 7.1.8 compiled from source.
I have tried with sudo pecl install SPL_Types and compiling the extension from source, but I get the following output:
...
1
vote
1
answer
691
views
Iterating through database results with php iterator interface
I've been studying this book on php and there's this example on the iterator pattern which uses the iterator interface. I can use the iterator interface to loop through simple arrays but I don't quite ...
2
votes
2
answers
5k
views
How to convert php enum to array?
I've got the following enum:
abstract class DaysOfWeek
{
const Sunday = 0;
const Monday = 1;
// etc.
}
How can I modify the following function to generate an array based on the enum ...
0
votes
0
answers
73
views
how to use $this in function spl_autoload_register
public function run()
{
spl_autoload_register(array($this, 'loadClass'));
}
Why use $this here?
How should spl_autoload_register() be used?
1
vote
0
answers
265
views
Read log file with SplFileObject Class and flag SKIP_EMPTY not work
I need to read some rsync log files, and these have some empty lines
I try to use:
$f = new \SplFileObject($file);
$f->setFlags(7); // Test 6 value and same problem
while (!$f->eof())
...