Posts

Showing posts from September, 2010

c++ - Error found by Dr.Memory: don't know how to fix it -

is there can such error found dr. memory? error #xxx: invalid heap argument: allocated operator new, freed free std::_debugheapdelete<std::locale> ??:0 std::ios_base::_ios_base_dtor ??:0 std::ios_base::~ios_base ??:0 std::basic_ios<char,std::char_traits<char> >::~basic_ios<char,std::char_traits<char> > ??:0 std::basic_stringstream<char,std::char_traits<char>,std::allocator<char> >::`vbase destructor' ??:0 some_namespace::some_function() some_source.cpp(60): note: memory allocated here: note: std::ios_base::_init ??:0 note: std::basic_ios<char,std::char_traits<char> >::init ??:0 note: std::basic_istream<char,std::char_traits<char> >::basic_istream<char,std::char_traits<char> > ??:0 note: std::basic_iostream<char,std::char_traits<char> >::basic_iostream<char,std::char_traits<char> > ??:0 note: std::basic_stringstream<char,std::c

c++ - Pass template args by const& or && -

i have example program: #include <iostream> template<typename message, typename decoration, typename printimpl> void print_surrounded(message&& msg, const decoration& decoration, const printimpl& print_impl) { print_impl(decoration); // should forward used? print_impl(" "); print_impl(std::forward<message>(msg)); print_impl(" "); print_impl(decoration); } template<typename message, typename printimpl> void pretty_print(message&& msg, const printimpl& print_impl) { print_surrounded(std::forward<message>(msg), "***", print_impl); } int main() { pretty_print("so pretty!", [](const char* msg) { std::cout << msg; }); } i posted on coliru. as can see use different ways pass arguments: message passed universal reference because needs forwarded printimpl function. decoration passed const ref here because value used twice , i'm not

c++ - Protecting private member return by reference from accidental reassignment -

i have following function prototype: virtual cbuffer& getdata(unsigned int& samples, unsigned int& stride); this returns reference cbuffer object private member of class. the problem if following written, internal private member method returns reassigned. cbuffer& cplug::processdata(unsigned int& samples, unsigned int& stride) { /* data source */ cbuffer& buffer = m_source.getdata(samples, stride); if (m_postprocess) buffer = postprocess(buffer, samples, stride); return buffer; } obviously can fixed doing following: cbuffer& cplug::processdata(unsigned int& samples, unsigned int& stride) { /* data source */ cbuffer* buffer = &m_source.getdata(samples, stride); if (m_postprocess) buffer = &postprocess(*buffer, samples, stride); return *buffer; } but want know if there way prevent this, possibly through use of const unaware of? at point of opinion should convert using pointers, nice know if d

javascript - how to retrieve html5 form values -

am working on html5 form. am having problems when comes on retrieving values drop down lists,time , values have spaces. for drop down lists | converted %7c, time : converted %3a , or pm not shown while spaces converted +. there way retrieve form values way appear users. if forced convert them there original values using regular expression,which ones work above problems am new jquery spare me if there ambiguity in question in advance. below sample code of project. **switch (questiontype) { case "vtfh44uf34f4fh3": //textbox $('#variables').append($('<input id="' + variableid + '" name="' + variableid + '" required type="text" data-mini="true" placeholder=""/>')); $('#variables').trigger('create'); break; }** above code how creating controls dynamically. **function showvalues() { var str = $("f

r - plm::pgmm() Error in yX[[1]] : subscript out of bounds -

in r, encountering error using pgmm() function in plm package can't resolve through debugging. here call results in error: emp.gmm = pgmm(growth ~ lgdp_pc + lschool | lag(lgdp_pc,2), data=temp1.subset, effect='twoways', model='twosteps') the error message is: error in yx[[1]] : subscript out of bounds in addition: warning message: in `[.data.frame`(index, as.numeric(rownames(mf)), ) : nas introduced coercion this structure of data frame temp1.subset, using dput() : structure(list(growth = structure(c(nan, nan, nan, nan, -0.000154495239257812, -0.0161255836486816, -0.0161551475524902, 0.0574196815490723, 0.0497237205505371, 0.0457057952880859, nan, nan, -0.0703577995300293, 0.0167842864990234, -0.0930408477783203, -0.0327302932739258, -0.0194591522216797, -0.00672683715820313, 0.0186029434204102, 0.0169768333435059, 0.0181658267974854, 0.0245670318603516, 0.0144176483154297, 0.0118904113769531, -0.0398967742919922, -0.0192060470581055

seek() equivalent in javascript/node.js? -

i m trying read files fs module node.js. since lack tot of function m used (fseek(), getline()...), m creating module them back. (a node.js copy of c stdio.h). my simple question is: does seek() exist in other name or need remplement every function have it? in node.js seek , read functions one. when use fs.read function, there parameter called position , works "seek position". if want write file, function fs.write has position parameter. check docs here: https://nodejs.org/api/fs.html#fs_fs_read_fd_buffer_offset_length_position_callback

Configuring apache solr online -

i want use apache-solr indexing , searching in java application. don't know how configure online. can copy solr directory in root folder,but don't know copy directory containing solrconfig file,core etc. hoping solution. in advance. you can keep config files , core directories in same directory structure. beware, store index files (configured in datadir parameter of solrconfig.xml) don't overrun disk capacity.

c# - How to add event handler for dynamically created controls at runtime? -

i working on c# windows application. application controls(button,text box,rich text box , combo box etc)from custom control library , placed them form dynamically @ run time. how create event handler controls using delegate? , how add business logic in particular custom control click event? for example: i have user1, user2, user3, when user1 log in want show "save" button. when user2 show "add , delete" buttons , user 3 show "add , update" buttons.text boxes , button created per user log in information taken db tables.in scenario how handle different event(adding,saving,updating,deleting) button save,add,delete , update different users when form dynamically created controls(save,add,delete , update button object same button class) var t = new textbox(); t.mousedoubleclick+=new system.windows.input.mousebuttoneventhandler(t_mousedoubleclick); private void t_mousedoubleclick(object sender, mousebuttoneventargs e) { throw new notimplem

Array in javascript not working in the right way? -

i have strange problem , should solved in less 1 minute. can't understand why not working. i have bidimensional array "gridship" , i'm doing stuff array. this code: gridship[i][j].stat = "ship"; gridship[i][j+1].stat = "ship"; gridship[i][j-1].stat = "ship"; after print in console 3 cell of array. the first working, third 1 no! have no errors , check if don't out of array size. make no sense me. that works me var i=0; j=1; var gridship = []; gridship[i] = [{},{},{}]; gridship[i][j].stat = "ship"; gridship[i][j+1].stat = "ship"; gridship[i][j-1].stat = "ship"; tell more details.

Generating a random number within range of 0-9 in x86 8086 Assembly -

first of all, new 8086 assembly , has been pretty difficult me grab knowledge. nevertheless, i'll best. i have been trying write code generate random number within range of 0-9. after looking several examples , suggestion, ended with. did not apply mathematical function on retrieved clock count, simplicity , thought unnecessary. ended with, reasons, generating number 6,7 fewer times numbers such 1,3 , 9. believe because i'm taking lower order of clock ticks, values change rapidly. my purpose simulate dice roll later ill change range of below codes 1-6. question is, adequate enough purpose? or there better way this? codes: randgen: ; generate rand no using system time randstart: mov ah, 00h ; interrupts system time int 1ah ; cx:dx hold number of clock ticks since midnight ; lets take lower bits of dl start.. mov bh, 57 ; set limit 57 (ascii 9) mov ah, dl cmp ah, bh ; compare value in dl, ja ra

android - Send seekbar's values instead of text string -

i'm developing app based on bluetoothchat example have main activity 2 buttons: 1. find devices 2. configuration with first button search devices same code in mentioned example. with second button, enter activity have 3 seekbars textviews under each 1 showing current seekbar's value. what need modify bluetoothchat example's code send array 3 values instead of text. this code of activity i'm trying develop this. how can this? /********************* * * oncreate * ********************/ @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.configuration); bar1 = (seekbar)findviewbyid(r.id.fastbar); bar1.setonseekbarchangelistener(this); progress1 = (textview)findviewbyid(r.id.out1); bar2 = (seekbar)findviewbyid(r.id.climbbar); bar2.setonseekbarchangelistener(this); progress2 = (textview)findviewbyid(r.id.out2); bar3 = (seekbar)findviewbyid(r

internet explorer - Differences between IE 8 and IE 8 Compatibility View Browser Modes? -

since found out can't force ie 8 browser mode intranet sites if "display intranet sites in compatibility view" mode ticked (regardless of x-ua-compatible headers or metatags), i'm trying assess impact of running ie 8 compatibility view browser mode. (with ie 8 standards document mode) can advice or there resource somewhere can tell me differences there between these 2 browser modes? speaking bad experience, ie 8 compatibility mode can introduce issues layout , page behavior. switching versions of jquery or css workarounds not solve issues. msdn blog post contains overview of ie 8 compatibility mode issues , suggested resolutions. blog post contains more developer-centric tips beyond msdn post.

validation - How to validate input value in a TextField in Java ME -

i writing simple srms, , need validate input user if matches criteria depending on field, e.g. email field or phone field. app run in featured phone , using java me sdk virtual machine testing. what best way so, best way validate input , if input not meet criteria, should user notified or value has entered set null again. public void name() { boolean namevalid = false; display = display.getdisplay(this); nameform = new form("student record management (1/4"); textfield firstname = new textfield("first name(s)", "", 20, textfield.any); textfield lastname = new textfield("last name", "", 20, textfield.any); textfield personnumber = new textfield("person number", "", 10, textfield.numeric); = new command("back", command.back, 1); next = new command("continue", command.item, 2); nameform.append(firstname); nameform.append(lastname); nameform.append(

iis 7 - Windows 2008 R2 IIS7 windows authentication not working -

i have dev , prod windows 2008 r2 servers iis7 , siteminder, far can tell setup same. issue being production websites work development ones not. issue being when navigate dev website, says "the page cannot displayed because internal server error has occured." not challenge in dev (which believe cause of issue), in prod. goes classic asp pages or asp.net pages. some findings :- - iis has windows authentication enabled , others disabled - windows authentication provider negotiate (tried negotiate:kerberos, same result) - windowsauthentication , windowsauthenticationmodule (native) both present in modules - windowsauthentication installed under server manager -> iis -> roles - upon receipt of above error message, iis logs shows access error 401 2 5 all solutions found online either not have right setup above, or suggests disable windows authentication , enable anonymous authentication. if so, works fine issue being websites require windows authentication ide

nginx - gitlab wrong API path -

i have nginx config gitlab provided: upstream gitlab { server unix:/home/git/gitlab/tmp/sockets/gitlab.socket; } server { listen 80; # e.g., listen 192.168.1.1:80; in cases *:80 idea server_name myserver; # e.g., server_name source.example.com; root /home/git/gitlab/public; # individual nginx logs gitlab vhost access_log /var/log/nginx/gitlab_access.log; error_log /var/log/nginx/gitlab_error.log; location / { # serve static files defined root folder;. # @gitlab named location upstream fallback, see below try_files $uri $uri/index.html $uri.html @gitlab; } # if file, not found in root folder requested, # proxy pass request upsteam (gitlab unicorn) location @gitlab {... but message when push: open() "/usr/local/nginx/html/api/v3/internal/allowed" failed (2: no such file it must "/home/git/gitlab/public/api.... how can fix it? try changing listen *:80; , restart nginx , see if persists.

Magento setting up coditional sale on products -

ok need know if following possible do, lets have product called a, want other products lets x , y on sale, can buy x , or y if purchased a. is there way 1 can achieve this? firstly, need segregate 2 set of products i.e (type 1 : product (can purchased without dependent product) , type 2 : product x , y (needs have product in cart). segregation can best done defining attribute job. let's create attribute sell individually , set yes product , set no product x , y. now, need listen event : checkout_cart_save_before, in observer write code control whether particular product can added cart or not. you can refer link read more using magento events , observer.

Sqlite syntax error, please tell me where it is? -

can guys please point me error? and, way, there sqlite syntax highlighter? thanks. sqlite> .schema recordtypes create table recordtypes (record_id text primary key); sqlite> .schema headers create table headers (header_id text primary key); sqlite> sqlite> sqlite> create table record_to_headers (id integer, recordid text, foreign key(recordid) references recordtypes(record_id), headerid text, foreign key(headerid) references headers(header_id)); error: near "headerid": syntax error i believe need define field then map them foreign keys, so: create table record_to_headers (id integer, recordid text, headerid text, foreign key(recordid) references recordtypes(record_id), foreign key(headerid) references headers(header_id)); let me know if works.

python - How to specify which DIR is to be used by haystack and whoosh during index-building -

i trying index mysql data whoosh using haystack root partition full way specify dir used haystack , whoosh during indexing data. uses /tmp/ dir during process how can change dir else.. know best way increase root partition looking alternative .... i found setting.. maybe helps you: whoosh_storage_dir = '/data/whoosh' apart that, found a script snippet might change '/tmp/' directory. i not familiar projects.. thought might share found. ;)

css - Vertically aligning text next to a radio button -

this basic css question, have radio button small text label after it. want text appear centered vertically text aligned button of radio button in case. <p><input type="radio" id="opt1" name="opt1" value="1" />a label</p> here jsfiddle: http://jsfiddle.net/una6j/ any suggestions? thanks, alan. use inside label . use vertical-align set various values -- bottom , baseline , middle etc. http://jsfiddle.net/una6j/5/

php - inputting image links into mysql -

so i've hit bit of snag. i'm working on form uploads image file ftp , creates entry mysql link image column used organize , order images. i'm getting following error: you have error in sql syntax; check manual corresponds mysql server version right syntax use near 'order) values( '', '../tattoo/1.jpg', '6')' @ line 1 i have tried placing '' around values , not , still same message. i'm sure solution simple , i'm tired , have been staring @ long. here code <?php // configuration - options $allowed_filetypes = array('.jpg','.gif','.bmp','.png'); // these types of file pass validation. $max_filesize = 524288; // maximum filesize in bytes (currently 0.5mb). $upload_path = '../tattoo/'; // place files uploaded to. $filename = $_files['userfile']['name']; // name of file (including file extension). $ext = substr($filena

django - Sublime Text 2. Autocomplete python `from` -

i using sublimerope plugin. when typing from foo.b displays autocomplete dialog random crap looking recognize bar module inside foo package. if type from foo import b suggest me import bar module. means rope "knows" module. how can configure sublime me suggest imports when from foo.b ? i doing projects django real example wont me autocomplete from django.contrib. if type from django.contrib.auth.models import u suggest me import user. you should using sublimejedi python autocompletion! there's no way around jedi awesomeness. this sublime plugin jedi library (which better rope, i'm biased because i'm author).

updating records in sugarcrm through soap API -

what have done? when add content drupal appear in sugarcrm , can done set_entry. what want? when edit data in drupal reflect on sugarcrm , it`s vice versa. facing prblem? i don`t how can done, weither function set_entry present update data or not in soap api of sugarcrm. please give me suggestion. yes set_entry exists , documentation can found @ sugarcrm api documentation a call via smalltalk/javascript rest version of api like: setentryfor: amodule values: anamevaluelist do: ablock | params | params := dictionary new at: 'session' put: self sessionid; at: 'module_name' put: amodule; at: 'name_value_list' put: anamevaluelist; yourself. jquery ajax: self url,'rest.php' options: #{ 'jsonp' -> 'jsoncallback'. 'data'-> (hashedcollection new at: 'method' put: 'set_entry'; at: 'input_type' put: 'json'; the soap api

In Outlook 2003, get display name of additional mailboxes and PSTs -

i've written piece of code: set ooutlook = createobject("outlook.application") set omapi = ooutlook.getnamespace("mapi") wscript.sleep 3000 each ostore in omapi.stores if ostore.exchangestoretype = 1 msgbox ostore.displayname end if next it gives me names of additional mailboxes in outlook 2010. if set exchange store type 3, return used pst names. i achieve same outlook 2003 (only display names well). unfortunately, there in 2003, store object not exist. i've searched internet , found quite complicated "solutions" this. i've tried reproduce of them never got anywhere close succeeding. want displayed name of additional mailboxes , pst files... that's it, in outlook 2003. now question: - possible achieve natively under xp / outlook 2003? - i'm fine additional mailboxes if pst files complicated i thank in advance! quite important matter me :) appreciate help. i don't need full solution maybe knowl

How to integrate sharepoint web part? -

i new sharepoint development. i have download '.wsp' file resides in c:\slideshow.wsp want use file in site web part. searched on internet integrate , found many solution through power shell script using command.. add-spsolution -literalpath not working in case. i executed commannd `add-spsolution -literalpath "c:\slideshow.wsp" gives error.. how integrate it? please help. go under page want add it: settings->site settings->solutions->upload solution or powershell make sure: started sharepoint 2010 manangement console started administrator for farm solutions use: add-spsolution c:\slideshow.wsp for sandbox solutions use: add-spusersolution c:\slideshow.wsp

xna - Packing a 16-bit floating point variable into two 8-bit variables (aka half into two bytes) -

i code on xna , has access shader model 3, hence no bitshift operators. need pack 2 random 16-bit floating point variables (meaning not in range [0,1] random float variable) 2 8-bit variables. there no way normalize them. i thought doing bitshifting manually can't find article on how convert random decimal float (not [0,1]) binary , back. thanks this not idea - 16-bit float has limited range , precision. remember 8-bits leaves 256 possible values! getting 8-bit value shader trivial. colour 1 method. can use each channel normalised range, 0 1. of course, don't want normalise values. assume want maintain nice floating-point property of wide range better precision closer zero. (now time read background info on floating-point . half-precision floating-point , minifloats and microfloats .) one way encode values using logarithm , exponent (to encode , decode, respectivly). floating-point format does. exact maths depend on precision , range desire - (which 25

android - Delete specific Alarm from AlarmManager -

i want delete alarm have set in broadcastreceiver. how should execute: i receive gcm message, contains user_state field. if user_state 0 no notification triggered if user_state 1 notification triggered if user_state 2 alarm set , notification triggered 20 minutes later. this works well. now want delete specific alarm, depending on data received gcm-intent. unfortunately alarmmanager.cancel() not compare fields. tried use intent.settype("data compare") if set field broadcast not received... i have tried register new broadcastreceiver data should compared in action field. understand, should work fine, not possible register broadcastreceiver within broadcastreceiver. also not possible list of pendingintents alarmmanager. can delete alarms - not option, the other idea have using own service instead of alarmmanager... avoid one. don't want use resources when there buildin option. here set alarm method: private void settimed(intent intent, notify notify)

PHP: special character as key in array -

my problem use special character & key , seems not work my array this $legalforms = array( 'gmbh & co.kg' => array( 'namestosubmit' =>array( 'companyname'=>'required', 'location'=>'required', 'phone'=>null, 'fax'=>null, 'web'=>null, 'registrycourt'=>'required', 'registrynumber'=>'required', 'companynameassociate'=>'required', 'locationassociate'=>'required', 'registrycourtassociate'=>'required', 'registrynumberassociate'=>'requuired', 'ceo'=>'required' ), ) ) and when want use namestosubmit error property of nametosubmit

How to check if the document is ready in JavaScript? -

i developing simulator simulate user actions in web page. in special case, there few number of buttons in page clicking on each changes content of page. programmatically click on each button , want extract new content added page. if have at: http://www.elementbars.com/build-a-bar-service.aspx# you can find example. my code this: for (var int i=0; i< buttonarray.length; i++){ // buttonarray array of buttons triggerclickevent(buttonarray[i]); extractnewcontent(); } function triggerclickevent (clickableelement) { jquery(clickableelement).trigger('click'); } both triggerclickevent , extractnewcontent working, problem after triggering click event, javascript engine should wait while make sure new content added, not behave expected. example, noticed buttons clicked, extractnewcontent extracts content first button, meaning these 2 functions not working synchronously. used settimeout function, since not block execution, not resolve problem. used functio

json - JQuery Autocomplete array of objects -

i'm using spring mvc , try send array of objects controller use int jquery autocomplete. have managed array list<string> . can't work array of objects. need label , value different strings in jquery autocomplete. i want following, according autocomplete jquery ui: [ { label: "label1", value: "value1" }, ... ] i have managed working within js var obj = jquery.parsejson('[{"label":"label1","value":"value1"},{"label":"label2","value":"value2"}]'); but when create in controller can't send string autocomplete (due success in autocomplete not trigger , response(data) not run). try creating below. @requestmapping(params = {"type=itemtype"}) public @responsebody list<dataobject> returnitemtype(@requestparam("itemtype") string itemtype) { list<dataobject> objlist = new arraylist<dataobject>(); objlist.add

libArchive modify data in .zip file -

i try modify( in memory ) 1 file in zip archive. not understand how it i read source file memory not understand next can give mу example how can this why, here's simple c++11 example, replacing file , adding new file: // g++ -std=c++11 -wall -g -o3 -fno-inline-functions pack.cc -o pack -larchive #include <iostream> using std::cout; using std::cerr; using std::endl; #include <memory> using std::shared_ptr; using std::unique_ptr; #include <string.h> #include <archive.h> // cygwin's libarchive. http://www.libarchive.org/ #include <archive_entry.h> int main (int argc, char** argv) { const char* usage = "usage: pack $in.zip $out.zip $pathtoreplace"; const char* infile = argc > 1 ? argv[1] : nullptr; if (!infile) {cerr << usage << endl; return 1;} const char* outfile = argc > 2 ? argv[2] : nullptr; if (!outfile) {cerr << usage << endl; return 1;} const char* pathtoreplace = argc > 3

c# - Parsing an enum with the Flags attrubute not giving expected value -

my enum: [flags] public enum equalityoperator { equal, notequal, lessthan, lessthanorequal, greaterthan, greaterthanorequal, like, notlike, in, notin } my code parsing it: var operatorval = (equalityoperator)enum.parse(typeof (equalityoperator), filterinfo[3]); when debug, can see filterinfo[3] "like" however, operatorval comes out "lessthan | greaterthan" what missing? can not parse enums flags attribute? you need specify values: [flags] public enum equalityoperator { equal = 0, notequal = 1, lessthan = 2, lessthanorequal = 4, greaterthan = 8, greaterthanorequal = 16, = 32, notlike = 64, in = 128, notin = 256 } the reason like parsing lessthan | greaterthan because you've defined it, lessthan has value 2 , greaterthan has value 4. if tak

Nginx not running with no error message -

i trying start nginx server. when type "$> /etc/init.d/nginx start", have message appearing "starting nginx:", , nothing happens. there no error message, , when check status of nginx see not running. here /etc/nginx/nginx.conf file: worker_processes 4; daemon off; error_log /home/vincent/tmp/nginx.log; pid /home/vincent/tmp/nginx.pid; events { worker_connections 1024; } http { default_type application/octet-stream; log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; access_log /home/vincent/tmp/access.log main; sendfile on; keepalive_timeout 65; include /etc/nginx/site-enabled/*; } and here /etc/nginx/sites-available/default file : server { listen 80; server_name technical-test.neo9.lan; acce

vb6 - Properties in VB -

below snippet written in vb .cls file : public property request() string request = m_srequest end property public property let request(sdata string) m_srequest = sdata parserequest sdata end property in class line below used: public sub logerror(request requestparameters, byval sdata string, iberr ciberr) dim serrorlog string serrorlog = request("monitorpath") & "\log\debug\errors" if dir(serrorlog, vbdirectory) = "" mkdir serrorlog end if . . . end sub i'm trying migrate code c#, , don't understand how request("monitorpath") returning string. if yes - how, let not have return type? if no - how serrorlog = request("monitorpath") & "\log\debug\errors" work? if request("monitorpath") in class not contain property get/get request() using method within called request . (it can't call classes property without instance qualification).

Android Apache MultipartEntity: cannot add extra field like Content type -

i trying add field multipart http post addfield method, when catch packet wireshark, cannot see effect of it. problem? private void upload3(file file) { defaulthttpclient httpclient = new defaulthttpclient(); httppost httppost = new httppost(url + "?recname=" + filename); multipartentity entity = new multipartentity(); string boundary = "---------------------------this boundary"; httppost.addheader("content-type", "multipart/form-data; boundary=" + boundary); try { file f = new file( file_path); filebody body = new filebody(f); formbodypart fbp = new formbodypart( "file", body ); fbp.addfield("content-type", "audio/mp4"); entity.addpart(fbp); } catch (exception e) { e.printstacktrace(); } httppost.setentity(entity); } okay, fou

html - Basic CSS - how to overlay a DIV with semi-transparent DIV on top -

Image
i'm struggling make render right in browser (chrome). have wrapper holding elements of html, , want have div (lets call div-1) hold image, , has overlay div on top of left, sketched in picture...any quick solutions? here's pure css solution, similar darkbee's answer, without need .wrapper div: .dimmed { position: relative; } .dimmed:after { content: " "; z-index: 10; display: block; position: absolute; height: 100%; top: 0; left: 0; right: 0; background: rgba(0, 0, 0, 0.5); } i'm using rgba here, of course can use other transparency methods if like.

mysql - SQL - Joining on subquery condition -

in database have 2 tables: action +--------------+--------------+------+-----+---------+----------------+ | field | type | null | key | default | | +--------------+--------------+------+-----+---------+----------------+ | id | int(11) | no | pri | null | auto_increment | | lead_id | int(11) | yes | uni | null | | | type | varchar(255) | no | | null | | +--------------+--------------+------+-----+---------+----------------+ lead +---------+--------------+------+-----+---------+----------------+ | field | type | null | key | default | | +---------+--------------+------+-----+---------+----------------+ | id | int(11) | no | pri | null | auto_increment | | status | varchar(255) | yes | | null | | | created | datetime | no | | null | | | lead_id | int(11) | no | mul | null |

java - Screen gets rotated even after locking device's rotation in Android -

i using in manifest rotate app based on screen orientation android:screenorientation="sensorlandscape" android:configchanges="orientation|keyboardhidden|keyboard|screenlayout|screensize" the problem after lock devices screen orientation, app still rotate if change orientation of device. i tried android:screenorientation="user" but makes app rotate portrait don't want. can me on this? if @ question should find answer link . have set android:screenorientation="landscape" best wishes

geometry - ThreeJS Normals Calculated Wrong -

Image
i modifying height of vertices in plane geometry create terrain after run computefacenormals() normals still wrong :/. doing wrong or bug? iv tried calling computevertexnormals() alongside computefacenormals() , still incorrect. can see mean in image, notice weird specular hint on face should darkened lighting.

Contact.php Form Issue -

having trouble contact.php form. seems working intermittently , can't spot doing wrong. hosting godaddy , said add following not sure relay-hosting.secureserver.net any or references building 1 of these helpful. current code below. <?php if(isset($_post['email'])) { // edit 2 lines below required $email_to = "info@resonatebusiness.com"; $email_subject = "new website inquiry"; $email_message = "form details below.\n\n"; function clean_string($string) { $bad = array("content-type","bcc:","to:","cc:","href"); return str_replace($bad,"",$string); } $email_message .= "first name: ".clean_string($full_name)."\n"; $email_message .= "last name: ".clean_string($email)."\n"; $email_message .= "email: ".clean_string($email)."\n"; $email_message .= "telephone: ".clean_string($subject)."\n"; $emai

.net - VB.NET - Select text until certain character -

the title may not precise couldn't think if better way of explaining it. i working on project client utilizes html source code number of different websites. at moment, source displayed need able pick first url out of source , display on label . my problem being. vb text boxes don't display hyper links , (as far know) don't have tools pick hyperlink out of string. i need able first hyperlink multiline text box. link can long , typically not end .com or .net or ever, it's domain long combination of numbers , letters. need able extract url. encased inside html frame , link change based on website visits think thing i'm looking way extract html frame link inside removing excess html left raw link. i have tried explain best could; let me know if need clarification. although question unclear can pretty use htmlagilitypack or use regex [regular expressions] in order return want page example ' input string. dim value string = "/content/al

SQL fails to convert types, but why -

i trying filter query following way: declare @cubeyear varchar(30) --setting way can later used in ssas cubes set @cubeyear = '[date].[year].&[2013]' select [rankingid] ,[year] ,[customer] ,[rank] [obase].[dbo].[fact_kunderanking] '[date].[year].&[' + year + ']' = @cubeyear but keep getting following error: conversion failed when converting varchar value '[date].[year].&[2013]' data type int. does know solution might be? try - where '[date].[year].&[' + cast(year varchar(4)) + ']' = @cubeyear

regex - Match LAST_NAME, FIRST_NAME and replace with FIRST_NAME LAST_NAME with regular expressions -

i haven't had use regular expressions in time, find myself trying (?<lastname>[a-za-z]+\,) (?<firstname>[a-za-z]+) as matching pattern, think i'm going down wrong path, let alone replacement pattern, why thought return pattern names. replace: ([a-za-z]+), ([a-za-z]+) with: $2 $1

linux - Something similar to /dev/urandom with configurable seed? -

i'm dd 'ing /dev/urandom in order create files random contents. works well, able reproduce file contents @ later point running prng again same seed. there seedable prng exposes character device? i'm using recent linux 3.x kernels. taken urandom documentation when linux system starts without operator interaction, entropy pool may in predictable state. reduces actual amount of noise in entropy pool below estimate. in order counteract effect, helps carry entropy pool information across shut-downs , start-ups. this, add following lines appropriate script run during linux system start-up sequence: echo "initializing kernel random number generator..." # initialize kernel random number generator random seed # last shut-down (or start-up) start-up. load , # save 512 bytes, size of entropy pool. if [ -f /var/random-seed ]; cat /var/random-seed >/dev/urandom fi dd if=/dev/urandom of=/var/random

foxpro - Olecontroller not showing in grid -

i want show chinese characters in form. somehow able using activex controller forms.text.2 but when replace textbox in grid olecontroller, won't show during runtime. need select or setfocus column first - show it. the sparse property of column .f. , setcontroller olecontroller. don't know anymore, have idea on how resolve this? open form, open properties sheet. click on grid. properties sheet, scroll down column having activex control. @ property "currentcontrol" of column. has combobox of default "text1" textbox control , activex control. change currentcontrol of activex control, save , run.

Validating user's API credentials - PayPal DoDirectPayment -

hello working on site accept paypal api credentials every restaurant owner amount transferred account directly. the problem facing, times restaurant owners add wrong api credentials when order placed error "security header not valid" appears means api credentials wrong. the solution want api credentials verified when added restaurant owner, order placed end user. is there way verify/validate paypal api credentials(user name, password, signature), please help. thanks in advance! paypal dont have external api validate api credentials alone. instead. can use express checkout setexpresschekout api call minimal data , api credenitals, validate api crenditials , generate token. if token means api credenitials correct. not money movement happpens api call. pp have api avaiable in both nvp , soap format.

attributes - style tag automatically added to ASP.NET ListBox control -

i have asp.net project following line of code: <asp:listbox id="lbxinvoices" runat="server" selectionmode="multiple" rows="16"></asp:listbox> obviously, i'd control render 16 rows. unfortunately, refuses so...when check html source page, see following: <select size="16" name="ctl00$cphmaincontent$wizard1$lbxinvoices" multiple="multiple" id="ctl00_cphmaincontent_wizard1_lbxinvoices" class="defaultlistbox" style="height:100px;width:250px;"> where did class attribute come from? , more importantly, did style attribute (which apparently overriding "size" attribute) come from? how can rid of them? if add style="height: auto" attribute server side tag, can work, seems weird, , i'd stop adding attribute in first place. am missing something?

ios - Is it possible to store user-generated-content on Game-Center and share among all users? -

we implementing leveleditor our game , want enable submitting user-generated levels. other users of game should able play these levels. possible store levels in gamecenter or way achieve set dedicated server? in case have go our own server, there preconfigured services scenario? dropbox, nice api instead of having code ourselves ground up. thanks lot! gamecenter not have support downloadable content. peer-to-peer share small payloads of data between players using matching api, that's pretty not want. in thinking other services, first/easiest thing comes mind me use amazon s3. it's super-simple, reasonably cheap, has content distribution, availability, etc. (sure beats running own server, anyway.)

Tcpdf on Laravel 3 controller -

Image
good morning. i'm trying generate pdf tcpdf library , bundle. tested basic usage of library on controller this: public function get_reporte_grupos(){ $pdf = new tcpdf(); $pdf->addpage(); $pdf->setfont('times','b',16); $pdf->cell(40,10,'hello world!'); $pdf->output('example_001.pdf', 'i'); } and output de binary of pdf file: %pdf-1.7 % 8 0 obj << /type /page /parent 1 0 r /lastmodified (d:20130725101953-04'30') /resources 2 0 r /mediabox [0.000000 0.000000 595.276000 841.890000] /cropbox [0.000000 0.000000 595.276000 841.890000] /bleedbox [0.000000 0.000000 595.276000 841.890000] /trimbox [0.000000 0.000000 595.276000 841.890000] /artbox [0.000000 0.000000 595.276000 841.890000] /contents 9 0 r /rotate 0 /group << /type /group /s /transparency /cs /devicergb >> /annots [ 7 0 r ] /pz 1 >> endobj 9 0 obj <> stream xsn0+[{qw(-ꩀ%^h(uh8r().. , on.