w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Firebird crashes on `UTF8 string converted to wstring`
mbstowcs assumes its second parameter to be a string in the system default code page, also known as CP_ACP, which is never UTF-8 (also known as CP_UTF8). The inverse of WideCharToMultiByte is MultiByteToWideChar. Though it's unclear why you want to convert a string from Unicode to UTF-8, only to convert it right back.

Categories : C++

firebird embedded multiple inserts using .net provider
You don't need the set term statements, these are isql specific thing. So try String sql = @"EXECUTE BLOCK AS BEGIN INSERT INTO Customers(ID, Name, SiteID) VALUES(1,'delta',2); INSERT INTO Customers(ID, Name, SiteID) VALUES(2,'phoenix',2); END";

Categories : C#

[ODBC Firebird Driver][Firebird]attempted update during read-only transaction
Since I am using odbc connection, the fault was actually in the odbc connection configuration. You simply need to un-check the read (default write). Now it works like a charm. Hope this helps someone.

Categories : C#

Binding provider that support writing to non observables
I solved it like this var applyMemberWriter = function(bindings, bindingName, accessor, memberName, context) { if(!ko.isObservable(accessor)) { bindings._ko_property_writers = bindings._ko_property_writers || {}; bindings._ko_property_writers[bindingName] = function(value) { context[memberName] = value; }; } }; This needs to be called to apply two way binding on none observables, full source https://github.com/AndersMalmgren/Knockout.BindingConventions/commit/7d8e7cdf0ddced5b39f10c1b374bcd5254cc0a58 Above is for KO 2.x For KO 3.x https://github.com/AndersMalmgren/Knockout.BindingConventions/commit/78983119c1e5fb70c637e4ffc1b692d2b4c74dc7

Categories : Knockout Js

Convert input file or stream to UTF8 and detect if it's UTF8 or not (asp.net)
For checking if stream is UTF8 see: http://utf8checker.codeplex.com/ For converting it you can use StreamReader: new StreamReader(stream, Encoding.UTF8)) In fact, using this contructor prevents you the previous check, you can just use it. MSDN: The character encoding is set by the encoding parameter, and the buffer size is set to 1024 bytes. The StreamReader object attempts to detect the encoding by looking at the first three bytes of the stream. It automatically recognizes UTF-8, little-endian Unicode, and big-endian Unicode text if the file starts with the appropriate byte order marks. Otherwise, the user-provided encoding is used. See the Encoding.GetPreamble method for more information. If you wish it not to detect little-endian Unicode and big-endian Unicode ca

Categories : C#

org.apache.nutch.crawl.Crawler NPE at org.apache.avro.util.Utf8.(Utf8.java:37)
You should copy file $NutchHome/src/bin/crawl to the deploy directory: $NutchHome/runtime/deploy/bin and then run the crawl command script : crawl < seedDir> < crawlId> < numberOfRounds> Hope this helps.

Categories : Java

How to strip out 0x0a special char from utf8 file using c# and keep file as utf8?
may wanna have a look at regex replacement, for a good example of this, take a look at the post towards the bottom of this page... http://social.msdn.microsoft.com/Forums/en-US/1b523d24-dab6-4870-a9ca-5d313d1ee602/invalid-character-returned-from-webservice

Categories : C#

No Entity Framework provider found for the ADO.NET provider with invariant name 'System.Data.SqlClient'
I just got into the same problem and it looks like EntityFramework although installed from NuGet Package Manager was not correctly installed in the project. I managed to fix it by running the following command on Package Manager Console: PM> Install-Package EntityFramework

Categories : Entity Framework

Dual purpose of Android ContentProvider: 1. Search provider and 2. List content provider
The ContentProvider you're using is generic and can be used for a search feature. You may think at first that maybe you should write a ContentProvider that specifically works for search but: You will have to duplicate a lot of code. ContentProviders are not designed to be specific, they just abstract the access to data. Your "Search Content Provider" will be used to make queries and you already have that with the Content Provider you have. The ContentProvider doesn't need to be specific to search. On the other hand, your Adpater should be specific.

Categories : Android

Get ExtraData from MVC5 framework OAuth/OWin identity provider with external auth provider
So unfortunately this is not super straightforward, one way you can do this is to hook the GoogleProvider Authenticated event and add a custom claim to the Claims Identity with the avatar: public class MyGoogleProvider : GoogleAuthenticationProvider { public override Task Authenticated(GoogleAuthenticatedContext context) { context.Identity.AddClaim(new Claim("avatarClaim", "<fetch avatar url here>")); return base.Authenticated(context); } } app.UseGoogleAuthentication(new GoogleAuthenticationOptions() { Provider = new MyGoogleProvider() }); Then inside of your AccountController, when the external identity is extracted, you can take this avatar claim and store it into your user object for use later.

Categories : Asp Net Mvc

How to convert array with elements utf8 strings to NSArray with elements utf8 strings in objective c
I assume utfStringArray is terminated with a NULL, else you'll need to provide the element count separately. I am also assuming ARC. Note I am using NSData as you have stipulated that NSString's cannot be used (for some reason): unsigned char **utfStringArray = ...; NSMutableArray *array = [[NSMutableArray alloc] init]; for (unsigned i = 0; utfStringArray[i] != NULL; i++) { NSData *data = [NSData dataWithBytes:utfStringArray[i] length:strlen(utfStringArray[i])]; [array addObject:data]; }

Categories : Objective C

trying to get location from "network" provider fails on some devices despite the provider being enabled
Similar issues relating to the Android Network Provider have been reported before on Stack Overflow which you can find here. The consensus from those who have experienced this problem state that there are two possible workarounds, rebooting the device when the issue becomes apparent, or by utilizing the Google Play Service API for retrieving location data as there appears to be an issue with the reliability of the Location Manager with Android 4.0 or newer.

Categories : Java

Ask the user to enable GPS or network provider...illegalargumentexception provider==null
I found the solution I hope that can help the others this is the changes that I made if(locationManager==null) locationManager = (LocationManager) this.getSystemService(Context.LOCATION_SERVICE); try{ gps_enabled = locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER); }catch(Exception ex){} try{ network_enabled = locationManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER); }catch(Exception ex){} if(!gps_enabled && !network_enabled){ Builder dialog = new AlertDialog.Builder(this); dialog.setMessage("Activez l'un des ressources de localisation" ); dialog.setPositiveButton("Setting", new DialogInterface.OnClickListene

Categories : Android

Failed to find provider info for
Try using fully qualified path in android:authorities thereby replacing de.somename.provider with de.somename.provider.hvkContentProvider in so that it becomes as follows. <provider android:authorities="de.somename.provider.hvkContentProvider" android:enabled="true" android:multiprocess="true" android:name=".hvkContentProvider" android:exported="true" ></provider> You can refer this

Categories : Android

.Net 4.5 EventSource ETW provider not showing up in provider list
The EventSource implementation prevents you from specifying the channel even if you do modify the manifest. When writing an event to ETW you pass a descriptor block where in the channel id is specified. Unfortunately EventSource does not offer a way to set this through an attribute or otherwise and is always setting this to zero, meaning no channel is used. EventSource is behaving a bit differently from a normal ETW providers as it does not expose its manifest through a win32 resource but rather sends a "known" ETW event with the manifest as its payload. This is why perfmon is the only ETW enabled tool that recognizes* events send from .NET 4.5 EventSource. *You can always receive events using perfmon or other tools like it but they wont be able to decode the payload e.g. parameters pass

Categories : Dotnet

Firebird embedded in .net
The page you link to already answers your question. You should not add the embedded Firebird files as references, just as plain files (and make sure to enable copy to output directory): After we download it, we add 'FirebirdSql.Data.FirebirdClient .dll' as reference in our project. For embedded usage of firebird database we also need to download some dll files and add our project. Go , http://www.firebirdsql.org/en/server-packages/ and download embedded package. Add fbembed.dll icudt30.dll icuin30.dll icuuc30.dll in your project as file and set Copy To Output Directory property as Copy always So those dll files will always be copied to output directory.

Categories : Dotnet

Firebird and different versions of JVM
The short answer is: no you can't. You need to include the right bitness files for Firebird embedded in the root of your application, and as the libraries of the 32 bit and 64 bit versions of Firebird embedded have identical names, it is not possible to include them both. UPDATE To my shame (as a developer of Jaybird ;), I just found out it is actually possible to work with both 32 bit and 64 bit versions of embedded in one folder structure, but this requires that you are able to set the PATH environment variable before running your Java application (eg through a .bat, .cmd or a launcher). If you put the files in two folders, eg 64bit and 32bit, you should be able to use a batch file in the root of your application (I am assuming here that jaybird22.dll and jaybird22_x64.dll are also in

Categories : Java

Problems with IIS and Custom Membership Provider + Custom Role Provider
I have had the similar issue. After adding machineKey to web.config everything works all right. <system.web> <machineKey validationKey="2E417D4AC04F20FA6CE1CF1EFE23FBF1695BF6981B605B1B8628D2182C43D0B10E48C4A83FDCE0D1D6300095D9EE1B8746A37E2C3256554405983DCAA7622875" decryptionKey="FA6D35C22BF7E5E9E4438052B924CCC017521137C5EB017D07C7038B80C5F726" validation="SHA1" decryption="AES" /> </system.web>

Categories : Asp Net Mvc

How to map identity provider claim value to/from identity provider registered in Azure ACS?
I tried to do this last week and couldn't find a way to match the value in the claim to the value in IdentityProvider.js. I landed up looking for specific values. The only thing I can suggest is some resource/code that understands the mapping. I was just looking for a specific one and landed up doing something like this: return (HttpContext.User.Identity as System.Security.Claims.ClaimsIdentity).Claims .First(x => x.Type == "http://schemas.microsoft.com/accesscontrolservice/2010/07/claims/identityprovider").Value .Contains("Google") I searched high and low for the data, but couldn't find it. If you do, please submit an answer, I would also like to know

Categories : Azure

SQL Error = -804 (C# with firebird database)
I bet one of your TextBox.Text values has a comma in it... Otherwise: Did you check to see if you are specifying the right amount of columns? Basically, the SQL engine is complaining that you gave it a list of parameters and it is trying to fill those into the table Invoice_Name, except, it has too many values for the count of columns in that table. Try printing SQLCommandText to the output window (Debug.WriteLine(SQLCommandText)) and see if that is what you expect it to be... You should also not be doing it this way... check this post here: Inserting into DB with parameters safe from SQL injection?

Categories : C#

firebird - self join on one table
It could be done with a single select but algorithmic EXECUTE BLOCK would do much faster: EXECUTE BLOCK RETURNS (ACTION_1 INTEGER, ACTION_2 INTEGER, DURATION INTEGER) AS DECLARE VARIABLE act INTEGER; DECLARE VARIABLE act_id INTEGER; DECLARE VARIABLE d TIMESTAMP = NULL; DECLARE VARIABLE d1 TIMESTAMP = NULL; BEGIN FOR SELECT action, data, id_ppstartstoppoz FROM startstop ORDER BY data ASC INTO :act, :d, :act_id DO BEGIN IF (:act = 0) THEN BEGIN d1 = :d; action_1 = :act_id; END ELSE BEGIN IF (NOT :d1 IS NULL) THEN BEGIN action_2 = :act_id; duration = DATEDIFF(SECOND, :d1, :d); SUSPEND; d1 = NULL; END END END END

Categories : SQL

Configure IReport and Firebird
I am assuming that you actually have Firebird installed and your Firebird is running as a service. The user account running the Firebird service does not have access to your user profile and therefor is unable to open a database file in C:UserswaqasDesktopMOBILESTORE.fdb. Put the file in a location that is accessible to all users (or specifically to the user linked to the Firebird service), say C:Databases. That said, I would actually expect this scenario to result in an error almost immediately, so it might be a different problem. EDIT You indicate in the comments, that you receive a java.lang.ClassNotFoundException: org.firebirdsql.jdbc.FBDriver. This means that you did not add the Jaybird JDBC driver to the classpath of iReport. You can download the Jaybird (Firebird JDBC) driver fr

Categories : Java

Configure phpgrid with firebird
try this: I would build and test a ODBC connection for the firebird database (for windows have a look at this site to get an idea: http://web.synametrics.com/firebird.htm). the conf.php file would be something like this: define('PHPGRID_DB_HOSTNAME','hostname'); // hostname = your odbc connection name define('PHPGRID_DB_USERNAME', 'username'); // database user name define('PHPGRID_DB_PASSWORD', 'password'); // database password define('PHPGRID_DB_NAME', 'sampledb'); // database name define('PHPGRID_DB_TYPE', 'odbc'); // database type = odbc for "generic odbc" or try ibase define('PHPGRID_DB_CHARSET','utf8'); // OPTIONAL. Leave blank to use the default charset

Categories : PHP

Skip a loop with Firebird 2.5
If you want to skip an iteration through a loop without CONTINUE, then just use the inverse of the continue-condition for the rest of the block: While (v_counter <= :v_total) do begin If (NOT <condition>) then BEGIN ... END end

Categories : SQL

Java and Firebird Embedded how to set up?
look at the chapter 2 of this tutorial. You don't need to set any environment variable. just need firebird driver, defualt user name which is (sysdba) and password (masterkey). You can use flamerobin for the ease use of firebird.

Categories : Java

Powershell connect to firebird
Yes, powershell allows you to create .Net classes and call .Net methods. See here. So with little trouble you can convert your C# code to powershell.

Categories : Powershell

MAC homebrew php pdo firebird driver
Pdo Firebird from pecl is deprecated , i will updated it soon that i get access to it you need to download the source code for php extract it and then build only the pdo_firebird extension cd ext/pdo_firebird phpize ./configure (you might need to pass the firebird framework dir --with-pdo-firebird=/Library/Frameworks/Firebird.framework ) make sudo make install after that you need to copy the extension in your brew build php extensions folder and add it to php.ini extension=pdo_firebird.so I also recommend firebird 2.5.x is more recent and well supported on recent macosx versions

Categories : PHP

The token provider was unable to provide a security token . Token provider returned message: ACS50009: SWT token is invalid
Linesh, The above API is only applicable for use with the ACS service identity and symmetric key. Based on the error it is likely a change is needed to the following line of code: ServiceBusEnvironment.CreateServiceUri("https", <myServiceBusNameSpace>, string.Empty); Can you replace "https" with "sb" and give it a try?

Categories : Misc

Connect firebird database with codeigniter
I found the problem. My lampp wasn't able to use the interbase.so, which is necessary to run the firebird ( ibase_connect function ), so I instaled the apache2. Since I can get the "interbase.so", now I can connect just fine. Btw, I'm running on Ubuntu. Well, this is It. ^^

Categories : Database

why can't I connect python to firebird in ubuntu 12.04?
This is untested, but my suspicion is: The error says you cannot connect to 'localhost', which is a network name for the computer you are using. However, you ask Firebird to connect to '/tmp/test.fbd', which is a file system location. Basically, firebird thinks that the you want to connect to the file '/tmp/test.fbd' as if it were a server. Try: con = fdb.connect(host="localhost", database="/tmp/test.fdb", user="fernando", password="root") or con = fdb.connect(dsn="localhost:/tmp/test.fdb", user="fernando", password="root") Assuming of course, that /tmp/fest.fbd is actually on your localhost.

Categories : Python

How to check in Firebird if a datarow can be deleted?
You could try to use the autonomous transactions introduced in Firebird 2.5 to do the check, and simply rollback afterwards. However this will probably introduce a deadlock problem because the row will be 'modified' by a different transaction than the parent transaction. Ask yourself: why bother. Just try to delete and give the user a message if deletion wasn't possible.

Categories : SQL

SQL Firebird implementation in java/ IBSQL
The error suggests there is an ON in an unexpected place in your query, and as the query itself looks fine, my guess is the problem is with the way you construct the query in your Java application. There might be some whitespace missing in your query. My guess is that you have something like query = "SELECT * " + "FROM table1" + "JOIN table2 ON " //..... The missing whitespace will make the SQL: SELECT * FROM table1JOIN table2 ON .... For the parser, this is perfectly valid until it encounters the ON token, which triggers the error. Eg the parser identifies it is a SELECT with * (all) columns from table1JOIN with alias table2. During parsing the server doesn't check if the table actually exists, so it doesn't trip over the fact that table1JOIN doesn't exist. That is

Categories : Java

Error creating trigger in Firebird
Each command in isql must end with terminator symbol - by default thats a ; but since that is also used inside trigger's body as statement terminator you need to change the terminator character to something else using the SET TERM command. To change the terminator to ^ your script would be SET TERM ^ ; CREATE TRIGGER test_trig FOR test AFTER INSERT AS BEGIN POST_EVENT 'test_inserted'; END^ SET TERM ; ^

Categories : Database

Firebird 1.5 : Compare Blob using Java
If you look at Firebird 1.5 error codes, the error code you have been given is a badblk (Bad block) meaning that your byte[] is likely to be the wrong size/form and cannot be read correctly as a ByteArrayInputStream but that is dependent on getBLOB_Content() Also shouldn't the parameter index for your query be 1, not 0?

Categories : Java

Embeded Firebird Database and Hibernate
It seems the step I was missing was creating the database file manually: FBManager manager = new FBManager(GDSType.getType("EMBEDDED")); manager.start(); manager.createDatabase(myDbFile, username, password); manager.stop();

Categories : Java

Locking tables firebird, delphi
Firebird is versioning engine and locking there is innatural thing. The engine, the libraries - they all were optimized to avoid locking. I suggest you take few steps back and looking at the picture in a large scale. You better formulate your task in term of applications behavior and then think how to modify their behavior towards the database to get what you need. And pleease! give applications some name. It is very hard to think and plan in terms "this app" and "other app" - yuyou just inevitably start mixing them. In Firebird you can lock the single row so to lock the table you should make a table consisting of the single row), but even this behavior would be problematic and can only be checked by other application trying to change the same record and commit the change. OldSchool var

Categories : Delphi

Using view firebird with filter by role
Use the CURRENT_ROLE context variable: CREATE OR ALTER VIEW HR_PROJECTS_VIEW( ... where P.ROLE = CURRENT_ROLE;

Categories : Delphi

Firebird: How to order a list aggregate?
As the documentation of LIST() states: The ordering of the list values is undefined. That said, if you use a subquery or common table expression (CTE) that first orders by the GROUP BY-columns and this column then it will work, however this does mean that you are depending on an implementation artefact which might change with point releases or new versions. There is an improvement ticket (CORE-2332) in the Firebird tracker for this, but it hasn't been planned for a version. This ticket also contains an example of the workaround: WITH EDU_EPT AS ( SELECT EEPT2.TARGET_SWE FROM EDUCATION_EVENT_PR_TRGT EEPT2 WHERE EEPT2.EDUCATION_EVENT_ID = :EDU_EVENT_ID ORDER BY EEPT2.ORDINAL, EEPT2.ID ) SELECT LIST('• ' || EEPT.TARGET_SWE, ASCII_CHAR(13) || ASCII_CHAR(10)) || '.' FROM EDU_E

Categories : SQL

jQuery.support.ajax returns true even if XMLHTTP support is disabled
According to this Microsoft page, the IE8 setting only disables the W3C standard XMLHttpRequest object. It leaves the ActiveX Microsoft.XMLHTTP control enabled. There is a separate setting to disable (all) ActiveX controls. The jQuery support.ajax test works for both methods, so disabling the former but leaving the latter enabled will return true.

Categories : Javascript

support lib android.support.v7.widget.GridLayout causes InflateException / ClassNotFoundException with app widgets
When making widgets, you are constrained to the Views that implement the RemoteViews mechanism. The way that mechanism works is that the remote, "host" process is the one doing the actual inflating. Therefore, if that remote process (the launcher that hosts the widget) does not have the GridLayout class in its classpath, there is absolutely no way you can do this short of drawing the View in your own process and setting it as a Bitmap on an ImageView. I wouldn't do that, though. In general, when making widgets, constrain yourself to the Views that come with the framework.

Categories : Android



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