w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
When using NotSupportedException is bad?
You are right, this is not a good idea to throw NotSupportedException in a situation like that. Normally, you implement an interface is to provide a common set of operations that "unifies" a group of dissimilar classes providing different implementations for a set of common operations. However, in your case the dissimilar classes fail to "unify": they retain not only their own implementations, but also their own interfaces. When you try using them uniformly, the code throws an exception. The common interface does not give you all that much compared to keeping them as object - users must know what class is behind the IString before making the call, otherwise they risk seeing a NotSupportedException. There are several ways around this problem: one way would be unifying the singular and the

Categories : C#

NotSupportedException when inserting with Dapper
Indeed, there is no inbuilt handling of Uri. Just use your chosen Uri-to-string representation (there are several and they behave differently) - for example: ... OutlineUri = fogbugzCase.OutlineUri.OriginalString ... This is something that perhaps we could do automatically - but simply it has never come up as a request.

Categories : C#

What is the closest alternative to the .Net NotSupportedException in C++
The standard gives you namespace std { class logic_error; class domain_error; class invalid_argument; class length_error; class out_of_range; class runtime_error; class range_error; class overflow_error; class underflow_error; } As Jerry said runtime_error is the best match of those, so derive from that.

Categories : C++

'System.NotSupportedException' web api from Windows Phone 8
My bad, I did it a different way anyway. public async void GetProducts() { UriBuilder fullUri = new UriBuilder(baseUri + "productapi"); fullUri.Query = ""; HttpClient c = new HttpClient(); c.BaseAddress = fullUri.Uri; var response = await c.GetAsync(c.BaseAddress, HttpCompletionOption.ResponseContentRead); if (response.IsSuccessStatusCode) { DataContractJsonSerializer ser = new DataContractJsonSerializer(typeof(Product)); String str = await response.Content.ReadAsStringAsync(); dynamic[] Objects = JsonConvert.DeserializeObject<Object[]>(str); Products.Clear(); foreach (dynamic ob in Objects) { //do something }

Categories : Asp Net

ASP.NET .ASHX image generation. NotSupportedException
Couple of suggestions: Rather than calling explicit dispose, you should wrap the use of img and graphics in a Using block. You should flush and close the response stream to ensure the image is done being used before it is disposed. Public Sub ProcessRequest(ByVal context As System.Web.HttpContext) Implements IHttpHandler.ProcessRequest Dim js As New JavaScriptSerializer Dim ai As absencestruct = js.Deserialize(Of absencestruct)(CStr(context.Request.QueryString.Item("json"))) 'Ensure font is readable (half height of block or 12px whichever is smaller) Dim f As Font = New Font("Calibri", Math.Min(CInt(CDbl(ai.size.height) / 2.5), 12), GraphicsUnit.Pixel) Using img As New Bitmap(CInt(ai.size.width), CInt(ai.size.height)) Using g As Graphics = Graphics.FromImag

Categories : Asp Net

during update query it throws NotSupportedException?
Regarding your NotSupportedException issue - I suspect that your model is missing the PrimaryKey attribute: public class MyModel { [PrimaryKey, AutoIncrement] public int Id { get; set; } public int Tag { get; set; } public string Foo { get; set; } } You will need the attribute(s) above, even if your db schema already has them defined. At this time, Sqlite-Net does not read schema data from the db. Some other thoughts: Firstly, you should use only either the synchronous Sqlite-Net API, or the async API. Don't use both. I personally prefer the synchronous API, as it appears to be more up to date. The async API has not been updated in 11 months, whereas the synchronous API was updated 4 months ago. Besides this I never was able to figure out how to do transacti

Categories : C#

Error on Linq To Entities method contains NotSupportedException
From what I have learned it looks like LINQ support in this scenario is limited, though I still do not know why contains does not work on a DataServiceQuery. The MSDN documentation suggests it is supported. Queries to the DataServiceContext resolve urls in OData format: http://services.odata.org/OData/OData.svc/Category(1)/Products?$top=2&$orderby=name The solution I used - adding a WCF Data Service operation/method: [WebGet] public IQueryable<Thing> GetThingsByID(string ids) { return CurrentDataSource.Things.Where(x => ids.Contains(x.ThingID.ToString())).AsQueryable(); } The above should allow me to filter: WCF Data Service operations Calling Service Operations I pass in ids as CSVs as only primitive data types may be passed as parameters Note

Categories : C#

ASP.NET MVC3: System.NotSupportedException: Specified method is not supported
You happen to have a query that results in the DbApplyExpression node in the command tree. This node is typically translated to CROSS/OUTER APPLY construct in SQL however MySQL does not support CROSS/OUTER APPLY. Most likely you will have to change your query a little bit to avoid the CROSS/OUTER APPLY. Take a look a this msdn article for more details. I also found something at DevArt website that can be helpful

Categories : Asp Net Mvc

System.NotSupportedException' while trying to move a ObservableCollection item in WP8
The control is bound to a Listbox. I found a work around. I'm not sure if its the right method. I created a temporary OC, did the move function and then reassigned it back to the old OC. Then updated the ListBox. PageCollection completedItem = fe.DataContext as PageCollection; int fileNoCompleted = completedItem.FileNo; if (completedItem.CompletionStatus == false) { int position = 0; for (int i = PageCollectionObservableCollection.Count - 1; i > -1; i--) { if (PageCollectionObservableCollection.ElementAt(i).CompletionStatus == false) { position = i; break; } } completedItem.CompletionStatus = true; completedItem.Color = Colors.Green; completionStatus

Categories : Windows Phone 8

Dynamically building query for EF4 using expression trees, NotSupportedException
To construct the specific query you're working with, try the following: private static IQueryable<Customer> GetQuery2(NorthEntities context) { IQueryable<Customer> customers = context.Customers; var custParam = Expression.Parameter(typeof(Customer), "c"); var companyNamePropValue = Expression.Property(custParam, typeof(Customer).GetProperty("CompanyName")); var containsParameter = Expression.Constant("z"); var containsCall = Expression.Call(companyNamePropValue, typeof(string).GetMethod("Contains"), containsParameter); var wherePredicate = Expression.Lambda<Func<Customer, bool>>(containsCall, custParam); return customers.Where(wherePredicate); } In general, to get access to the LINQ extension methods (e. g. Where), you'll have to look

Categories : C#

LINQ to Entities : "select new" expression tree throws System.NotSupportedException
Looking through Dynamic LINQ code I found the problem. Ethan's solution does this: source.Provider.CreateQuery( Expression.Call( typeof(Queryable), "Select", new Type[] { source.ElementType, dynamicType }, Expression.Constant(source), selector)); And inside Dynamic.cs of Dynamic LINQ they do this: source.Provider.CreateQuery( Expression.Call( typeof(Queryable), "Select", new Type[] { source.ElementType, lambda.Body.Type }, source.Expression, Expression.Quote(lambda))); The relevant change is in the 4th parameter of the call to Expression.Call.

Categories : C#

Randomly seeing System.NotSupportedException: http in WebRequest.GetCreator(string prefix)
I saw this in some of the earlier versions of Mono 2.10 (a couple of years ago actually), and helped tracking it down (but I haven't seen it for some time now). If my memory doesn't fail me it was a race condition in either ASP.Net's startup path or a bug in the synchronization primitives ASP.Net was using. It was fairly tricky to track it down, it only happened on the production server (of course) and only sporadically. In my case it only happened after an ASP.Net restart. I had bots connecting periodically to a server, and if the server had been down for some time there would be many bots anxiously pounding the server once it got back, apparently making the race condition easier to trigger. In order to narrow it down I built Mono from source and added Console.WriteLine statements. Af

Categories : C#

NotSupportedException: Data binding directly to a store query (DbSet, DbQuery, DbSqlQuery)
As explained in the other post you cannot databind directly to DbSet which is what you are attempting to do. Instead you need to get a create a local collection and populate it with the results of a query. Here is a very good tutorial. And an example of the view model you can start with: using System.Collections.ObjectModel; namespace TryingWPFWithUltimate { class ViewModel:INotifyPropertyChanged { private DatabaseContext _databaseContext; public ViewModel() { _databaseContext = new DatabaseContext(); Schools = new ObservableCollection<School>(_databaseContext.Schools); } public ObservableCollection<School> Schools { get; set; } } } And the binding: <ComboBox ItemsSource="{Binding Path=

Categories : C#

NotSupportedException thrown in EndGetResponse(request.BeginGetResponse(null, null)))
don´t you need to wait until BeginGetResponse is finished before you call EndGetResponse? That could cause the NotSupportedException. Further I came along a similar problem. There was a NotSupportedException thrown when I tried to call BeginGetResponse with a callback of null. I get around this issue by just defining this (a)=>{} as the callback. (That was silverlight) Regards Christoph

Categories : C#

Cause of System.NotSupportedException when converting a normal class to a web-service class
Regardless of service technology (I started with asmx and moved to WCF) IDictionary is not a viable thing to return through a service interface especially if your endpoint is SOAP or http based. Objects in or out through the service interface have to be serializable, which IDictionary is not.

Categories : C#

Not showing my mobile device in eclipse but show in Window 8 (portable device part)
Download usb driver for samsung from here : http://developer.samsung.com/android/tools-sdks/Samsung-Andorid-USB-Driver-for-Windows

Categories : Android

iOS Project runs on simulator, physical device, but can't build or archive anymore for "iOS Device"
After this happening a few times, I figured out the issue. When my iPhone is hooked up to my Mac and tethering is on, this problem occurs. When I turn tethering off, or disconnect the phone, I can archive again. Not sure why this, but I hope it helps someone at some point.

Categories : Iphone

why doesn't MPMoviePlayerController play in simulator but not in device if the format is valid for the device?
Solved! I am forcing it playing even if the mute is on, moviePlayer.useApplicationAudioSession = NO; [self presentMoviePlayerViewControllerAnimated:moviePlayer]; that's what itunes store does if the mute is on for the preview songs when you tap it

Categories : Iphone

how to use the same image of 160ppi and 1280X800 ressolution device in 800X1280 and 214ppi device
1280 x 800 160ppi is MDPI devices 800 x 1280 214PPi us TVDPI devices //you need to supply different density Images like MDPI and HDPI images TVDPI devices will pick from HDPI image and auto scale them //you can also supply different drawable for large and xlarge drawables.

Categories : Android

Trying to retrieve previously paired bluetooth device in IOS app will not respond with failure if device is off
Two points you need to know about retrievePeripherals: and connectPeripheral: 1.) retrievePeripherals: attempts to retrieve the CBPeripheral object associated with the uuid you supply. Even if the ble device is off (or on the other side of the country) retrievePeripherals: will still return an instance of CBPeripheral that you can call connectPeripheral: on. This is done intentionally so that you can issue a call to a peripheral that is not even around and still automatically connect to it when it comes back into range. It basically creates a marker inside the system bluetooth so that when the device is actually seen, it will know it should connect to it. 2.)connectPeripheral: will not time out unless the communication channel is broken with the actual device. If the iOS device has not s

Categories : IOS

The method "device.press" or "device.touch" of MonkeyRunner doesn't take effect
You could try to replace 'DOWN_AND_UP' with MonkeyDevice.DOWN_AND_UP. And you could also add some MonkeyRunner.sleep(time_in_seconds) to pause the script between the interactions. To test if the device object was properly created you could use device.wake() which lights up the device's display. If this works, the touch and press methods should work also.

Categories : Android

Sending image (.jpg) byte data to an iOS device from a .NET web service, then on the iOS device, encoding it to its respective file type (.jpg)
Been there, but on the iOS end. What we did to solve this problem was to have the .NET server send the image as a base64 encoded string, just as you said. In the iOS end, the dev must then use a base64 decoding class (there are plenty on the internet, this one for example: http://www.imthi.com/wp-content/uploads/2010/08/base64.zip), transform that into NSData and then create the image with that data. Should look something like this: NSString *b64string = @"string to decode"; NSData *imgData = [DecoderClass decodeBase64FromString:b64String]; UIImage *image = [UIImage imageWithData:imgData]; If the data is correct, it should work. UIImage is a high-level class and should handle image types (jpg, png, etc) automatically, as long as the data is consistent.

Categories : C#

how to record the voice from bluetooth device mic and play in device speaker
yes above concept is correct and very helpful for me(but there is little bit addition or modification done) but routing to speaker(device-speaker)required new session to create for taking input from Bluetooth we have create session like //// create and set up the audio session AVAudioSession* audioSession = [AVAudioSession sharedInstance]; [audioSession setDelegate:self]; [audioSession setCategory: AVAudioSessionCategoryRecord error: nil]; [audioSession setActive: YES error: nil]; // set up for bluetooth microphone input UInt32 allowBluetoothInput = 1; AudioSessionSetProperty (kAudioSessionProperty_OverrideCategoryEnableBluetoothInput,sizeof (allowBluetoothInput),&allowBluetoothInput); and when ever u want to paly the sound not in bluetoothdevice speaker at that time override

Categories : Iphone

Using the accelerometer in a Windows Phone 8 device to determine if device is not moving
From my point of view, it really depends where do you want to use your app. If it is an outdoor application then as Igrali mentioned using GPS would be a better option. However, if you are still sure that you want to use accelerometer one way that I tried before was save last few results of the accelerometer every time then check them with previous results. if the result was same it means the system is stopped otherwise it is moving. That may not be a good way but it works.

Categories : Windows Phone 8

How can i Write data from Android device on c2540c device?
Might this solve your problem?

Categories : Android

How to connect Android device to an iOS device over BLE (Bluetooth Low Energy)
I've written a simple working example, well relatively simple, and included it open-source on Github: https://github.com/GitGarage. So far it has only been tested with an Android Nexus 9 and an iPhone 5s, but I presume it would also work with a Nexus 6 and various iPhone types. So far it is set up explicitly to communicate between one Android and one iPhone, but I presume it is tweakable to do much more.

Categories : Android

How can i create new virtual mouse device on my android device?
From what i see you should create your own virtual device with your own driver , Fortunately there is an easy way to do so using uinput There is an easy guide for getting started here , and this question can be a good guide to write your own virtual driver. I thought this can only be done if you have access to kernel , and create your own ( i dont think modifying user rom is a good solution ) , but after reading this , it is clear that Uinput can run in user mode. Note : I agree with recommendition to use touch events ; as this solution is more common and makes sense , check second suggestion is this answer

Categories : Android

Changing device orientation settings by Device in Rubymotion
You won't be able to do that in your Rakefile, as far as I know. You need to specify that you provide both orientations and then programmatically tell iOS whether an orientation is supported or not. Your UIViewControllers and/or UINavigationController(s) should look like this: def ipad? NSBundle.mainBundle.infoDictionary["UIDeviceFamily"].include?("2") end def shouldAutorotate false # I think? end def supportedInterfaceOrientations if ipad? UIInterfaceOrientationMaskLandscapeLeft | UIInterfaceOrientationMaskLandscapeRight else UIInterfaceOrientationMaskPortrait end end def preferredInterfaceOrientationForPresentation ipad? ? UIInterfaceOrientationMaskLandscapeLeft : UIInterfaceOrientationMaskPortrait end Haven't tested this code, but I've used similar in th

Categories : IOS

Android Device device shows Unknown (?????) in eclipse
You need to add vendor ID to android.rules file. Please follow this link to know about particular vendor id & how to do this. http://developer.android.com/tools/device.html

Categories : Android

How to track the device location (iOS and Android) device using Phonegap
The first thing to say is that creating a Phonegap app that receives location updates while running in the background is entirely possible, but not trivial. I've done it myself and released apps on both the Android and iOS platforms. If you need accurate and regular position updates, I'd suggest using the GPS receiver on the target devices. In Phonegap, you can do this setting the "highAccuracy" flag when requesting position updates. The watchPosition() function will deliver new position information as and when the device receives updates from the GPS receiver, so you use it something like this: navigator.geolocation.watchPosition(successCallback, errorCallback, { enableHighAccuracy: true, timeout: 10000, maximumAge: 0 }); See the Phonegap geolocation API documentation for more d

Categories : Android

WP7 app, MethodAccessException on WP7 device but works fine on WP8 device
Try this private Uri GetFacebookLoginUrl(string appId, string extendedPermissions) { var fb = FacebookClient(); var parameters = new Dictionary<string, object>(); parameters["client_id"] = appId; parameters["redirect_uri"] = "https://www.facebook.com/connect/login_success.html"; parameters["response_type"] = "token"; parameters["display"] = "touch"; // add the 'scope' only if we have extendedPermissions. if (!string.IsNullOrEmpty(extendedPermissions)) { // A comma-delimited list of permissions parameters["scope"] = extendedPermissions; } return _fb.GetLoginUrl(parameters); } You Need to Give App ExtendedPermissions private const string ExtendedPermission

Categories : C#

C# detect usb device ClassCode (usb device type)
You can download USB View Source as a starting point. This loops through all USB devices on a PC (C#) and pulls information about each. To get the Class code, Subclass code, and Protocol type fields, you'll need to modify it slightly. Change the below and run it and you'll get the information on each USB device by clicking on the item in the tree view (information will appear in the right panel). Modifications to USB.cs: // Add the following properties to the USBDevice class // Leave everything else as is public byte DeviceClass { get { return DeviceDescriptor.bDeviceClass; } } public byte DeviceSubClass { get { return DeviceDescriptor.bDeviceSubClass; } } public byte DeviceProtocol { get { return DeviceDescriptor.bDeviceProtocol; } } Modifications to fmMain.cs // Add th

Categories : C#

What will registering an apple device a developer device do to it?
Yes you can still use it as a regular device. All registering does is enable the Developer section in Settings, allow you to install iOS beta releases, debug builds directly from Xcode, and ad hoc app builds. Also to elaborate on the Developer section in the Settings app, as of iOS 6 and above, that gives you access to the network link conditioner so you can simulate for instance 3G or EDGE speeds when on Wifi. Very useful.

Categories : IOS

What is difference between android device id and device token?
Both are completely different. Secure.ANDROID_ID A 64-bit number (as a hex string) that is randomly generated on the device's first boot and should remain constant for the lifetime of the device. (The value may change if a factory reset is performed on the device.) And GCMRegistrar.register(this.context, CommonUtilities.SENDER_ID); Gives you the registartion id of device from GCM. By which, GCM uniquely identifies the device. Another difference is Secure.ANDROID_ID may change when factory reset is performed on the device. And Registration id gets changes periodically. And if you are asking about CommonUtilities.SENDER_ID then This is your project number, and it will be used later on as the GCM sender ID

Categories : Android

Device not Recognize AVD Device on Usb Debugging
I also faced the same problem for a Samsung device.I installed the required Samsung Kies and USB drivers but still it doesn't show in the AVD chooser screen. So I downloaded a driver installer software.After installing that, it showed that a updated version of Samsung Kies is available then I updated it and everything worked fine.You can download that software from here

Categories : Android

Using GCM for device to device app data sync
you dont necessarily need to use GCM or any messaging service, all gcm is meant to do is notify a device that something has changed on your server and that you need to go get all the new stuff. that being said all you need to do is just have a sync button that the user can manually sync the list from the server to the device and vice versa which would get rid of the need for GCM. if you wanted automatic syncing then GCM or any other messaging service would be what you want

Categories : Android

How to update the view of an app on ios device b from device a
when the application is open, is there a way for when the admin application to be notified straight away as soon as a sale has been made There are ways. One way is to open a connection to the server and keep it open, so that the server can write to it whenever it has new information to share. Another way is to implement a tiny web server in your app, tell your data server about it, and let the data server connect to it as necessary. If the server and the admin device are expected to be on the same network, you might be able to use Bonjour to make it easy for the server to discover and connect to the admin device. The nice thing about APNS is that it lets you avoid constant use of the network. Whether you keep an open connection to a server or have your app listen for connections

Categories : Objective C

How to create an event# device for a virtual input device (/dev/input/js3) in linux kernel module?
Here is an example, you can use 1. class_create to create the class specified for the device, 2. device_create to create the device node 3. cdev_init to initialize and 4. cdev_add to add the device to the /dev list For example you can refer the below link :Create a device node in kernel module

Categories : Linux

navigator.connection.type not working even if device is ready *or* device is never ready
You should also wait until all your scripts are loaded. Wrap everything in a onBodyLoad like so: function onBodyLoad() { // these are useful later in the app, might as well set early window.isRipple = (window.tinyHippos != null); window.isPhoneGap = /^file:/{3}[^/]/i.test(window.location.href); window.isIOS = !window.isRipple && navigator.userAgent.match(/(ios|iphone|ipod|ipad)/gi) != null; window.isAndroid = !window.isRipple && navigator.userAgent.match(/(android)/gi) != null; // stuff I use for debugging in chrome if (window.isPhoneGap) { document.addEventListener("deviceready", onDeviceReady, false); } else { onDeviceReady(); } } And add to your body tag: <body onload="onBodyLoad()"> And the rest of my co

Categories : Networking

Why am I getting a runtime error / key error "no device found for" empty device address?
It looks like your BladeRF is only accessible by the root user. To fix this make a udev rule file (I know the write up you followed earlier had you do something similar but bare with me). This will allow your regular user account to access it. You can start in the shell by typing: $ sudo nano /etc/udev/rules.d/15-bladerf This should make a new file and open the nano editor. Here you will place the following: SUBSYSTEM=="usb", SYSFS{idVendor}=="1d50", SYSFS{idProduct}=="6066", MODE="0666" Afterwards, reset the udev rules service by executing: $ sudo /etc/init.d/udev restart NOTE: This commands should work on any Debian-based OS (Debian, Ubuntu, Linux Mint,...) CREDIT: The udev rules were found here http://pastebin.com/Mgb90L1x

Categories : Linux



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