Apparently spurious compilation warning - blackberry

In my main screen class, I get the following warning:
Warning!: member data 'String url' not
required in class:
com.mycompany.score.MyScreen
[...] line 54
Now, line 54 is:
48 public class MyScreen extends MainScreen
49 {
50 private HorizontalFieldManager editPane;
51 private VerticalFieldManager buttonPane;
52 private HorizontalFieldManager contentPane;
53 private LabelField label;
54 private BasicEditField input;
55 private ButtonField parseButton;
.
.
.
and nowhere do I have a field (or method), url, in the class let alone at that line. I've tried refreshing, closing/opening the file, bouncing Eclipse, etc.
While this is a only a warning, I try to fix/eliminate all warnings in my code. At very least, I want to be convinced I know why I shouldn't care about each one I let pass.
I've spent a great deal of time looking for a solution to this problem without success. It would be nice to have a definitive answer and not, "just ignore it."
Thanks,
Russ Bateman

I know nothing about Blackberry programming, but eliminating warnings is big deal for me. Does the warning move if you re-arrange the order of the fields? If you changed label to BasicEditField would you get two warnings? You need some kind of reality check to prove the warning goes with that file - for instance, deliberately put in a compile error after the location of the warning. I've een case where compilers were grabbing old versions of files (from other projects, etc). Good Luck!

Related

StackExchange.Redis.IDatabase exists in two dlls

I installed Redis StackExchange nuget and things worked fine. But then I installed RedisSessionStateProvider nuget, which installed StackExchange.Redis.StrongName along with it.
Now I am getting the following error,
Error 107 The type 'StackExchange.Redis.IDatabase' exists in both
'e:\Source\packages\StackExchange.Redis.1.0.481\lib\net45\StackExchange.Redis.dll'
and
'e:\Source\packages\StackExchange.Redis.StrongName.1.0.481\lib\net45\StackExchange.Redis.StrongName.dll' E:\Source\MyApp\Helpers\RedisHelper\StackExchangeRedisExtensions.cs 13 37 MyApp
Why is this?
There's a lot of confusion between the strong-named dll and the non-strong-named dll namespaces.
You can easily solve this by using extern alias.
Right click on project references and pick the dll you want to refer, go to properties window. Then, change the Aliases field value to anything you want. E.g: "Redis".
Then go to your consumer source-file and add:
extern alias Redis;
using System;
// ... other references
using Redis::StackExchange.Redis;
namespace Foo
{
public class Program
{
public static void Main(string[] args)
{
using (ConnectionMultiplexer connection = ConnectionMultiplexer.Connect("myConn"))
{
// use StackExchange API here.
}
}
}
}
There's also an issue on StackExchange's repository explaining more about StrongName vs Non-StrongName.
Some methods/properties/interfaces are duplicated in above 2 dlls.
Remove StackExchange.Redis reference to resolve errors.
I faced this issue in an ASP.NET Core app, and this answer solved my issue quickly.

Reconcile Error: Has anyone had problems with truncated error messages?

I'm here again to ask for a help to you. This time I believe that few will respond given the great particularity of the problem which I will relate. I'm starting in the world of DataSnap, and still have things I do not understand how this error I will relate.
My Delphi is XE (version 1, Update1). I am using Postgres which generates error messages in Portuguese (Portuguese Brazil) and for this reason the error messages have accents. The connection components are ZeosLib package.
I am using a dialog box "reconcile error" to display errors arising from the application of updates and to test, I tried to insert a record that already existed, thus violating a unique key and thus displaying the reconcile error dialog.
In the memo of the dialog, the message that appears is truncated, ie cut. Check it out:
ERRO: duplicar valor da chave viola a restrição de unicidade "uc_usu_va_login"
DETAIL: Chave (va_login)=(admin) já existe.
CONTEXT: comando SQL "INSERT INTO USUARIOS (VA_NOME
,VA_LOGIN
,CH
But actually what should be returned is this:
ERRO: duplicar valor da chave viola a restrição de unicidade "uc_usu_va_login"
DETAIL: Chave (va_login)=(admin) já existe.
CONTEXT: comando SQL "INSERT INTO USUARIOS (VA_NOME
,VA_LOGIN
,CH_SENHA
,VA_EMAIL)
VALUES (pVA_NOME
,pVA_LOGIN
,pCH_SENHA
,pVA_EMAIL)"
PL/pgSQL function "idu_usuarios" line 7 at comando SQL
I have done a debug on the server to see if the problem is ZeosLib, but I found that the error message generated on the server is complete, proving that ZeosLib does not truncate the message. Everything is unicode. All strings are WideString (the default) on both my program and in ZeosLib.
As you know, to be thrown on the server, the exception is forwarded to the client, roughly speaking, by DataSnap, and on the client, the Reconcile method of TClientDataSet verify if there were problems and then throw the famous exception EReconcileError that can be handled in the OnReconcileError event of TClientDataSet, therefore I believe that the message is being truncated by DataSnap.
On the client I debug the Reconcile method (DBClient.pas) and immediately before the exception is thrown the flow enters a function within a cpp source code that I think part of the library midas.dll, MidasLib.obj more specifically, since I am using this strategy, not to have to distribute the DLL with my application.
Check(FDSBase.Reconcile_MD(FReconcileDataSet.FDSBase, FDeltaPacket, VarToDataPacket(Results), Integer(Self), RCB));
This call is done at line 1952 of the unit DBClient.pas on Delphi XE Update1. Pressing F7, the debugger enters a source C++ (cpp), so I believe it is within the midaslib.obj. How I do not understand C++ well, I press Shift-F8 to exit the current method and return the next instruction, that is already inside the event OnReconcileError!! Therefore, the truncation must be done within the function I mentioned, within a cpp source, within midaslib.
My intention is to make the Reconcile Error dialog a tool not only for the final user but to support personals, providing separately information of Error, Details and Context. This helps a lot to discover a problem.
The problem now is to make the message appear in full. Has anyone had this kind of problem with messages being truncated by midas?
Also another point DSClient.pas I could extract the error message as it is passed to the exception:
'Erro SQL: ERRO: duplicar valor da chave viola a restrição de unicidade "uc_usu_va_login"'#$A'DETAIL: Chave (va_login)=(admin) já existe.'#$A'CONTEXT: comando SQL "INSERT INTO USUARIOS (VA_NOME'#$A' ,VA_LOGIN'#$A' ,CH'
If you remove the quotes and replace #$A (1 character) by a white space (one character), you will see that the string has exactly 255 characters!!
I also discovered that the "GetErrorString" in dspickle.cpp uses the constant DBIMAXMSGLEN which is defined in bdetypes.h as 127 (half of 255). As we are in the world of Unicode, it would not be a question of increasing this value to 255 in order to have two bytes per character? This is only a guess...
I leave the question in the air because I lack the knowledge to understand C++ :) Who can help, just look at the function implementation "GetErrorString" in dspickle.cpp. There is this:
LoadString((HINSTANCE)hDll, iErrCode, pString, DBIMAXMSGLEN)
pString is the error message and DBIMAXMSGLEN = 127.
Contradicting the opinion of others I decided to tweak further and finally figured out how to increase the number of characters in the "Reconcile" error message. As I thought the problem was in midas.dll, or more specifically the sources that make up the midas dll because the same set of sources can create MidasLib, which does not require a midas dll. To resolve I had to install the Delphi C++ personality to compile the midas.
After finding the line of the error, I discovered that there is even a request for repairs to the QC (http://qc.embarcadero.com/wc/qcmain.aspx?d=84960) which seems to have been ignored by the staff of Embarcadero, as that the "Resolution" as is "Deferred to Next Rel" (Deferred to Next Release) but the request is from 2010 and I'm using Delphi XE which in my opinion should have the solution but here I am correcting by myself ;)
The problem is inside the method "Clone" of the "DSBASE" class, inside source "ds.cpp" at line 2133 (Delphi XE, Update1). Below is the code block. The red line is the problematic line:
// Set the third field for the error string.
LdStrCpy((pCHAR)pFldDes->szName, szdsERRMESSAGE);
pFldDes->iFldType = fldZSTRING;
pFldDes->iUnits1 = 255; // Increased on request.. DBIMAXMSGLEN;
pFldDes++;
Note that it is very interesting the problem line. It has a constant value of 255, which limits the size of the error messages and a comment "Increased on request". Also note that next to the comment, there is a constant DBIMAXMSGLEN, which I had found and already suspected as being responsible for the problem, but as it was not being used I changed the value of DBIMAXMSGLEN but the error message always came without changes. It is worth mentioning that there is a semicolon (;) after DBIMAXMSGLEN which leads me to think that before (I do not know when) this line was one that was just after my fix:
pFldDes->iUnits1 = DBIMAXMSGLEN;
It's as if someone had deliberately set the field value to 255, removing the previous implementation that was really dynamic and seemingly more correct. After performing the replacement of the line I increased the value of DBIMAXMSGLEN to 1024. DBIMAXMSGLEN is declared "bdetypes.h" as a define. After correcting the line went like this:
#define DBIMAXMSGLEN 1024 // Max message len
After these two changes in "ds.cpp" and "bdetypes.h" I build, test, and the result was as expected: the error message was presented in full in the Reconcile dialog.
To the brave who want to try if they have seen this problem, you need the sources of MIDAS, which comes with Delphi from 2010 if I remember correctly. Good luck to all.

problem antlrworks code too large

In Antlrworks I get this error:
[18:21:03] Checking Grammar Grammar.g...
[18:21:26] Grammar.java:12: code too large
[18:21:26] public static final String[] tokenNames = new String[] {
[18:21:26] ^
[18:21:26] 1 error
Using instead the generated code in a Java project works normally. What can be had this problem?
Thanks.
For larger grammars, it's easier to split your grammar into bite-sized chunks (at least a separate lexer and parser). If you do so, ANTLRWorks will probably stop complaining as well.
Checkout the Wiki entry about "Composite grammars".

Simple OpenCV problem

Why I try to run the following OpenCV program, it shows the following error :
ERROR:
test_1.exe - Application Error
The application failed to initialize properly (0x80000003).
Click on OK to terminate the application.
CODE:
#include "cv.h"
#include "highgui.h"
int main()
{
IplImage *img = cvLoadImage("C:\\face.bmp");
cvSetImageROI(img, cvRect(100,100, 100, 100));
cvAddS(img, cvScalar(50), img);
cvResetImageROI(img);
cvShowImage("Test", img);
cvWaitKey(0);
return 0;
}
When i press F5(im using vs2008express), the program encounters a break point...i have attached a picture...dont know, whether, it will help or not.
Error Snapshot Link
It is not that, only this program is producing this error, but also any kind of image manipulation funciton containing (OpenCV)program is resulting in this sitution.
Such as : cvSmooth
one last thing, it there any dedicated OpenCV forum or sth like that?
I am an administrator.So, yes, ive the permission.
a version mismatch.
sorry, i didn't get it?Version mismatch with what?
But, i have found the error using dependency walker.
Warning: At least one module has an unresolved import due to a missing export
function in a delay-load dependent module.
and also found that, it is a common problem, and found some info in the FAQ of DW...
Why am I seeing a lot of applications where MPR.DLL shows up in red under
SHLWAPI.DLL because it is missing a function named WNetRestoreConnectionA?
I also get a "Warning: At least one module has an unresolved import due to
a missing export function in a delay-load dependent module" message.
Function name : WNetRestoreConnectionA
But there is no guideline about how to solve it. Though, they say, it is not a problem.
i googled a little and found a suggestion.It says,
Turn off your compilers setting to assume you are programming for Win9x.
(I just lost which setting but it is not that difficult, use a #define...)
But i have no idea, how to do that in Visual Studio 2008 express.
Any suggestion how to solve it...
This usually indicates a problem with a dll; either you don't have permission, or a version is mismatched. Try running as Administrator to see if it is a permissions problem. If that doesn't help, try using the Dependency Walker.

How can I increase the size of a memory block in MPLAB?

The Microchip PIC MPLAB (MCC18) compiler segments its memory into 256 chunks ( 0x100 ).
How can I create an array larger than 256 bytes?
char buffer[256];
Just to get to 256 I needed to make a seperate segment with a #pragma
#pragma udata segment_name
char buffer[256];
#pragma udata
So I can either force MCC18 to let allocate a larger buffer? or combine two memory segments?
Pasting answer from:
http://forum.microchip.com/printable.aspx?m=39357
Just in case it goes away.
In Three Easy Steps Step 1: Assign the
variable into a named section in
source code:
#pragma udata big_scn
char big_array[0x180];
#pragma udata
Step 2: Create the larger region in
the linker script: Before:
DATABANK NAME=gpr3 START=0x300 END=0x3FF
DATABANK NAME=gpr4 START=0x400 END=0x4FF
After:
DATABANK NAME=big_scn START=0x300 END=0x47F PROTECTED
DATABANK NAME=gpr4 START=0x480 END=0x4FF
SECTION NAME=big_scn RAM=big_scn
Step 3: Reference only through a
pointer:
char *big_array_ptr = &big_array[0];
big_array_ptr[0x100] = 5;
while( big_array_ptr[x] != 20 )
NOTE: I believe you can still reference the array directly instead of using a pointer. Seems to work for me.
The same information can be found in the following document:
MPLAB C18 C Compiler Getting Started Guide
Page 104.
Perhaps someone with more knowledge will prove me wrong, but I don't think it's possible to do what you want. If the memory in your device is divided into segments of 256 bytes, then you can't have an array spanning them, AFAIK. If you did, it would have to jump through all sorts of hoops to let you treat the array as contiguous memory -- it would have to check each index you use to figure out which segment it should be in, then compute the offset and access it, or if you're accessing the array using pointer arithmetic, it must figure out what you're trying to access, which may be non-obvious or even unknown at compile time. I don't think it has a single memory model that it can use for all circumstances because of the way some memory locations are common across banks (I think the program counter is one such location), etc. I'm speaking largely from a knowledge of the typical PIC architecture and some experience with third-party C compilers. I don't have much experience with MPLAB itself, so take my answer with a grain of salt.
It may be possible for you to get around the restriction by allocating an array of pointers and then initializing each pointer to a new instance of whatever data type you want to store in it (I'm assuming a struct or something larger than a pointer), as this will not require the memory to be contiguous. Dynamic memory allocation on PICs is expensive, however, so this may not be a good option for you.
I have a similar problem!I was going to use this method: http://www.hobbytronics.co.uk/c18-large-data-arrays
But when I added linker without any change to the project and compile the project I got this error
// $Id: 18f2550.lkr,v 1.3 2005/03/24 04:17:19 craigfranklin Exp $
// File: 18f2550.lkr
// Sample linker script for the PIC18F2550 processor
LIBPATH .
//CODEPAGE NAME=vectors START=0x0 END=0x29 PROTECTED
CODEPAGE NAME=page START=0x0 END=0x6FFB
CODEPAGE NAME=boot START=0x6FFC END=0x7FFF PROTECTED
CODEPAGE NAME=idlocs START=0x200000 END=0x200007 PROTECTED
CODEPAGE NAME=config START=0x300000 END=0x30000D PROTECTED
CODEPAGE NAME=devid START=0x3FFFFE END=0x3FFFFF PROTECTED
CODEPAGE NAME=eedata START=0xF00000 END=0xF000FF PROTECTED
ACCESSBANK NAME=accessram START=0x0 END=0x5F
DATABANK NAME=gpr0 START=0x60 END=0xFF
DATABANK NAME=gpr1 START=0x100 END=0x1FF
DATABANK NAME=gpr2 START=0x200 END=0x2FF
DATABANK NAME=gpr3 START=0x300 END=0x3FF
DATABANK NAME=usb4 START=0x400 END=0x4FF PROTECTED
DATABANK NAME=usb5 START=0x500 END=0x5FF PROTECTED
DATABANK NAME=usb6 START=0x600 END=0x6FF PROTECTED
DATABANK NAME=usb7 START=0x700 END=0x7FF PROTECTED
ACCESSBANK NAME=accesssfr START=0xF60 END=0xFFF PROTECTED
SECTION NAME=CONFIG ROM=config
SECTION NAME=bank1 RAM=gpr1
SECTION NAME=usbram4 RAM=usb4
SECTION NAME=usbram5 RAM=usb5
SECTION NAME=eeprom ROM=eedata
error:
18f2550.lkr:5: warning: (374) missing basic type; int assumed
18f2550.lkr:5: error: (314) ";" expected
whay?Everything is true!
I am using mplabx v 2.0 and Mplab xc8 v 1.31

Resources