environment.specialfolder returns OneDrive in path but OneDrive not enabled

Uncategorized
Question: I am using Environment.GetFolderPath(Environment.SpecialFolder.Personal); to open a file in "usersusernamesaved games" (for example) but when deployed I see OneDrive substituted after username and I do not know how to stop that on systems that have OneDrive hidden. I read where one can set FileDialog.AutoUpgradeEnabled=False to stop dialog box widget from using OneDrive but I don't see the equivalent here. I used grpedit to stop OneDrive service on my surface pro as I didnt want it. I did not uninstall or delete OneDrive. The development system (VS 15) also has OneDrive turned off and I can run the program just fine there. It is the deployed program on my surface pro that keeps trying to open my data files through OneDrive. Unless there is a way to code this correctly…
Read More

How to convert structured python list to xml

xml
Question: I would like to know how can i convert in an easy way a structured python list to xml and store it as xml file? I could skip the lines with the 'None' inside:[ ['None', None, None, None, None, None, 'False', 'None', 'None'], ... ['None', None, None, None, None, None, 'False', 'None', 'None'] ] This is how my structured list looks like:[ [ 'This is the first case', 'CASE001', 'Linux', '2017-08-18 06:45:58', '2017-08-18 06:46:47', '55', 'Pass', [], [ ['None', None, None, None, None, None, 'False', 'None', 'None'], ... ['None', None, None, None, None, None, 'False', 'None', 'None'] ] ], [ 'This is the second case', 'CASE002', 'Linux', '2017-08-18 07:45:58', '2017-08-18 07:46:47', '65', 'Pass', [], [ ['None', None, None, None, None, None, 'False', 'None', 'None'], ... ['None', None, None, None,…
Read More

Proguard leads to crash

Uncategorized
Question: When setting minifyEnabled true useProguard true in my gradle I get a NullPointerException like this :java.lang.RuntimeException: Unable to start activity ComponentInfo{com.jafari.farhad.ubazdidcontroller/com.jafari.farhad.ubazdidcontroller.LoginActivity}: java.lang.NullPointerException at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2180) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230) at android.app.ActivityThread.access$600(ActivityThread.java:141) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:137) at android.app.ActivityThread.main(ActivityThread.java:5041) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:511) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560) at dalvik.system.NativeStart.main(Native Method) Caused by: java.lang.NullPointerException at com.jafari.farhad.ubazdidcontroller.LoginActivity.onCreate(Unknown Source) at android.app.Activity.performCreate(Activity.java:5104) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230) at android.app.ActivityThread.access$600(ActivityThread.java:141) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:137) at android.app.ActivityThread.main(ActivityThread.java:5041) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:511) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560) at dalvik.system.NativeStart.main(Native Method) Gradle is :buildTypes { debug { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } release { minifyEnabled true useProguard true proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } While reading through StackOverflow I found some settings for the proguard-rules.pro file like this:-dontusemixedcaseclassnames -dontskipnonpubliclibraryclasses -verbose -dontoptimize -dontpreverify -keepattributes *Annotation* -keep public…
Read More

Apache Hive – Complex DataType Map not working

Uncategorized
Question: Hive Version 2.1.1 Problem Description: collection items terminated values are inserted as Map Keys Hive Table:CREATE TABLE profiles( id int, name struct, phone struct, address map ) ROW FORMAT DELIMITED FIELDS TERMINATED BY ',' COLLECTION ITEMS TERMINATED BY '-' MAP KEYS TERMINATED BY '=' LINES TERMINATED BY 'n' STORED AS TEXTFILE; Data: 1000,Suresh--S,1234567890-1234567890,home=Venkatapuram1-2020-500001 1001,Mahesh-X-M,1234567890-1234567890,home=Venkatapuram2-2021-500001 Data Load: load data inpath '/handson/profiles_data.txt' overwrite into table profiles; Select * from profiles; Actual from select statement: 1000 {"first_name":"Suresh","middle_name":"","last_name":"S"} {"home":"1234567890","office":"1234567890"} {"home":{"streat":"Venkatapuram1","appartment":null,"zip":null},"2020":null, "500001": null} 1001 {"first_name":"Mahesh","middle_name":"X","last_name":"M"} {"home":"1234567890","office":"1234567890"} {"home":{"streat":"Venkatapuram2","appartment":null,"zip":null},"2021":null, "500001": null} Expected: 1000 {"first_name":"Suresh","middle_name":"","last_name":"S"} {"home":"1234567890","office":"1234567890"} {"home":{"streat":"Venkatapuram1","appartment":2020,"zip":"500001"}} 1001 {"first_name":"Mahesh","middle_name":"X","last_name":"M"} {"home":"1234567890","office":"1234567890"} {"home":{"streat":"Venkatapuram2","appartment":2021,"zip":"500001"}} Answer: Read more
Read More

Crystal Report Exporting to Excel header Issues on Cross Tab

Uncategorized
Question: Attached is my report image in design mode. I am new to Crystal Report I have a survey type requirement in which i have many question which come in header for a single participant instead on multiple rows for a single participant. For this requirement i have created cross tab, data is coming fine but the problem is that when i add additional text fields as headers (as mention in image) in cross tab, the header will come on the last line when exporting to EXCEL (data only). Excel screen shot is also attached. Can anyone help me in this matter. Answer: Read more
Read More

How to Create Slidable Flexboxes like Google Play App Lists?

javascript
Question: [Google Play slidable flexboxes](https://i.stack.imgur.com/mRlJR.jpg) (Need at least 10 reputation to post images.) It is a list of slidable flexboxes that is normally seen on Google Play store. It is list of flexboxes (apps) slidable to left from right manually! There are some sites(9apps) who already have created the same slidable flexboxes like Google Play store! So, it is now certain that it can be created by using HTML, JavaScript & CSS! I have tried to find out the codes to create the same slidable flexboxes in Google Search, but unfortunately they were not satisfying to me as they were not same. So, how can I create the almost same slidable flexboxes like Google Play store app lists? Answer: Read more
Read More

Select radio button from external URL

javascript
Question: How do you select a radio button using external link such as /page.html#item1 or /page.html?item1 so that when the page loads it's already selected Any method will do, javascript or jquery Answer: Simple way to check radio button on window load. Consider your url to be of form - scheme://example.com/myproject/abc.php?id=2 After running below code snippet you will encounter an error so try it on your site it requires url inorder to work. $(window).on('load', function() { let prepend = 'item-'; let url = window.location.href; let keyVal = url.split('?')[1].split('=')[1]; let id = prepend + keyVal; let elem = 'input[type=radio]'; $(elem).each(function(i) { if ($(this).prop('id') === id) $(this).prop('checked', true); }); }); Run code snippetHide results Expand snippet Hope, this works for you..!! :) :) Read more
Read More

MvvmCross and Xamarin Forms, Android app crashes with null reference error when getting accent color

Uncategorized
Question: I've created a simple Xamarin Forms app with MvvmCross to try and figure out an error I'm having on another project. This simple app is available here: https://github.com/selaromdotnet/XamFormsAppTest It has a single page with a toolbar item that has an icon on it. If you look at the commit history, this project loads just fine and the icon does too. But in the most recent commit, I followed this guide here (https://blog.xamarin.com/material-design-for-your-xamarin-forms-android-apps/) and this post here (Xamarin.Forms null reference exception when applying Material Theme) to update the project to use MvvmCross with Material design. Now on the android app, the OnCreate method for the MvxFormsAppCompatActivity it crashes with this error: 08-14 23:51:05.939 I/MonoDroid( 1988): System.NullReferenceException: Object reference not set to an instance of an object. 08-14 23:51:05.939 I/MonoDroid( 1988):…
Read More