This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace :db do | |
desc 'Truncate all tables, except schema_migrations (customizable)' | |
task :truncate, [ :tables ] => 'db:load_config' do |t, args| | |
args.with_defaults(tables: 'schema_migrations') | |
skipped = args[:tables].split(' ') | |
config = ActiveRecord::Base.configurations[::Rails.env] | |
ActiveRecord::Base.establish_connection |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
errors[:base] << "यो जिन्सी सामानसंग सम्बन्धित कारोबार अन्य दाखिला, खरिद आदेश, मागफरामहरू मध्ये कुनै एकमा देखिएकोले हटाउन सकिएन |" | |
throw(:abort) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# change directory to your drive, here in my case drive letter is D: and I want to change my file system from fat32 to ntfs | |
D: | |
# now run disk check | |
CHKDSK /F | |
# when disk check is complete run this code to change your file system without formatting | |
convert D:/fs:ntfs |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Private Sub Workbook_Open() | |
Dim i As Long | |
Application.Calculation = xlCalculationManual | |
For i = ThisWorkbook.Names.Count To 1 Step -1 | |
ThisWorkbook.Names(i).Delete | |
Next | |
Application.Calculation = xlCalculationAutomatic | |
End Sub |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@year = 40 #total years you want to save monthly | |
@months = @year*12 | |
@saving = 200 #amount of money you want to save monthly | |
@yearly_interest_rate = 6 #yearly interest rate for monthly saving | |
@interest_calculation_duration_in_month = 3 #interest is calculated each 3 months | |
@monthly_interest_rate = (@yearly_interest_rate/100.0)/12.0 | |
@amount = 0 | |
(1..@year).each do |y| | |
(1..12).each do |m| | |
@amount = @amount + @saving |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Fragment fragment = null; | |
Class fragmentClass = null; | |
fragmentClass = NoticeFragment.class; | |
try { | |
fragment = (Fragment) fragmentClass.newInstance(); | |
} catch (Exception e) { | |
e.printStackTrace(); | |
} | |
FragmentManager fragmentManager = getSupportFragmentManager(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
final Menu menu = navigationView.getMenu(); | |
for (int i = 0; i < types.size(); i++) { | |
MenuItem item = menu.add(R.id.notice_types, types.get(i).type_id, 0, types.get(i).name); | |
item.setIcon(R.drawable.asterisk); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<activity | |
android:name=".activities.FullViewActivity" | |
android:theme="@style/Theme.AppCompat.Light.NoActionBar.FullScreen" | |
/> |