‏إظهار الرسائل ذات التسميات Cannot. إظهار كافة الرسائل
‏إظهار الرسائل ذات التسميات Cannot. إظهار كافة الرسائل

الثلاثاء، 24 ديسمبر 2013

MySQL Proxy Error: Cannot Load Module "mysql.password"

I am trying to test out a MySQL Proxy Script to handle authentication. And I keep getting errror

2013-12-25 00:25:31: (critical) (lua-error) [E:\Downloads\MySQL\proxy\script.txt][string "E:\Downloads\MySQL\proxy\script.txt"]:2: module 'mysql.password' not found: no field package.preload['mysql.password'] no file 'E:\Downloads\MySQL\proxy\lib\mysql-proxy\lua\mysql\password.lua' no file 'E:\Downloads\MySQL\proxy\bin\lua-mysql\password.dll' no module 'mysql.password' in file 'E:\Downloads\MySQL\proxy\bin\lua-mysql.dll'

Following is my code. By the looks of the message I am missing some files. But I could not find any help by searching. Any help will be appreciated.

local proto = assert(require("mysql.proto"))local password = assert(require("mysql.password"))function read_auth() print(" username : " .. proxy.connection.client.username) print(" password : " .. string.format("%q", proxy.connection.client.scrambled_password)) local c = proxy.connection.client local s = proxy.connection.server if c.username == "test" and -- the username we want to map password.check( s.scramble_buffer, c.scrambled_password, password.hash(password.hash("test")) -- its valid password ) then proxy.queries:append(1, proto.to_response_packet({ username = "root", response = password.scramble(s.scramble_buffer, password.hash("admin")), charset = 8, -- default charset database = c.default_db, max_packet_size = 1 * 1024 * 1024 }) ) return proxy.PROXY_SEND_QUERY -- works if you use lp:mysql-proxy r694 or later endend

View the original article here

الجمعة، 20 ديسمبر 2013

java.lang.IllegalStateException: Cannot add header view to list Android

i have one issues in my application , am setting header view to listview dynamically but am getting below error, i have two activies , A and B according my codition am setting header view to listview when am setting hederview in A activity it work fine but when A activity false my codition and go to B activity there am my contion is ture then come to A activity i neeed to add header view there am getting Error................ i have tryied to added onStart(), onResume() methods, but still am getting same error..... how to fix it

Java code

if (mDrawerList.getHeaderViewsCount()<1) { TextView headerText = new TextView(mContext); headerText.setGravity(Gravity.CENTER); headerText.setTextColor(getResources().getColor(R.color.white_color)); headerText.setPadding(20, 12, 20, 12); headerText.setTextSize(18); headerText.setText(mSessionManager.getUserName()); mDrawerList.addHeaderView(headerText); }

Error message

2-20 15:15:34.799: E/AndroidRuntime(13111): FATAL EXCEPTION: main12-20 15:15:34.799: E/AndroidRuntime(13111): java.lang.RuntimeException: Unable to resume activity {com.examle.EventListActivity}: java.lang.IllegalStateException: Cannot add header view to list -- setAdapter has already been called.12-20 15:15:34.799: E/AndroidRuntime(13111): at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2790)12-20 15:15:34.799: E/AndroidRuntime(13111): at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2819)12-20 15:15:34.799: E/AndroidRuntime(13111): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1298)12-20 15:15:34.799: E/AndroidRuntime(13111): at android.os.Handler.dispatchMessage(Handler.java:99)12-20 15:15:34.799: E/AndroidRuntime(13111): at android.os.Looper.loop(Looper.java:137)12-20 15:15:34.799: E/AndroidRuntime(13111): at android.app.ActivityThread.main(ActivityThread.java:5103)12-20 15:15:34.799: E/AndroidRuntime(13111): at java.lang.reflect.Method.invokeNative(Native Method)12-20 15:15:34.799: E/AndroidRuntime(13111): at java.lang.reflect.Method.invoke(Method.java:525)12-20 15:15:34.799: E/AndroidRuntime(13111): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)12-20 15:15:34.799: E/AndroidRuntime(13111): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)12-20 15:15:34.799: E/AndroidRuntime(13111): at dalvik.system.NativeStart.main(Native Method)12-20 15:15:34.799: E/AndroidRuntime(13111): Caused by: java.lang.IllegalStateException: Cannot add header view to list -- setAdapter has already been called.12-20 15:15:34.799: E/AndroidRuntime(13111): at android.widget.ListView.addHeaderView(ListView.java:258)12-20 15:15:34.799: E/AndroidRuntime(13111): at android.widget.ListView.addHeaderView(ListView.java:287)

View the original article here

Cannot find element using simple_html_dom.php

This is the script I am using:

find('#title'); echo count($title);?>

count($title) returns 0.

There is indeed a line in the web page

Folding Helping Hand Long-Reach Pick-Up Gripper - 26" Aluminum

but the simple_html_dom script cannot find it.

I have also tried

$title = $html->find('h1[id=title]');

but count($title) still returns 0.

I run

echo $html->plaintext;

and the title is there.

I have no idea what the problem is.

Any help is appreciated!

Edit:

I notice that stackoverflow somehow change my url after I save the post.

This is the correct function call: file_get_html("http://rads.stackoverflow.com/amzn/click/B000VS8CTM").


View the original article here