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
| def newSlider(state: PasswordGeneratorModel, labelres: Int, label: TextView, countRes: Int, | |
| slider: SeekBar, enableTransform: (PasswordGeneratorModel, Boolean) => PasswordGeneratorModel, | |
| isEnabled: PasswordGeneratorModel => Boolean, min: PasswordGeneratorModel => Int, | |
| updateMin: (PasswordGeneratorModel,Int) => PasswordGeneratorModel, | |
| seek1: SeekBarInfo, seek2: SeekBarInfo) = { | |
| val ll = new LinearLayout(getActivity) | |
| val cb = new CheckBox(...) | |
| cb.setLayoutParams(stdH) | |
| cb.setText(labelRes) | |
| cb.setChecked(isEnabled(state) |
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
| IO(numSlider) >>= stdH >>= k.max(state.length) >>= k.progress(state.minNum) >>= k.enabled(state.num) >>= | |
| hookM.seekBarChange.onProgressChanged((sb: SeekBar, p: Int, user: Boolean) => for { | |
| st <- transformState(_.copy(minNum = p)) | |
| _ <- IO(minNumLabel) >>= k.text(getString(R.string.minimum_numbers, p.asInstanceOf[Integer])) | |
| _ <- IO(uppSlider) >>= k.progress(math.min(st.minUpper, math.max(st.length - st.minNum - st.minSym, 0))) | |
| _ <- IO(symSlider) >>= k.progress(math.min(st.minSym, math.max(st.length - st.minUpper - st.minNum, 0))) | |
| } yield ()), | |
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
| override def applyState[T](s: FragmentState[T]) = s match { | |
| case OnCreateView(state, inflater, container) => s.applyResult( | |
| l[ScrollView](l[LinearLayout]( | |
| IO(generatedPassword) >>= k.text(generate(state)) >>= | |
| k.textAppearance(getActivity, android.R.style.TextAppearance_Medium) >>= | |
| k.gravity(Gravity.CENTER) >>= | |
| k.backgroundColor(getResources.getColor(android.R.color.darker_gray)) >>= | |
| lpK(MATCH_PARENT, 48.dp)(margins(bottom = 16.dp)), | |
| IO(lengthLabel) >>= k.text(getString(R.string.minimum_length, state.length.asInstanceOf[Integer])), | |
| IO(lengthSlider) >>= stdH >>= k.progress(state.length - 8) >>= |
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
| from ctypes import * | |
| from ctypes.wintypes import * | |
| import hexchat | |
| import traceback | |
| import sys | |
| __module_name__ = "sethook" | |
| __module_version__ = "1.0" | |
| __module_description__ = "Demonstration of calling SetWindowsLongPtr from ctypes" |
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
| sealed trait CharType | |
| case object Uppercase extends CharType | |
| case object Lowercase extends CharType | |
| case object Symbol extends CharType | |
| case object Digit extends CharType | |
| case class Spans(chartype: CharType, start: Int, end: Int) | |
| if (Option(strings.Get(PwDefs.PasswordField)) exists (_.Length > 0)) { | |
| val passfield = new StandardFieldView(this) | |
| passfield.first = first | |
| first = false |
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
| package com.hanhuy.android.irc | |
| import android.graphics.Typeface | |
| import android.os.Bundle | |
| import android.support.v7.app.AppCompatActivity | |
| import android.support.v7.widget.{LinearLayoutManager, RecyclerView} | |
| import android.view.ViewGroup | |
| import android.widget.{TextView, LinearLayout} | |
| import com.hanhuy.android.irc.model.{MessageAdapter, RingBuffer} |
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
| package com.hanhuy.android.irc | |
| import android.app.Activity | |
| import android.os.Bundle | |
| import android.view.{View, Menu} | |
| import iota.IO | |
| /** beware: | |
| * https://youtrack.jetbrains.com/issue/SCL-9888 | |
| * https://issues.scala-lang.org/browse/SI-9658 |
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
| import android.app.Activity | |
| import android.os.Bundle | |
| import ActivityStateMachine._ | |
| /** | |
| * @author pfnguyen | |
| */ | |
| trait ActivityStateMachine[T <: State[T]] extends Activity { |
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
| requestActivityResult(intent).onSuccessMain { case data => | |
| val ringtone = data.?.map(_.getParcelableExtra(RingtoneManager.EXTRA_RINGTONE_PICKED_URI): Uri) | |
| setRingtone(ringtone.fold("")(_.toString)) | |
| } |
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
| [pfnguyen@GALACTICA output] $ ~/android-sdk-windows/build-tools/23.0.2/aapt.exe d xmltree keepshare-debug.apk AndroidManifest.xml | grep -A5 provider | |
| E: provider (line=58) | |
| A: android:label(0x01010001)=@0x7f070039 | |
| A: android:name(0x01010003)="com.hanhuy.android.keepshare.SearchProvider" (Raw: "com.hanhuy.android.keepshare.SearchProvider") | |
| A: android:readPermission(0x01010007)="android.permission.GLOBAL_SEARCH" (Raw: "android.permission.GLOBAL_SEARCH") | |
| A: android:exported(0x01010010)=(type 0x12)0xffffffff | |
| A: android:authorities(0x01010018)=@0x7f070093 | |
| [pfnguyen@GALACTICA output] $ ~/android-sdk-windows/build-tools/23.0.2/aapt.exe d resources keepshare-debug.apk | grep 70093 | |
| spec resource 0x7f070093 com.hanhuy.android.keepshare:string/search_suggest_authority: flags=0x40000000 | |
| resource 0x7f070093 com.hanhuy.android.keepshare:string/search_suggest_authority: t=0x03 d=0x00000346 (s=0x0008 r=0x00) (PUBLIC) |