Issue on make the code compliant for sonar rule S1451 for C#

c#
Question: I am using the sonar (v5.6.6) and c# plugin (v6.3)for code analysis. After sonar analysis execution. My C# Code violated rule S1451 (Rule Name: Track lack of copyright and license headers). I tried many of the copyright formats, but no luck all fails to compliant with this rule. How to make the code to compliant with rule S1451? Answer: S1451 is configured with the required/desired header. The easiest thing to do would be to look at the configuration of the rule in the profile that's being applied & copy/paste the configured header into your file. Read more
Read More

Set a title for inflated view activity

Uncategorized
Question: My activity screenshot having red highlight area where i want to set title I inflated a view in my activity.I want to set a title for it, setTitle and label tag in manifest is not working i have tried like thousand times. How to set title in highlighted area of screenshot my code for this is below FrameLayout frameLayout = (FrameLayout) findViewById(R.id.frameHome); LayoutInflater layoutInflater = (LayoutInflater) getSystemService(LAYOUT_INFLATER_SERVICE); View inflate = layoutInflater.inflate(R.layout.activity_main, null, true); frameLayout.addView(inflate); Answer: If you want to set a title at the right corner of your app bar, you can put a TextView in the Toolbar. Add this Toolbar in your Activity layout at the top: activity_main.xml Read more
Read More

QEMU arm permanent storage

Uncategorized
Question: I use QEMU with an arm linux kernel. The changes such as new folders and files are gone when the guest is rebooted. I could not find a way to make them permanent. These are the files :-r-xr-xr-x 1 root root 197120 Ağu 14 17:45 disk.img -rwxrwxrwx 1 root root 57424384 Ağu 14 13:28 rootfs.cpio -rwxrwxrwx 1 root root 62914560 Ağu 14 13:28 rootfs.ext2 -rwxrwxrwx 1 root root 11863 Ağu 14 13:28 vexpress-v2p-ca9.dtb -rwxrwxrwx 1 root root 29247264 Ağu 14 13:28 zImage This is the running of QEMU:C:Program Filesqemu>qemu-system-arm -M vexpress-a9 -kernel zImage -serial COM1 --nographic -hda disk.img This is the result of df call at guest Filesystem 1K-blocks Used Available Use% Mounted on devtmpfs 34324 0 34324 0% /dev tmpfs 62460 0 62460 0% /dev/shm tmpfs 62460 24…
Read More

How to remove only bottom border on specified row in html table

Uncategorized
Question: I have simple html table on which I want to remove bottom border of tr on specific row. The table Title Title 2 Title 3 Title 4 Test Entry Test Entry Test Entry Test Entry Test Entry Test Entry Test Entry Test Entry Test Entry Test Entry Test Entry Test Entry What I've tried is to add class to the tr which I want to be without bottom border class="no-bottom-border" and with css to remove it tr .no-bottom-border {border-bottom: none} This doesn't seems to work. Here is the JSFIDDLE with the table Answer: Target the borders of td, because tr has no border properties. Demo table, caption, tbody, tfoot, thead, tr, th, td { margin: 0; padding: 0; border: 0; font-size: 100%; vertical-align: baseline; background: transparent; } table {…
Read More

Detecting the change on the certain column in the history table

Uncategorized
Question: Consider the following data:history.data ======================================= id |data_id| col1 | col2 | date ---+-------+-------+-------+----------- 1 |1 | 123 | 321 | 2017-08-01 2 |1 | 124 | 321 | 2017-08-03 3 |2 | 222 | 555 | 2017-08-05 4 |2 | 242 | 555 | 2017-08-07 5 |2 | 242 | 333 | 2017-08-11 So this is the history_data table where I keep all the changes in a certain table. Right now I need to get the date of the last change for every present entry of data in the col1 column. In that case desired output should be data_id | date --------+----------- 1 | 2017-08-03 2 | 2017-08-07 I need to do this in the following context:with cte1 as ( select distinct on(data_id) data_id, date::date from data d join…
Read More

How to get rid of the webpack source code on client side?

Uncategorized
Question: I deploy a node.js app on pm2 server which serves my client code with Nginx. My client source code is bundled with Webpack. It is supposed to be minified and obfuscated. But when I run my app on client side and I open the console log "source" tab I can see both the obfuscated source code and the webpack file structure which is located under a "top://Webpack" directory. I don't want to show my code structure to the client. How can I get rid of that webpack file structure on the browser? Answer: This original file structure is provided by sourcemaps. Which is great because allows you to trace back errors in production code. You have the following options here Disable sourcemaps generation by setting devtool: false Docs. Do…
Read More

Creating Registration Page Using ASP.NET MVC by using ADO.net

Uncategorized
Question: Hey I stucked in creating Registration page using asp.net MVC by using ADO.net or Enterprise library. I dont want to use the entity framework . My database structure is CREATE table Registration ( CustomerId int IDENTITY(1,1) NOT NULL Primary key, Name varchar(255) NOT NULL, ContactNo varchar(255) NOT NULL, EmailId varchar(255) NOT NULL, Address varchar(255) NOT NULL, Dob varchar(255) NOT NULL, ); and I cretaed the method in in a class library My Model file is public string Name { get; set; } public string ContactNo { get; set; } public string EmailId { get; set; } public string Address { get; set; } public string Dob { get; set; } what code i Write in controller to get the value of cutomer in database Answer: refer this link what…
Read More