I created an LSPA job using policejob and now I can't store weapons into the armory. I get the following error - datastore

I created an lspajob using policejob and it mostly work but one of the bugs I found was this error:
[script:esx_datastore] SCRIPT ERROR: #esx_datastore/server/classes/datastore.lua:34: attempt to
index a nil value (local 'obj')
[script:esx_datastore] > ref (#esx_datastore/server/classes/datastore.lua:34)
[script:esx_datastore] > ref (#esx_lspajob/server/main.lua:265)
[script:esx_datastore] > handler (#esx_datastore/server/main.lua:66)
[script:esx_datastore] > ref (#esx_lspajob/server/main.lua:264)
[script:esx_datastore] > TriggerServerCallback (#es_extended/server/functions.lua:160)
[script:esx_datastore] > handler (#es_extended/server/common.lua:121)
[script:esx_datastore] SCRIPT ERROR: error object is not a string
[script:esx_datastore] (nil stack trace)
this happens every time I try to store a weapon into the armory and I can't seem to figure out why. Can anyone help? thanks in advance.

Have you create the entry on your table "datastore" for the job LSPA ?
INSERT INTO datastore (name, label, shared) VALUES ('lspa', 'Los Santos PA', 1)
If no, do this and normaly after server restart, you don't have issue anymore.

Related

Netowrkx len() command giving a 'str' object error

To start, I created a Network using 2014 flight data as explained here:https://ipython-books.github.io/142-drawing-flight-routes-with-networkx/
I'm trying to create smaller graphs using airline specific flight paths to test connectivity within each business, starting with American Airlines, I did the following:
AASys = routes[
routes['source'].isin(airports_us.index) &
routes['dest'].isin(airports_us.index) &
routes['airline'].str.contains('AA')]
AASys
AAedges = AASys[['source', 'dest']].values
AAedges
AAg = nx.from_edgelist(AAedges)
len(AAg.nodes()), len(AAg.edges())
This mirrors the tutorial input almost exactly, with the only change being the additional str.contains('AA'). But when I try to test the len() of my new database, I get -- TypeError: 'str' object is not callable.
Can anyone explain why my edgelist is reading as a string? How to I fix the TypeError?

soapui context properties in script assertion

I've two test case A and B under one test suite
I am setting the context property in script assertion of one of the test step of B
def holder = new XmlHolder( messageExchange.responseContentAsXml )
context.setProperty("xmlHolder", holder)
I am getting the context property in script assertion of one of the test step of A
def Holder=context.getProperty("xmlHolder")
log.info(Holder)
but the value of "Holder" is printed null
I just want to set it in one TC and get it in the other one.
EDIT
Found this , and I was trying to set property like this. I already had a Runner created in script assertion.
Runner.getTestCase().setPropertyValue("xmlHolder", holder)
But receiving a null error
I could do
Runner.getTestCase().setPropertyValue("xmlHolder", "A")
Just wondering , if TC properties can hold an Object compare to string. So, my original question remains as it is.
Based on above comments, got this working
setting property in script assertion of B
context.testCase.testSuite.setPropertyValue('xmlHolder', messageExchange.responseContentAsXml)
getting property in script assertion of B and converting it to XmlHolder object
def HolderContent=context.testCase.testSuite.getPropertyValue('xmlHolder')
def Holder = new XmlHolder ( HolderContent)

llbd error on Xcode 4.6

I am making a Website Picker App on Xcode 4.6 and there are no issues except when I try to run it I get send to the debugger with an error.
return UIApplicationMain(argc, argv, nil, NSStringFromClass([Website_PickerAppDelegate class]));
^^This is highlighted in green with Thread 1: signal SIGABRT under it.
It also has:
2013-06-06 23:29:53.698 Website Picker[1185:c07] -[Website_PickerViewController pickerView:numberOfRowsInComponent:]: unrecognized selector sent to instance 0x75614f0
2013-06-06 23:29:53.699 Website Picker[1185:c07] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[Website_PickerViewController pickerView:numberOfRowsInComponent:]: unrecognized selector sent to instance 0x75614f0'
*** First throw call stack:
(0x1c92012 0x10cfe7e 0x1d1d4bd 0x1c81bbc 0x1c8194e 0xc691 0xf41a 0x1f8548 0x1fb224 0xbf952
0xbf2dc 0xdff8 0x642dd 0x10e36b0 0x228efc0 0x228333c 0x228eeaf 0x1032bd 0x4bb56 0x4a66f 0x4a589
0x497e4 0x4961e 0x4a3d9 0x4d2d2 0xf799c 0x44574 0x4476f 0x44905 0x4d917 0x234b 0x11157 0x11747
0x1294b 0x23cb5 0x24beb 0x16698 0x1beddf9 0x1bedad0 0x1c07bf5 0x1c07962 0x1c38bb6 0x1c37f44
0x1c37e1b 0x1217a 0x13ffc 0x2052 0x1f85)
libc++abi.dylib: terminate called throwing an exception
(lldb)
Can someone please tell me what is the problem ?
Thank You!
The problem probably exists because Website_PickerAppDelegate is the class name and not the variable name, unless you capitalize your variable names. It needs to be something like
return UIApplicationMain(argc, argv, nil, NSStringFromClass([pickerAppDeligateVar class]));
Of course replace pickerAppDeligateVar with the appropriate variable name and give it a go.
The error message
-[Website_PickerViewController pickerView:numberOfRowsInComponent:]: unrecognized selector sent to instance 0x75614f0
means that you did not implement the
- (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component
method in the Website_PickerViewController that acts as data source for the picker view.
(If you think that you implemented it: Check for typing errors such as upper/lower case
letters in the method name.)

Null Reference Excepion when saving data on subsonic 3

I am testing subsonic 3, i can query my database but when i am inserting a record i have an exception. Here is my code:
Client lClient = new Client();
lClient.Name = "Peter";
lClient.FullName = "Richards";
lCliente.Save();
And i have a null reference exception on this generated code:
var newKey=_repo.Add(this,provider);
Any help is appreciated.
I am using ActiveRecords
I had a similar problem, with code not unlike the following:
var pending = myTable.SingleOrDefault(x => x.Id == 1);
if (pending == null)
pending = new myTable();
pending.Id = 1;
pending.MyDate = DateTime.Now;
pending.MyString = someString;
pending.Save();
This worked the first time I ran it, on an empty table, but not the second time when updating. I got a nullreference exception somewhere inside the subsonic repository. The solution was to add a primary key, as Rob suggested.
Just thought I'd mention it (thanks Rob).
Where does the null reference exception actually happen? Is _repo null?
Try and double check that you don’t have any columns in the “Client” table which are not nullable and you don’t set any value.
Also make sure you PK is handled correctly (check you have the [Property.IsForeignKey=true;] attribute)
Do you have NullReferenceException Checked in (file menu) Debug -> Exceptions (press Find and type NullReferenceException, press OK)?
I downloaded the SubSonic code and used it as reference for my project, the exception is thrown in SubSonic.Core\Repository\SubSonicRepository.cs:209 because prop is not checked for null at line 208, and any exceptions are swallowed as evidenced by line 213.
What happens is visual studio breaks on all the exceptions checked in the mentioned dialog. So in one way, this is the expected behaviour from the code.
What actually causes prop to become null, in my case, the table field name is lower-case, but the property is actually cased properly.
From Immediate:
tbl.PrimaryKey.Name
"playerinformationid"
item.GetType().GetProperties()
{System.Reflection.PropertyInfo[11]}
[0]: {System.Collections.Generic.IList`1[SubSonic.Schema.IColumn] Columns}
// *snip*
[5]: {Int32 PlayerInformationid}
// *snip*
item.GetType().GetProperty("PlayerInformationid")
{Int32 PlayerInformationid} // Works!
item.GetType().GetProperty(tbl.PrimaryKey.Name)
null
I hacked this together to "just make it work" (Warning: newbie at 3.5 stuff)
-var prop = item.GetType().GetProperty(tbl.PrimaryKey.Name);
+var lowerCasedPrimaryKeyName = tbl.PrimaryKey.Name.ToLowerInvariant();
+var prop = item.GetType().GetProperties().First<System.Reflection.PropertyInfo>(x => x.Name.ToLowerInvariant() == lowerCasedPrimaryKeyName);
Does your table have a PrimaryKey? It doesn't sound like it does. If not - this is your problem.

How Do You Call an MSSQL System Function From ADO/C++?

...specifically, the fn_listextendedproperty system function in MSSQL 2005.
I have added an Extended Property to my database object, named 'schemaVersion'. In my MSVC application, using ADO, I need to determine if that Extended Property exists and, if it does, return the string value out of it.
Here is the T-SQL code that does what I want. How do I write this in C++/ADO, or otherwise get the job done?
select value as schemaVer
from fn_listextendedproperty(default, default, default, default, default, default, default)
where name=N'schemaVersion'
Here's the code I tried at first. It failed with the error listed below the code:
_CommandPtr cmd;
cmd.CreateInstance(__uuidof(Command));
cmd->ActiveConnection = cnn;
cmd->PutCommandText("select value "
"from fn_listextendedproperty(default, default, default, default, default, default, default) "
"where name=N'schemaVersion'");
VARIANT varCount;
cmd->Execute(NULL, NULL, adCmdText);
...here are the errors I peeled out of the ADO errors collection. The output is from my little utility function which adds the extra text like the thread ID etc, so ignore that.
(Proc:0x1930, Thread:0x8A0) INFO : === 1 Provider Error Messages : =======================
(Proc:0x1930, Thread:0x8A0) INFO : [ 1] (-2147217900) 'Incorrect syntax near the keyword 'default'.'
(Proc:0x1930, Thread:0x8A0) INFO : (SQLState = '42000')
(Proc:0x1930, Thread:0x8A0) INFO : (Source = 'Microsoft OLE DB Provider for SQL Server')
(Proc:0x1930, Thread:0x8A0) INFO : (NativeError = 156)
(Proc:0x1930, Thread:0x8A0) INFO : ==========================================================
EDIT: Updated the call according to suggestions. Also changed "SELECT value AS schemaVer" to just "SELECT value".
EDIT: Changed the first parameter of Execute() to NULL per suggestion. This fixed my original problem, and I proceeded to the next. :)
Try specifying NULL rather than default for each parameter of fn_listextendedproperty. This should hopefully then execute without errors, just leaving you to retrieve the result as your next step.
I still have not figured out how to do this directly. To get on with my life, I wrote a stored procedure which called the function:
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go
ALTER PROCEDURE [dbo].[mh_getSchemaVersion]
#schemaVer VARCHAR(256) OUTPUT
AS
select #schemaVer = CAST( (select value from fn_listextendedproperty(default, default, default, default, default, default, default) where name=N'schemaVersion') AS varchar(256) )
return ##ROWCOUNT
...and then called thst sproc from my ADO/C++ code:
_CommandPtr cmd;
cmd.CreateInstance(__uuidof(Command));
cmd->ActiveConnection = cnn;
cmd->PutCommandText("mh_getSchemaVersion")_l
_variant_t schemaVar;
_ParameterPtr schemaVarParam = cmd->CreateParameter("#schemaVer", adVarChar, adParamOutput, 256);
cmd->GetParameters()->Append((IDispatch*)schemaVarParam);
cmd->Execute(NULL, NULL, adCmdStoredProc);
std::string v = (const char*)(_bstr_t)schemaVarParam->GetValue();
ver->hasVersion_ = true;
...which works, but I didn't want to have to deploy a new stored procedure.
So if anyone can come up with a solution to the original problem and show me how to call the system function directly from ADO/C++, I will accept that as the answer. Otherwise I'll just accept this.