Monday, 15 February 2010

Invalid 8086 assembly statement -



Invalid 8086 assembly statement -

i have seen sentence in assembly language , don't know why wrong. here is:

mov cx, ch

.why wrong?

your instruction wrong because cx 16 bit , ch 8 bit (it's higher 8 bits in cx

assembly 8086

sql - Group by, Subquery and Nested group by function in the Having clause -



sql - Group by, Subquery and Nested group by function in the Having clause -

trying display details of staff fellow member amount of orders, in oracle there error stating grouping function 'nested deeply'.

select c.staff_no, s.first_name, s.last_name, max(count(*)) "number of orders" cust_order c, staff s c.staff_no = s.staff_no grouping c.staff_no, s.first_name, s.last_name having max(count(*)) > (select max((count(*)) cust_order c, staff s c.staff_no = s.staff_no);

instead, utilize analytic functions:

select staff_no, first_name, last_name, "number of orders" (select c.staff_no, s.first_name, s.last_name, count(*) "number of orders", max(count(*)) on () maxcount cust_order c bring together staff s on c.staff_no = s.staff_no grouping c.staff_no, s.first_name, s.last_name ) cs "number of orders" = maxcount;

this should have improve performance.

sql oracle nested having clause

javascript - FineUploader S3 Compatible support -



javascript - FineUploader S3 Compatible support -

i know fineuploader works amazon s3 there many s3 compatible servers , evaluate fineuploader used s3 compatible server.

has done ? if there configuration tips ?

i'm not sure got right here, s3 service offered aws. there "one" s3.

using fineuploader s3 requires 3 parties: - browser (end-user) - server (hosted language of choice: nodejs, php, python etc.) - amazon s3

if you'd seek this, advise visit www.fineuploader.com, , grab re-create of jquery s3 fineuploader. it's offered without paying money.

you can create work first, , pay commercial license later if need commercial use.

in terms of configuration, have server-side demos in various languages here: https://github.com/fineuploader/server-examples

client-side demos in website: http://fineuploader.com/demos.html

javascript amazon-s3 fine-uploader

php - Not Picking Up Image If False -



php - Not Picking Up Image If False -

in codeigniter form, trying set else if info image. picks if when image exists. need pick no_image.png, if no image exist using same code below.

<?php class users extends mx_controller { public function index() { $this->getform(); } protected function getform($user_id = 0) { $this->load->model('admin/user/users_model'); $user_info = $this->users_model->getuser($user_id); if (trim($this->input->post('image'))) { $data['image'] = $this->input->post('image'); } elseif (!empty($user_info)) { // location image works fine. $data['image'] = config_item('base_url') . 'image/catalog/' . $user_info['image']; } else { // should display if no image nowadays in database not work. $data['image'] = config_item('base_url') . 'image/'. 'no_image.png'; } } $this->load->view('user/users_form', $data); }

view page :

<div class="form-group"> <label for="input-image" class="col-lg-2 col-md-12 col-sm-2 col-xs-12"><?php echo $entry_image; ?></label> <div class="col-lg-10 col-md-10 col-sm-10 col-xs-12"> <a href="" id="thumb-image" data-toggle="image" class="img-thumbnail"> <img src="<?php echo $image; ?>"/> </a> </div> </div>

make sure in image folder no_image.png exists. , accessible directly.like , can seek straight open link in browser http://www.yoursiteurl/image/no_image.png.

if opens there 2 possibilities

in config file there no end slash baseurl.

the code never executes else block

if dierct link not open htaccess problem may exists.

hope help you.

or elseif status may this

elseif(!empty($user_info) && $user_info['image'] && file_exists(config_item('base_url') . 'image/catalog/' . $user_info['image'])){ ... } // + user info valid user image not available

php codeigniter

java - JSON response is not working in PHP version 5.3.24 -



java - JSON response is not working in PHP version 5.3.24 -

i developing java application have pass values server , receive response php file (version 5.3.24).the code running fine in localhost , other live servers php version greater 5.3.24.

this java code.

public static void send() { seek { // create json string, seek hamburger string json = "{\"name\":\"frank\",\"food\":\"pizza\",\"quantity\":3}"; // send http request url url = new url("http://www.matjazcerkvenik.si/php/json/pizzaservice.php?order="+json); urlconnection conn = url.openconnection(); // response bufferedreader rd = new bufferedreader(new inputstreamreader(conn.getinputstream())); string line; while ((line = rd.readline()) != null) { system.out.println(line); } rd.close(); } grab (exception e) { e.printstacktrace(); } } public static void main(string[] args) { send(); }

this php code.

<?php $order = $_get["order"]; $obj = json_decode($order); $name = $obj -> {"name"}; $food = $obj -> {"food"}; $quty = $obj -> {"quantity"}; if ($food == "pizza") { $price = 4000; } else if ($food == "hamburger") { $price = 5000; } else { $price = 0; } $price = $price * $quty; if ($price == 0) { $status = "not-accepted"; } else { $status = "accepted"; } $array = array("name" => $name, "food" => $food, "quantity" => $quty, "price" => $price, "status" => $status); echo json_encode($array); ?>

change php script bit:

<?php $order = get_magic_quotes_gpc() ? stripslashes($_get["order"]) : $_get["order"]; $obj = json_decode($order); $name = $obj -> {"name"}; $food = $obj -> {"food"}; $quty = $obj -> {"quantity"}; if ($food == "pizza") { $price = 4000; } else if ($food == "hamburger") { $price = 5000; } else { $price = 0; } $price = $price * $quty; if ($price == 0) { $status = "not-accepted"; } else { $status = "accepted"; } $array = array("name" => $name, "food" => $food, "quantity" => $quty, "price" => $price, "status" => $status); echo json_encode($array); ?>

java php json

object - Making a class act as string in Python when you have both str and unicode -



object - Making a class act as string in Python when you have both str and unicode -

disclaimer: using python 2.6 lot of weird reasons. is.

i'm trying create object deed string properties this:

class setting(str): def __new__(cls, value, source): homecoming super(setting, cls).__new__(cls, value) def __init__(self, value, source): self.value = value self.source = source

this works rather nicely. scarily nice. ;)

but: need back upwards both unicode , str objects. ideally extend basestring. unfortunately, logical reasons; changing super class basestring not work , gives error:

typeerror: basestring type cannot instantiated

anyone have thought how go fixing this? thanks. :)

ok, sorry code horrible, hard understand, subclassing builtin (like str, file) bad idea, in production code.

what recommend generic approach, create class 2 variables , override special operators desired result (ie create deed str):

class setting: def __init__(self, value, source): self.value = value self.source = source def __add__(self, rhs): #keeping object immutable homecoming setting(self.value + rhs, self.source)

however in interests of extreme python code, cannot think of single utilize case (there improve way), here workaround:

class setting(object): def __new__(cls, value, source): #pick right base of operations class base_class = str if isinstance(value, str) else unicode #construct new setting class right base of operations new_type = type(cls.__name__, (base_class,), dict(cls.__dict__)) homecoming base_class.__new__(new_type, value) def __init__(self, value, source): self.value = value self.source = source

the thought dynamically create class right base of operations based on type of value given. yes, should more scary , shouldn't utilize it. alter base of operations became whatever class type 'value' was, thought more readable.

the reason couldn't utilize basestring abstract class, or @ to the lowest degree acts one. when did:

return super(setting, cls).__new__(cls, value)

it tried create current instance of setting new instance of basestring, since abstract means has no implementation, nil call.

python object unicode subclass

c++ - wstringstream to LPCWSTR -



c++ - wstringstream to LPCWSTR -

there open source code using , created new string class can have syntax's :

openevent(event_all_access, false, string() << l"sometext" << uint(123));

i wondering if can create same thing conciseness wstringstream or similar.

openevent window api function 3rd argument lpcwstr can phone call like

openevent(event_all_access, false, l"some text");

assuming have wstringstream variable named wss, calling "wss.str().c_str()" trick.

this relies on str fellow member of basic_stringstream class , c_str fellow member of basic_string class. calling str on basic_stringstream object obtains string representation of object , calling c_str on basic_string object obtains c-style string representation of object.

c++ windows winapi stl