Posts

Showing posts from September, 2014

cygwin - i686-linux-android-g++.exe: error: CreateProcess: No such file or directory -

i doing ndk-build on windows through cygwin,but error after last .c file gets compiled , .so file not generated. trying build .so file x86 architecture on windows 7(my machine 32 bit).i using cygwin compiler build-ndk. using latest version of android-ndk. below full error: compile x86 : xyz < = test.c sharedlibrary : libabc.so i686-linux-android-g++.exe: error: createprocess: no such file or directory /cygdrive/e/android-ndk/android-ndk-r8e/build/core/build-binary.mk:450: recipe target `/cygdrive/e/abc//obj/local/x86/libabc.so' failed

asp.net - MVC Validations not firing -

i'm using asp.net mvc 2. form validations not firing. can not figure out whats wrong here. model: public class stock { public int stockid { get; set; } [required(errormessage = "please select client")] public int clientid { get; set; } [required(errormessage = "please select item")] public int itemid { get; set; } [required(errormessage = "please enter item count")] public int itemcount { get; set; } [required(errormessage = "please enter item price")] public double price { get; set; } [required(errormessage = "please enter other expences")] public double otherexpences { get; set; } public double totalstockvalue { get; set; } [required(errormessage = "please enter delivery date")] public datetime deliverydate { get; set; } public string description { get; set; }

wordpress - timthumb.php show as a text, not working -

i use economy plan of godaddy host. installed wordpress on run ok. when timthumb.php host it's not run. show timthumb.php text. how can fix it? my site: http://piolab.com/timthumb.php it means php not installed/configured on server. you have contact server service provider.

java - Does synchronized affect object members? -

if call object synchronized, can access objects inside object if synchronized? or can access data types? even though goal protect data, synchronization provides exclusivity around block of code, not piece of data. code outside synchronization blocks (or in blocks use different objects), may alter data trying protect if isn't want. any correct locking strategy must ensure blocks of code interfere each other hold same lock. includes code interfere copy of run in second thread. synchronized (myobject) { // sensitive code } locking @ method level shorthand locking this pointer body of method. (or class object static method).

Using quote-like-operators or quotes in the perl's printf -

reading perl sources saw many times next construction: printf qq[%s\n], getsomestring( $_ ); but usually written as printf "%s\n", getsomestring( $_ ); the question: is here "good practice" correct way, , if yes when recommended use longer qq[...] vs "..." or pure timtowtdi? the perlop doesn't mention this. you can use qq() alternative double quote method, such when have double quotes in string. example: "\"foo bar\"" looks better when written qq("foo bar") when in windows cmd shell, uses double quotes, use qq() when need interpolation. example: perl -lwe "print qq($foo\n)" the qq() operator -- many other perl operators such s/// , qx() -- handy demonstrate because can use character delimiter: qq[this works] qq|as this| qq#or this# this handy when have many different delimiters in string. example: qq!this (not) "hard" quote! as best practice, use w

c - Making udp socket non-blocking -

i had been working on non-blocking udp socket. code had developed generates window message whenever there data read on socket. below code snippet: void createsocket(hwnd hwnd) { ///socket binding/// wsadata wsa; ///initialise winsock/// if (wsastartup(makeword(2,2),&wsa) != 0) { exit(exit_failure); } ///create socket/// if((socketidentifier = socket(af_inet , sock_dgram , 0 )) == invalid_socket) { //socket creation failed } ///socket created/// ///prepare sockaddr_in structure/// serversocket.sin_family = af_inet; serversocket.sin_addr.s_addr = inaddr_any; serversocket.sin_port = htons( port ); ///bind/// if( bind(socketidentifier ,(struct sockaddr *)&serversocket , sizeof(serversocket)) == socket_error) { //bind failed } wsaasyncselect (socketidentifier, hwnd, my_message_notification, fd_read | fd_connect | fd_close | fd_accept); //se

php - Print Variable returned from API -

i have simple script below: <?php header('content-type: text/plain; charset=utf-8;'); $file = file_get_contents("http://weather.justcode.us/api.php?city=suzhou"); print_r(json_decode($file)); ?> and returns stdclass object ( [apiversion] => 1.0 [data] => stdclass object ( [location] => suzhou, chn [temperature] => 68 [skytext] => clear [humidity] => 60 [wind] => 13 [date] => 2013-05-04 [day] => saturday ) ) how print (for example) data->location or data->date? oh, , apologies in advance if simple question. try this, <?php header('content-type: text/plain; charset=utf-8;'); $file = file_get_contents("http://weather.justcode.us/api.php?city=suzhou"); $values= json_decode($file); $data=$values->data; echo $data->location; ?> output suzhou, chn here c

How to secure my PHP webpage from unauthorized Users -

i new in php , facing problem security. use redirect unauthorized users if not logged in. <?php session_start(); if(!isset($_session['user_id'])) { header('location: login.php'); } ?> it on every top of page when log in , click protected page redirect login page instead of original/protected page open , session variable set on login page how include session variable in protected page login page. if when, log in, sends login page, $_session['user_id'] may not set, or aren't including session in file, check it, do: var_dump($_session['user_id']) on page, , temporally leave out header if var_dump returns null, means, $_session['user_id'] not set

c - How to use getaddrinfo to connect to a server using the external IP? -

i'm writing small c client/server application, cannot make connection work when using external ip address. code both client , server taken here , in particular clients do: char *default_server_name = "localhost"; char *server_name = null; int nport = default_dama_port; char port[15]; // parse command line options if (parse_options(argc, argv, &server_name, &nport) < 0) { return -1; } if (server_name == null) { server_name = default_server_name; } snprintf(port, 15, "%d", nport); // connect server int client_socket; struct addrinfo hints, *servinfo, *p; int rv; memset(&hints, 0, sizeof(hints)); hints.ai_family = af_unspec; hints.ai_socktype = sock_stream; if ((rv = getaddrinfo(server_name, port, &hints, &servinfo)) != 0) { fprintf(stderr, "getaddrinfo: %s\n", gai_strerror(rv)); exit(1); } (p=servinfo; p != nu

css - Labels layout in div -

<div id="combobox"> <label><input type="checkbox" id="tag3" name="checkbox" onclick="toggletag('tag3')"/>dialogproc</label><br/> <label><input type="checkbox" id="tag2" name="checkbox" onclick="toggletag('tag2')"/>fds</label><br/> </div> i'm using div container checkboxes , labels. i'm using <br/> position 1 below another. there way have same layout without using <br/> (css)? css: #combobox label { display:block; } then remove <br /> tags

java - EasyMock: Method with a callback argument -

i have situation this: class { void methoda(callback cb) { ... cb.onresult(result); } } class b { void methodb(a a) { a.methoda(new callback() { void onresult(result r) { ... } }); } } and question is: how can test "b.methodb" different "result" easymock? you capture callback passed methoda capture<callback> cap = new capture<callback>(); mocka.methoda(capture(cap)); replay(mocka); instanceofb.methodb(mocka); callback cb = cap.getvalue(); // can call cb.onresult mocked result instance

symfony - Composer.phar "Could not rename /tmp..." -

i want install fosuserbundle added composer.json "friendsofsymfony/user-bundle": "*" executed command php composer.phar update friendsofsymfony/user-bundle , message not rename "tmp/cmpec7db/friendsofsymfony-fosuserbundle-5a4db1f/command" /home/pathtopublic_html/public_html/acme/vendor/friendsofsymfony/user-bundle /fos/userbudnle/command but find temp folder? can't see tmp folder on web server try add fos in webserver. use symfony 2.1.x , ubuntu you have create local tmp directory in project folder. here solution.

c++ - Does std::map support caching? -

for example: code1: if((iter = map.find(key)) != map.end()) { return iter->second; } return 0; code2: if(map.count(key) > 0) { return map.at(key); } return 0; code2 more simpler, both map.count() , map.at() cost o(logn) time. std::map provide feature stores last search item in cache , make searching same item faster, or perform second search in whole map? it search through whole map, there no caching being done - or @ least, standard not mandate , no implementation it, because all clients of such implementation have pay possibly undesired overhead of updating cached information after each insertion/removal. the first approach idiomatic way determine whether key/value pair contained in map (just mind fact operator -> should used instead of operator . , since find() iterator, , assignment iter should outside if condition): auto iter = map.find(key); if (iter != map.end()) { return iter->second; }

php - I'm stuck with my SELECT sql query -

i'm having problem select sql statement , haven't figured out yet. when print out results using mysql_fetch_assoc() function, repetitive rows/records. record repeated 13 times. don't know why , have done right far knowledge tells me. the following sql query: select members.member_id, members.firstname, members.lastname, billing_details.street_address, billing_details.mobile_no, orders_details.*, food_details.*, categories.*, cart_details.*, quantities.* members, billing_details, orders_details, categories, quantities, food_details, cart_details members.member_id=orders_details.member_id , billing_details.billing_id=orders_details.billing_id , orders_details.cart_id=cart_details.cart_id , cart_details.food_id=food_details.food_id , cart_details.quantity_id=quantities.quantity_id you don't have "categories" in clause. guessing have 13 categories? if need be

java - How to display a message on android? -

this question has answer here: display message on android 5 answers how can display message few seconds without using toast on android? it's possible use label case? create pop-up screen , start counter when pop-up created. when counter ends, kill pop-up. can use alertdialog.builder

why tmux panel switch is vim-like?how to change -

i begin use tmux ,and it's great ,but when split window,the default hjkl vim-like pane switch,so why? how input hjkl? here config unbind c-b set -g prefix c-q set -g default-terminal "screen-256color" set -g display-time 3000 set -g history-limit 65535 set -g base-index 1 set -g pane-base-index 1 set -s escape-time 0 setw -g monitor-activity on set -g visual-activity on set-option -g mouse-select-pane on #-- bindkeys --# bind -n m-left select-pane -l bind -n m-right select-pane -r bind -n m-up select-pane -u bind -n m-down select-pane -d unbind '"' bind-key - splitw -v unbind % bind-key | split-window -h #-- statusbar --# set -g status-justify centre set -g status-left "#[fg=green]#s:w#i.p#p#[default]" set -g status-left-attr bright set -g status-left-length 20 set -g status-right "#[fg=green]#(/usr/bin/uptime)#[default] • #[fg=green]#(cut -d ' ' -f 1-3 /proc/loadavg)#[default]" set -g status-right-attr bright set -g st

java - GWT Error: RequestFactory ValidationTool must be run -

everytime launch app "requestfactory validation tool must run..." error if listemptyboxes() not executed. have file requestfactory-apt-2.5.0-rc1.jar on annotation processing. any ideas? below code. thanks. myproject.java private void listemptyboxes() { boxrequest boxrequest = requestfactory.boxrequest(); boxrequest.listallempty().fire(new receiver<list<boxproxy>>() { public void onsuccess(list<boxproxy> response) { // list phantom boxes window.alert("successful"); } }); } boxrequest.java @service(value=boxdao.class, locator=daoservicelocator.class) public interface boxrequest extends requestcontext { request<list<boxproxy>> listallempty(); } boxdao.java public class boxdao extends objectifydao<box>{ public list<box> listallempty() { objectify ofy = objectifyservice.begin(); query<box> q=ofy.query(box.class).filter("title", null).filter("descr

reinforcement learning - Berkeley Pac-Man Project: features divided through by 10 -

i busy coding reinforcement learning agents game pac-man , came across berkeley's cs course's pac-man projects, reinforcement learning section . for approximate q-learning agent, feature approximation used. simple extractor implemented in this code . curious why, before features returned, scaled down 10? running solution without factor of 10 can notice pac-man worse, why? after running multiple tests turns out optimal q-value can diverge wildly away. in fact, features can become negative, 1 incline pacman eat pills. stands there , tries run ghosts never tries finish level. i speculate happens when loses in training, negative reward propagated through system , since potential number of ghosts can greater one, has heavy bearing on weights, causing become negative , system can't "recover" this. i confirmed adjusting feature extractor scale #-of-ghosts-one-step-away feature , pacman manages better result in retrospect question more mathsy , might

html - CSS transition out causing errors -

i have various transition effects on mouseover, such changing image opacity. want smooth transition when mouse moved off item, , added transition code normal #div ##div:hover, causing "transition" in on page load in rather unsightly manner (doesn't work when refreshed, on first instance of page load) , wondering whether there's equivalent javascript's mouseout function transition not occur on page load. here example of of css: #main_categories_item_image img { width: 64px; height: 64px; -webkit-transition: .5s; -moz-transition: .5s; transition: .5s; box-shadow: #000 0em 0em 0em; } #main_categories_item:hover #main_categories_item_image img { opacity: 0.7; -webkit-transition: .5s; -moz-transition: .5s; transition: .5s; } and i'm working on website www.ultimate-punch.com many thanks

java - Stax parser fails to read files with encoding UTF-16 -

i using stax parser read xml file inside common api in app. api takes inputstream parameter , doing below public object <commonapi>(inputstream is) xmlinputfactory inputfactory = xmlinputfactory.newinstance(); xmleventreader reader = inputfactory.createxmleventreader(is); try{ while (parser.hasnext()) { xmlevent event = parser.nextevent(); // reaming parsing logic } } catch (exception e){ e.printstacktrace(); } } the issue works if encoding in xml file utf-8. if utf-16, doesn't read properly..gives following exception javax.xml.stream.xmlstreamexception: parseerror @ [row,col]:[1,41] message: content not allowed in prolog. i can't change signature of common api. need operate on inputstream.. suggestions? use createxmleventreader(inputstream stream, string encoding) utf-16 encoding .

ruby on rails - Using crc32 tweak on has_many relations in Thinking Sphinx -

it's weird actually. have 2 models have has_many relation each other, here models #model city class city < activerecord::base belong_to :state end #model state class state < activerecord::base has_many :city end and have state index thinkingsphinx::index.define 'state', :with => :active_record indexes state_name, :sortable => true #here problem has "crc32(cities.city_name)", :as => :city_name, :type => :integer end i want use city_name filter. code above doesn't work , got error message when run rake ts:index here error message error: index 'state_core': sql_range_query: unknown column 'cities.city_name' in 'field list' but, when put city_name in indexes block below, indexer runs well! thinkingsphinx::index.define 'state', :with => :active_record indexes state_name, :sortable => true indexes cities.city_name has "crc32(cities.city_name)", :as => :city_name,

c++ - Cannot dynamic cast when using dynamic_pointer_cast -

why code not work? std::shared_ptr<event> e = ep->pop(); std::shared_ptr<trackerevent> t; t = std::dynamic_pointer_cast<trackerevent>(e); i following error: /usr/include/c++/4.6/bits/shared_ptr.h:386: error: cannot dynamic_cast '(& __r)->std::shared_ptr<event>::<anonymous>.std::__shared_ptr<_tp, _lp>::get [with _tp = event, __gnu_cxx::_lock_policy _lp = (__gnu_cxx::_lock_policy)2u]()' (of type 'class event*') type 'class trackerevent*' (source type not polymorphic) trackerevent inherits event guess problem can't cast in direction. ep->pop() might either return object of type event or trackerevent . , hoping when try cast trackerevent , returns null know whether have event or trackerevent ... how that? the compiler telling going on @ end of message: (source type not polymorphic) your event base class needs have @ least 1 virtual member function (i.e. polymorphic type ) i

c# - How to return true if one of 4 bools is true -

i trying realise method, returns true, if 1 of several bools true. bool = false; bool b = false; bool c = true; bool d = false; private bool oneofthem() { return && b && c && d; } this doesn't work. how make work? use or ( || ) instead of && operator....... || operator (c# reference) - msdn the conditional-or operator (||) performs logical-or of bool operands. if first operand evaluates true, second operand isn't evaluated. if first operand evaluates false, second operator determines whether or expression whole evaluates true or false.

php - Login page with mysql select where statment -

i have simple login page, on top simple form validations if , elseif statments. want write mysql select statement below validation code (elseif) statment. if email , password = email , password on database table record, redirect use secured page, , final (else) show error if email or password don't exist or match in database. i don't know how right way, attempt doesn't work: <?php require_once("includes/connection.php"); ?> <?php require_once("includes/functions.php"); ?> <?php $email = $_post['email']; $hashed_password = md5($_post['password']); if (isset($_post['submit'])) { // form has been submitted. if ($_post['email'] == "") { $error = "email address required"; } elseif (!(filter_var($_post['email'], filter_validate_email))) { $error = "invalid email address"; } elseif ($_post[&#

Pass option multiple with jQuery Chosen plugin to PHP form -

i have html form. have jquery animation (dialog popup , validation) sends data form.php . my problem: email name, email , phone, 1 option passed. can't multiple choices... can me please? so here code: html <form class="form_class" id="form_id" method="post" name="contactform" action="form.php"> <label for="nom">name</label> <br/> <input name="nom" type="text" id="nom" /><br/> <label for="email">email</label> <br/> <input name="email" type="text" id="email" /><br/> <label for="tel">phone</label> <br/> <input name="tel" type="text" id="tel" /><br/> <select multiple="multiple" name="beats[]" data-placeholder="choose beats" id="beats" style="

pointers - C++ Segmentation Fault - Core Dumped -

i've been having issue while , i've searched type of error , believe has memory leak or pointer pointing nothing. i've checked code on , on again , i'm not able find issue occurring don't know how debug it. if try , breakpoint first line of code, crash. it reading bunch of isbn's file , checking if they're valid or not. although may seem it's lot, logic simple. here code: #include <iostream> #include <fstream> #include <iomanip> #include <list> #include <ctype.h> #include <string.h> #include <stdlib.h> #include <vector> using namespace std; class isbn { private: string isbncode; public: isbn() { } isbn(string isbn): isbncode(isbn) { } ~isbn() { } string getisbn() { return isbncode; } void setisbn(string input) { isbncode = input; } }; void setlistofisbn(const string filename, lis

sqlite - In sqlite3, is there a foreign_key integrity check? -

i'm teaching myself sqlite , surprised see foreign_key constraint not working when able delete parent entry. learned after reading more pragma foreign_key off default each session. seems odd there isn't resource file (something .exrc vi example) can use setup pragmas default each session, fine. have recompile sqlite3 or set every time. anyway, question is, after deleted parent, there way post integrity check on foreign key constraints? i.e. tell sqlite run same logic runs when if had pragma turned on @ time of insert or delete etc? i see "pragma integrity_check" that's looking corruption seems. thanks, justin beginning sqlite 3.7.16, there pragma foreign_key_check .

c++ - Including <map> causes compilation error with g++ 4.6.2 -

i'm getting strange compilation error, cannot explain. following code minimal example, getting me error: #include <map> int main() { return 0; } the problem is, i'm gettin error because of including map-header file: p:\mingw\bin\../lib/gcc/mingw32/4.6.2/include/c++/bits/stl_map.h:109:15: error: 'map' not template p:\mingw\bin\../lib/gcc/mingw32/4.6.2/include/c++/bits/stl_map.h:162:48: error: declarations of constructors can 'explicit' p:\mingw\bin\../lib/gcc/mingw32/4.6.2/include/c++/bits/stl_map.h:172:17: error: 'map' not name type p:\mingw\bin\../lib/gcc/mingw32/4.6.2/include/c++/bits/stl_map.h:252:7: error: 'map' not name type p:\mingw\bin\../lib/gcc/mingw32/4.6.2/include/c++/bits/stl_map.h:693:12: error: 'map' not type p:\mingw\bin\../lib/gcc/mingw32/4.6.2/include/c++/bits/stl_map.h:856:26: error: 'map<_k1, _t1, _c1, _a1>' not name type p:\mingw\bin\../lib/gcc/mingw32/4.6.2/include/c++/bits/stl_map.h:

cross browser - Intermittent Internet Explorer Compatibility Mode Issues -

has encountered issues internet explorer 8 (on windows xp/7) , 9, , 10 (windows 7/8) intermittently switching compatibility mode? we did redesign of our application utilizes css3, html5, , angular.js. may irrelevant, had html5 elements , css3 styling before redesign everywhere. this issue occurs when user logs our site our login page or marketing site. once user logged in compatibility mode stays. visually breaks bunch of css , happens randomly , hard reproduce clients have logged enough bugs me know issue. session or network issue? our doctype html5 , not use meta tag ie-edge. used have in head of document removed tag (after these bugs popping up) seems have no effect except ie still intermittent switches compatibility mode , ie8 on xp crashes less. microsofts docs not helpful on this. need figure out how fix can't share url (due product restrictions). tried moving location of meta tag, switching html5 shivs (currently have afarkas ie8 branch , loads in ie8. ie

java - Return generic list -

i want load generic list. therefore want use function : public static <t> list<t> load() { fileinputstream filestream = null; list<t> toreturn = new arraylist<t>(); string fileextension = toreturn.getclass().getcomponenttype().getsimplename(); ... } if can see want type ("t"), search files these extensions. if call : storageutil.<myclass>load(); i exception instead of getting "myclass" fileextension. what's wrong on code? the problem generics in java don't work way - can't find type of t @ execution time due type erasure . if need type @ execution time, can add class<t> parameter: public static <t> list<t> load(class<t> clazz) { ... use class.newinstance() create new instance, etc } see java generics faq entry type erasure more information.

jquery - Forcing to run a custom function befor run the assigned event handlers of an element -

imagine jquery plugin insert element (such image) page , image has event handler click event. example when click image open 1 popup div. an other hand wrote function in page. example function slow fade textbox (input tag). so have: a jquery plugin an image added jquery plugin -->>> id ="myimage" click event of image causes --->> popup div an input tag --->> id="myinput" my function hide input --->> hideslowinput() important note: don't want change plugin. want override event handler of image without change plugin. edit: have not codes open popupdiv, start plugin in $(document).ready now, how can force open popup div after running function every time click image??? following @ejay's comment this not possible, @ least, not publicly supported in documentation {nothing can find...} but if plugin talking using jquery bind open popup div handler, can try this: //declare function function myfunction(

java - how to get wordNet lexical categories ( noun categories and verb categories ) using JAWS pacakage -

if have array list of words (string). want lexical category of every word. word net has noun categories, verb categories , others. want category of each word. how in java using jaws. have @ referencesynset.getlexicalfilenumber . yield integer corresponds category listed in man lexnames man page.

javascript - Fade between DIVS -

trying make fading effect between multiple divs. not working, please can me "im new in javascript" demo generate code. in demo code work when copy code, stop working. hope question clear ! thanks code try copy. <script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script> <script> txt1 = $("#contentarea-1").text(); txt2 = $("#contentarea-2").text(); $("#pg1").on('click', function () { $('#contentarea-2').hide(); $('#contentarea-1').fadeout(500, function () { $("#contentarea-1").hide(txt2); $('#contentarea-1').fadein(500); }); }); $("#pg2").on('click', function () { $('#contentarea-1').hide(); $('#contentarea-2').fadeout(500, function () { $("#contentarea-2").text(txt2); $('#contentarea-2').fadein(500); }); }); </s

c# - How to convert stream reader response to a class object? -

i working on functionality makes httppost response. here's code i'm working with: public string submitrequest(string posturl, string contenttype, string postvalues) { var req = webrequest.create(posturl); req.method = "post"; req.contenttype = contenttype; try { using (var reqstream = req.getrequeststream()) { var writer = new streamwriter(reqstream); writer.writeline(postvalues); } var resp = req.getresponse(); using (var respstream = resp.getresponsestream()) { var reader = new streamreader(respstream); return reader.readtoend().trim(); } } catch(webexception ex) { // here } return string.empty; } the function returns xml in string format, instance: <result> <code>failed</code> <me

html - PHP: Trouble composing strings -

i'm using php code echo " onclick='myfunction(" . $row['username'] . ")'" that give me result onclick="myfunction(francis88)" but want this: onclick="myfunction('francis88')" how should change php code obtain this? use \ escape character within string, example: echo " onclick=\"myfunction('" . $row['username'] . "')\""

html - DIV element does not cover all of its content -

Image
i have issue div on page. it's 1 have, , covers middle of page. few tweaks in css, made go way down. the problem though, video(which inside div element), sneaking out so: here's html: <html> <head> <link rel="shortcut icon" href="images/favicon.ico" /> <link rel="stylesheet" type="text/css" href="style.css" media="screen" /> <title>arthur</title> <meta content="text/html" charset="windows-1251"> </head> <body background="images/background2.jpg"> <a href="main.html"><img class="imgborder" src="images/button.png" align="left" height="50"></a> <div id="wrapper" style="background-color:black; width:60%; margin-left: auto ; margin-right: auto ;"> <center><img width="60%" src="images/logo2.png&qu

html - long data extending the limit of div -

i having problem keeping long data within divs boundary. here demo facing problem: <html> <head> <style> #main { width: 500px; margin:50px auto; } #data { width:500px; height:500px; border: 1px solid #000000; } </style> </head> <body> <div id="main"> <div id="data"> testtesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttest </div> </div> </body> here make div width 500px fix still data extending div boundary. is there solution when data reaches max width remaining data displayed in next line? you can use word-wrap:break-word; if you'd text keep inside div , appear on next line. jsfiddle

C++ Qt return empty QString -

i made function returns qstring . @ points in function should return empty qstring . just returning "" doesn't work. when use qstring::isempty() it's not. "emergency plan" return "empty" string , check whether text "empty". don't think that's style. so how return empty qstring ? the idiomatic way create empty qstring using default constructor, i.e. qstring() . qstring() creates string both isempty() , isnull() return true . a qstring created using literal "" empty ( isempty() returns true ) not null ( isnull() returns false ). both have size() / length() of 0.

php - Display selected text file from dropdown list in html page -

good day have looked around , found helpful hints , code populate dropdown list availible text files in directory, problem display contents of text file comma delimited file table coloums. on linux server. question is: can difficult? i'm using scandir check txt files , populate dropdown list, how selected file displayed? put code can, i'm asking if possible , if is, should start? php?javascripting? input!

javascript - error while using async in node.js -

i trying write restapi using express framework , node.js. facing error unable find out root cause. getting following error while trying execute code : typeerror: cannot read property 'node_type' of undefined 'node_type' value comes function var gdbprocess = require('../../dao/gdb/processnds') var mongo = require('mongodb'); var async = require('async'); exports.executeservice = function(req,res){ //make process object query var manualprocessquery = new object(); manualprocessquery.index = req.params.processmap; manualprocessquery.key = "pid"; manualprocessquery.value = req.params.pid; manualprocessquery.event = req.params.event; var tempdatanodetoexecute = new object(); //this function returns object (datanodetoexecute) execute gdbprocess.getparametersbynode(manualprocessquery,function(err,datanodetoexecute){ if(err) res.send(err); tempdatanodetoexecute = datanodetoexecute; var issystem = false; if (tempdata

c# - LookUpEdit not selecting newly entered value when it's a double -

i have 2 lookupedit controls devexpress on form. both use observablecollection it's datasource, 1 being of type string , other of type double . lookupedit control has event called processnewvalue fires when, guessed it, new value entered in control. i've added code in event add newly added value observablecollection , automatically selects once done. works expected string looupedit when try double lookupedit`, adds collection clears out control. here's code load controls, gets called in form_load() : void initcontrols() { double[] issuenumbers = new double[5]; issuenumbers[0] = 155; issuenumbers[1] = 156; issuenumbers[2] = 157; issuenumbers[3] = 158; issuenumbers[4] = 159; observablecollection<double> issues = new observablecollection<double>(issuenumbers); lookupissues.properties.datasource = issues; devexpress.xtraeditors.controls.lookupcolumninfocollection col

javascript - How to cycle between two arrays -

Image
i'm trying create cycling sliding animation set of elements, have 2 arrays: var elms = [elm1, elm2, elm3]; var props = [{x,y,width,height,z-index,opacite,....}, {....}, {....}]; on initializing, elms positioned in same order props : " -> not part of syntax it's make things easier explain , means 'do with'" elms[0] -> props[0]; emls[1] -> props[1]; elms[2] -> props[2]; but want cycle them like: elms[0] -> props[2] elms[1] -> props[0] elms[2] -> props[1] and then: elms[0] -> props[1] elms[1] -> props[2] elms[2] -> props[0] and forth... i tried this: function index(n, array){ var m = n; if(n > array.length){ m = n - array.lenth; }else if(n < 0){ m = array.length + n; } return m; } var active = 0; //the front element function slide(direction){ (i=0; i< elms.length; i++) { elms[i] -> props[index(i - active, props)] } if(direction == &#

How can I get hourly weather forecast in VB.net? -

i've seen questions similar on here, none of them seem me. don't care api used, google, yahoo!, weather channel, or other. i've got code high , low of current day, based on location given user, can't seem hourly predictions temperature or weather condition, i'm looking for. don't care wind speeds, humidity, or "feels like" temperature, though i'll add them if can figure out how to. i'm trying data here. (www.weather.com/...) i'm pretty new parsing xml may part of problem, too. in advance help. appreciate it. i have might enjoy: <runtime.compilerservices.extension()> module weather public structure weatherinfo_forecast dim dayofweek string dim low double dim high double dim icon string end structure public structure weatherinfo_wind dim direction string dim speed double dim unit string end structure public structure weatherinfo_typed dim failed boolean dim errormessage exception dim location stri

python - finding target recipient in email -

This summary is not available. Please click here to view the post.

antivirus - How do AV engines search files for known signatures so efficiently? -

data in form of search strings continue grow new virus variants released, prompts question - how av engines search files known signatures efficiently? if download new file, av scanner rapidly identifies file being threat or not, based on signatures, how can quickly? i'm sure point there hundreds of thousands of signatures. update: tripleee pointed out, aho-corasick algorithm seems relevant virus scanners. here stuff read: http://www.dais.unive.it/~calpar/aa07-08/aho-corasick.pdf http://www.researchgate.net/publication/4276168_generalized_aho-corasick_algorithm_for_signature_based_anti-virus_applications/file/d912f50bd440de76b0.pdf http://jason.spashett.com/av/index.htm aho-corasick-like algorithm use in anti-malware code below old answer. still relevant detecting malware worms make copies of themselves: i'll write of thoughts on how avs might work. don't know sure. if thinks information incorrect, please notify me. there many ways in avs detec