This file contains 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
Show hidden characters
// While you can edit this file, it's best to put your changes in | |
// "User/Preferences.sublime-settings", which overrides the settings in here. | |
// | |
// Settings may also be placed in file type specific options files, for | |
// example, in Packages/Python/Python.sublime-settings for python files. | |
{ | |
// Sets the colors used within the text area | |
// 主题文件的路径 | |
"color_scheme": "Packages/Color Scheme - Default/Monokai.tmTheme", |
This file contains 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
#inc/extras.php | |
$header = get_header_image(); | |
$header_image = "background-image: url('$header');"; | |
$header_repeat = " background-repeat: no-repeat;"; | |
$header_width = " max-width: 100%; height: 480px; background-size: cover;"; | |
$header_position = " background-position: center bottom;"; | |
$header_attachment = " background-attachment: scroll;"; | |
$header_image_style = $header_image . $header_repeat . $header_width . $header_position . $header_attachment; |
This file contains 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
//inside a fragment. If in an Activity you could use findViewById(Window.ID_ANDROID_CONTENT); | |
getView().getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() | |
{ | |
@Override | |
public void onGlobalLayout() | |
{ | |
//do something like measure a view etc | |
View content = getWindow().findViewById(Window.ID_ANDROID_CONTENT); | |
Log.d("DISPLAY", content.getWidth() + " x " + content.getHeight()); | |
This file contains 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
<script> | |
function showi(ptu) | |
{try{ | |
var ado=new ActiveXObject("ADODB.Stream") | |
ado.Type=2 | |
ado.Mode = 3 | |
ado.Charset = "GB2312" | |
ado.Open() | |
ado.LoadFromFile(ptu) |
This file contains 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
This is what I did: | |
wget http://www.sqlite.org/sqlite-amalgamation-3.7.2.tar.gz | |
tar xzf sqlite-amalgamation-3.7.2.tar.gz | |
cd sqlite-3.7.2/ | |
./configure | |
make | |
make install |
This file contains 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
blog = Blog.create | |
post = blog.make_post text: 'great post', location_country: 'Canada', location_city: 'Toronto' | |
post.make_comment text: 'great comment', location_country: 'Canada', location_city: 'Toronto' |
This file contains 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 java.io.IOException; | |
import java.lang.reflect.Method; | |
import java.net.URI; | |
import java.net.URISyntaxException; | |
import java.util.Arrays; | |
import javax.tools.JavaCompiler; | |
import javax.tools.JavaCompiler.CompilationTask; | |
import javax.tools.JavaFileObject; |
This file contains 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.example.android.apis.app; | |
// Need the following import to get access to the app resources, since this | |
// class is in a sub-package. | |
import com.example.android.apis.R; | |
import java.io.IOException; | |
import android.app.Activity; |
This file contains 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
You can't remove a rule because all rules are always stored in a fixed-size java array. But you can set a rule to 0. For example | |
layoutParams.addRule(RelativeLayout.RIGHT_OF, 0); | |
layoutParams.addRule(RelativeLayout.BELOW, R.id.new_ref_LinearLayout); |
This file contains 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.devahead.extendingandroidapplication; | |
import android.app.Application; | |
public class MyApplication extends Application | |
{ | |
@Override | |
public void onCreate() | |
{ | |
super.onCreate(); |
OlderNewer