KAYS53N

KAYS53N 查看完整档案

北京编辑  |  填写毕业院校Wooyun  |  PHP 编辑 kaysen.me 编辑
编辑

技术方向:php, linux, mysql

个人动态

KAYS53N 回答了问题 · 2017-03-24

javascript实现repalceAll

String.prototype.replaceAll = function(s1, s2){
    return this.replace(new RegExp(s1, 'gm'),s2);
};

关注 4 回答 3

KAYS53N 回答了问题 · 2017-03-24

有没有办法能够知道软件下载东西时候的地址呢?

Fiddler抓包

关注 2 回答 1

KAYS53N 回答了问题 · 2016-02-20

解决使用Andtoid stuido clean了下后导致报错停止运行

重新引入配置后好了

关注 4 回答 4

KAYS53N 提出了问题 · 2016-02-19

解决使用Andtoid stuido clean了下后导致报错停止运行

使用Andtoid stuido clean了下后导致报错停止运行,虚拟机运行没有问题,真机调试有问题,不知道是哪里除了问题

   Process: xujiantao.com.chuangwen, PID: 12496
    android.view.InflateException: Binary XML file line #7: Error inflating class com.handmark.pulltorefresh.library.PullToRefreshListView
            at android.view.LayoutInflater.createView(LayoutInflater.java:623)
            at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:699)
            at android.view.LayoutInflater.rInflate(LayoutInflater.java:758)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:495)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:400)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:353)
            at xujiantao.com.chuangwen.SuperAwesomeCardFragment.onCreateView(SuperAwesomeCardFragment.java:76)
            at android.support.v4.app.Fragment.performCreateView(Fragment.java:1962)
            at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1067)
            at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1248)
            at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:738)
            at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1613)
            at android.support.v4.app.FragmentManagerImpl.executePendingTransactions(FragmentManager.java:570)
            at android.support.v4.app.FragmentPagerAdapter.finishUpdate(FragmentPagerAdapter.java:141)
            at android.support.v4.view.ViewPager.populate(ViewPager.java:1106)
            at android.support.v4.view.ViewPager.populate(ViewPager.java:952)
            at android.support.v4.view.ViewPager.onMeasure(ViewPager.java:1474)
            at android.view.View.measure(View.java:16529)
            at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5125)
            at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1404)
            at android.widget.LinearLayout.measureHorizontal(LinearLayout.java:1052)
            at android.widget.LinearLayout.onMeasure(LinearLayout.java:590)
            at android.view.View.measure(View.java:16529)
            at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5125)
            at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1404)
            at android.widget.LinearLayout.measureVertical(LinearLayout.java:695)
            at android.widget.LinearLayout.onMeasure(LinearLayout.java:588)
            at android.view.View.measure(View.java:16529)
            at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5125)
            at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)
            at android.view.View.measure(View.java:16529)
            at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5125)
            at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1404)
            at android.widget.LinearLayout.measureVertical(LinearLayout.java:695)
            at android.widget.LinearLayout.onMeasure(LinearLayout.java:588)
            at android.view.View.measure(View.java:16529)
            at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5125)
            at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)
            at com.android.internal.policy.impl.PhoneWindow$DecorView.onMeasure(PhoneWindow.java:2291)
            at android.view.View.measure(View.java:16529)
            at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:1973)
            at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1170)
            at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1352)
            at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1057)
            at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5666)
            at android.view.Choreographer$CallbackRecord.run(Choreographer.java:761)
            at android.view.Choreographer.doCallbacks(Choreographer.java:574)
            at android.view.Choreographer.doFrame(Choreographer.java:544)
            at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:747)
            at android.os.Handler.handleCallback(Handler.java:733)
            at android.os.Handler.dispatchMessage(Handler.java:95)
            at android.os.Looper.loop(Looper.java:136)
            at android.app.ActivityThread.main(ActivityThread.java:5072)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:515)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.r

关注 4 回答 4

KAYS53N 提出了问题 · 2016-02-16

使用Android-PullToRefresh上拉加载数据问题

使用Android-PullToRefresh上拉加载数据后每次滚动条又返回了顶部,正常情况下应该是保持位置不变的,刚学安卓没多久,不知道是哪里出了问题

代码:

public class SuperAwesomeCardFragment extends Fragment {

    private static final String ARG_POSITION = "position";

    private int position;

    private PullToRefreshListView lv;

    private ArrayAdapter<String> pullDataAdapter;

    private  List<Map<String, Object>> listems = new ArrayList<Map<String, Object>>();

    private int page = 0;

    private String url = "http://api.xxxxx.com/company/company_list";

    public static SuperAwesomeCardFragment newInstance(int position)
    {
        SuperAwesomeCardFragment f = new SuperAwesomeCardFragment();
        Bundle b = new Bundle();
        b.putInt(ARG_POSITION, position);
        f.setArguments(b);
        return f;
    }

    @Override
    public void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);

        position = getArguments().getInt(ARG_POSITION);

    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
    {

        LayoutParams params = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);

        FrameLayout fl = new FrameLayout(getActivity());
        fl.setLayoutParams(params);

        View root = inflater.inflate(R.layout.data, container, false);
        lv = (PullToRefreshListView) root.findViewById(R.id.myLv);
        lv.setMode(PullToRefreshBase.Mode.BOTH);
        lv.getLoadingLayoutProxy(false, true).setPullLabel("上拉加载更多...");
        lv.getLoadingLayoutProxy(false, true).setReleaseLabel("放开加载更多...");
        lv.getLoadingLayoutProxy(false, true).setRefreshingLabel("正在加载...");

        lv.getLoadingLayoutProxy(true, false).setPullLabel("下拉刷新...");
        lv.getLoadingLayoutProxy(true, false).setReleaseLabel("放开刷新...");
        lv.getLoadingLayoutProxy(true, false).setRefreshingLabel("正在刷新...");

        getData();

        lv.setOnRefreshListener(new PullToRefreshBase.OnRefreshListener2<ListView>(){

            public void onPullDownToRefresh(PullToRefreshBase<ListView> refreshView)
            {
                Toast.makeText(getActivity(), "下拉刷新", Toast.LENGTH_SHORT).show();

                new AsyncTask<Void, Void, Void>() {

                    @Override
                    protected Void doInBackground(Void... params) {
/*                        try {
                            Thread.sleep(200);
                        } catch (InterruptedException e) {
                            e.printStackTrace();
                        }*/

                        return null;
                    }

                    protected void onPostExecute(Void result)
                    {
                        lv.onRefreshComplete();
                    }

                }.execute();
            }

            @Override
            public void onPullUpToRefresh(PullToRefreshBase<ListView> refreshView)
            {
                Toast.makeText(getActivity(), "上拉加载更多", Toast.LENGTH_SHORT).show();

                new AsyncTask<Void, Void, Void>() {

                    @Override
                    protected Void doInBackground(Void... params)
                    {
/*                        try {
                            Thread.sleep(200);
                        } catch (InterruptedException e) {
                            e.printStackTrace();
                        }*/

                        return null;
                    }

                    protected void onPostExecute(Void result) {
                        System.out.println("############################" + page);
                        getData();
                        lv.onRefreshComplete();
                        super.onPostExecute(result);
                    }

                }.execute();
            }
        });

        fl.addView(root);

        return fl;
    }

    public void getData()
    {
        page = page+1;
        StringRequest request = new StringRequest(url + "?page=" + page, new Response.Listener<String>() {
            @Override
            public void onResponse(String s)
            {
                dealData(s);
            }
        }, new Response.ErrorListener() {
            @Override
            public void onErrorResponse(VolleyError volleyError) {
                //Log.i("##############", volleyError.toString());
            }
        });

        Volley.newRequestQueue(getActivity().getApplicationContext()).add(request);
    }

    private void dealData(String result)
    {
        Book book = JSON.parseObject(result, Book.class);

        for(int i=0; i<book.getData().size(); i++)
        {
            Map<String, Object> listem = new HashMap<String, Object>();
            listem.put("title", book.getData().get(i).getCompany());
            listem.put("category", book.getData().get(i).getCategory());
            listem.put("financing", book.getData().get(i).getRank());
            listem.put("money", book.getData().get(i).getMoney());
            listem.put("corporation", book.getData().get(i).getOrganization());
            listems.add(listem);
        }

        SimpleAdapter adapter = new SimpleAdapter(
                getActivity(),
                listems,
                R.layout.custom_list_item, new String[] { "title", "category", "financing", "money", "corporation" },
                new int[] {R.id.title, R.id.category, R.id.financing}
        );
        lv.setAdapter(adapter);
        adapter.notifyDataSetChanged();
    }
}

关注 1 回答 0

KAYS53N 提出了问题 · 2016-01-18

PHP2 Readme 第四步不太明白,一直编译不出来mod_php.o

PHP2 Readme 第四步不太明白,三个文件copy到apache src后一直编译不出来mod_php.o,可能是我意思理解错了

Step 1.

Run the install program: ./install

You will be asked a number of questions. If you do not understand
what is being asked, simply hit return. The default choice should
be safe on most systems.

Step 2.

Go into the src directory: cd src

Have a look at the php.h file. There are a number of compile-time
options that can be set here.

Step 3.

type: make

This will create the actual executable program file named php.cgi
by default. (If you are NOT installing the Apache module version)

Step 4. (If you are NOT installing the Apache module version)

Copy the php.cgi binary to your system's cgi-bin directory. If you
do not have access to do this and wish to install it in your own
personal directory, you may do so, but you should set the setuid
bit on the executable with: chmod u+s /path/php.cgi
Setting the setuid bit is not crucial. The benefit is that any files
created by php will be owned by you. This means that you can edit
and delete such files directly. Without the setuid bit set these
files will be owned by the httpd user id.

Step 4. (if you are installing the Apache module version)

Change to your Apache src directory where the mod_php.c ,mod_php.h
and libphp.a files should have been copied to. If they weren't which
usually happens because of permission problems, copy these three files
there manually. Edit your Apache Configuration file and add the
EXTRA_LIBS line which was produced at the end of Step 3. And add:

Module php_module mod_php.o

to the very end of the file. Then type: ./Configure and then 'make' to
rebuild your Apache httpd binary. Install this binary.

Next you need to edit your Apache conf/srm.conf file and add a line like:

AddType application/x-httpd-php .phtml

This defines a new MIME, application/x-httpd-php, which will trigger the
PHP module to parse any file ending with the .phtml extension. You can pick
any extension you like for this.

Now you are ready to restart your httpd server. See the Apache Module
Notes for more details on configuring the PHP Module.

Step 5.

Copy the doc/doc.html file to somewhere in your web document tree
and read it using your favourite browser. This file is the overall
documentation for the package.

关注 1 回答 0

KAYS53N 提出了问题 · 2016-01-18

解决php7.0.2 安装完 pthreads 后报错

系统使用的Centos6.6, 除了Mysql都是使用的编译安装
启动php-fpm时候报错如下:

Starting php-fpm [18-Jan-2016 18:09:29] NOTICE: PHP message: PHP Fatal error:  The fpm-fcgi SAPI is not supported by pthreads in Unknown on line 0
[18-Jan-2016 18:09:29] NOTICE: PHP message: PHP Fatal error:  Unable to start pthreads module in Unknown on line 0

关注 4 回答 2

KAYS53N 回答了问题 · 2016-01-06

解决如何在Mac上卸载composer?

find / -name composer 然后rm -rf

关注 8 回答 6

KAYS53N 提出了问题 · 2016-01-06

有什么通用的办法匹配官网的加入我们页面url

想匹配很多官网的加入我们页面的URL
一开始想用正则匹配“加入我们”左侧最近的href的url,似乎正则不太好使;大家有什么好办法,最好贴下代码

关注 1 回答 0

KAYS53N 回答了问题 · 2015-11-13

解决ajax一站到底

之前和一位阿里的同事一起做过通过锚点Ajax请求不同后端地址的后台,锚点的每次变化会出发一个全局事件;晚上回去找下再继续补充答案

<!DOCTYPE html>
<html>
<head>
    <meta charset=utf-8 />
    <title>test</title>
</head>
<body>
<a href="#test1_abc">跳锚点1</a>
<a href="#test2_abc">跳锚点2</a>
<a href="#test3_abc">跳锚点3</a>
<a href="#test4_abc">跳锚点4</a>

<script type="text/javascript" data-original="http://libs.baidu.com/jquery/1.9.1/jquery.min.js"></script>
<script>
window.onhashchange = function(){
    var url = window.location.hash.replace('#', '').replace('_', '/');
    $.post(url, {}, function(){
        console.log('ok');
    });
}
</script>
</body>
</html>

关注 8 回答 5

认证与成就

  • 获得 45 次点赞
  • 获得 12 枚徽章 获得 0 枚金徽章, 获得 4 枚银徽章, 获得 8 枚铜徽章

擅长技能
编辑

(゚∀゚ )
暂时没有

开源项目 & 著作
编辑

(゚∀゚ )
暂时没有

注册于 2015-07-01
个人主页被 428 人浏览