Posts

Showing posts from February, 2012

mvcrecaptcha - Invalid reCAPTCHA request. Missing challenge value -

mvcrecaptcha - Invalid reCAPTCHA request. Missing challenge value - i'm using recaptcha in mvc application. in controller have recaptchacontrolmvc.captchavalidator attribute. my captchavalid homecoming false error message "invalid recaptcha request. missing challenge value." [recaptchacontrolmvc.captchavalidator] public actionresult login(model model, bool captchavalid, string captchaerrormessage) { if(captchvalid)//this false } am missing something? not sure re-captcha require 4 fields verify stated here. https://developers.google.com/recaptcha/docs/verify i believe missing parameter "challenge" in post request. seek see whats getting passed in httpfox or firebug. mvcrecaptcha

send calendar invitation from lotus to exchange through java domino api -

send calendar invitation from lotus to exchange through java domino api - i trying send calendar invitation lotus exchange through java domino api. when send invitation 1 lotus business relationship other lotus account, successful. when send same exchange mail service account, exchange not showing invitation. the code using fro follows: package com.test; import java.util.date; import java.util.vector; import lotus.domino.database; import lotus.domino.datetime; import lotus.domino.document; import lotus.domino.notesfactory; import lotus.domino.session; import lotus.entity.meeting; import com.data.strings; public class calendertest { public static void main(string[] args){ vector<string> sendto = new vector<string>(); sendto.add("xxxx.xx.com"); meeting m = new meeting(); m.setdate("04-04-2013"); m.settime("06:06:06"); m.sethours("4"); m.setchair("xxxx.x...

jquery - Image select box instead of text select? -

jquery - Image select box instead of text select? - im creating theme wordpress , need have selectbox can click , display images select. currently function have select dropdown list text. <select id='selectbox'> <option >airplane</option> <option >bowling</option> <option >alarm</option> </select> but need have kind of select list images , no text. possible ? assume include jquery work. im unable find answers on net. ok have spent whole day create work guess im stupid. on every possible illustration , solution have problems making work. here entire code of metabox utilize http://pastebin.com/1kvyz8mg it's wordpress theme , else works needed, thing can't if replace select box kind of images list select proper image field. try this: jquery: $("#selectbox").change(function(){ var selectedindex = $("#selectbox")[0].selectedindex; $('ul#images li'...

Do indexes help a mysql MEMORY table? -

Do indexes help a mysql MEMORY table? - i optimizing 3 gb table memory table in order analysis on it, , curious if adding indexes help memory table. since info in memory anyway, redundant? no, they're not redundant. yes, go on utilize indexes. the speed of access memory table on smaller tables non-indexed column may seem identical indexed ones due how fast total table scans can in memory, table grows or bring together them create larger result sets there difference. regardless of storage method engine uses (disk/memory), proper indexes improve performance long storage engine supports them. how indexes implemented may vary, know implemented in table types memory, innodb, , myisam. btw: default method indexes in memory tables hash instead of b-tree. also, don't recommend coding storage engine. what's memory table today may need changed innodb tomorrow--the sql , schema should stand on it's own. mysql memory optimization

how can I filter data cumulatively in CakePHP -

how can I filter data cumulatively in CakePHP - i'm relatively new cakephp , object oriented programming. have built apps in cakephp before, never extent, hence reason i'm asking help. i have big product management database, user needs able set filter criteria find closest product matches. the products table contains category_id, manufacturer_id, type_id, status_id related respective tables. i have sidebar dropdown boxes each filter, , want filters work together, instance, if manufacturer , product type selected, display filtered results, , alter status , category dropdowns contain options filtered results. in past have accomplished using dynamic query setting conditions based on user input, appending clauses each time filter applied. so far i've been able individually filtered results using $this->product->recursive = 0; $mid = (isset($this->params['named']['mid'])) ? $this->params['named']['mid'] : ...

nsstring - Trying to do some simple calculations in iOS project? -

nsstring - Trying to do some simple calculations in iOS project? - i want know how simple equations in ios app, if point me in right direction wonderful! i need know how convert nsnumber represents minutes nsstring represents hours , minutes (example: 100 = 1 hr , 40 minutes) i want know if possible convert 2013-02-08t10:50:00.000 10:50am thanks tips guys might have. for conversion : nsnumber *yournumber = [nsnumber numberwithint100]; nsinteger hr = [yournumber intvalue] / 60; nsinteger minutes = [yournumber intvalue] % 60; nsstring *time_stamp = [nsstring stringwithformat:@"%d hr , %d minutes",hour,minutes]; as comments suggested can utilize nsdateformatter format nsdate. ios nsstring calculator nsnumber

asp.net - Precompiled + JIT in the same WebApp -

asp.net - Precompiled + JIT in the same WebApp - i have website precompiled . leaves aspx pages , bin directory upload server. @ times need create minor changes straight files on server. such spelling correction. if alter in aspx files able straight edit file , change. (no need build , deploy) if have alter simple event can utilize aspx page , <script runat="server"> specify changed event (it overrides 1 time precompiled). e.g <%@ page language="c#" masterpagefile="~/masterpages/mysiteskin.master" autoeventwireup="true" codebehind="article.aspx.cs" inherits="mayflower.website.article" %> <script runat="server"> protected void btnsubmit_click(object sender, eventargs e) //already exists in code behind { //code.... } </script> <asp:content id="content2" contentplaceholderid="cphcontent" runat="server"> <asp:button run...

html - Why do textareas break long words (and why don't divs break long words) when it exceeds the width? -

html - Why do textareas break long words (and why don't divs break long words) when it exceeds the width? - let's have 2 boxes: div.box , textarea.box , each of has same fixed width , height. each has identical text including 1 verrryyyyy long word, followed series of short words. the setup might this: css: .box { width: 400px; height: 100px; } html: <div class="box"> looooooooooooooooooooooooooooooooooooooooooooooooooooooooong_word , short text </div> <br><br> <textarea class="box"> looooooooooooooooooooooooooooooooooooooooooooooooooooooooong_word , short text </textarea> using above code, div not break long word, begins on next line series of short words: however, textarea breaks long word: my question: why happen? default css causing div maintain long word on 1 line (i.e. not break word), textarea break it? js fiddle example. chrome default textarea styling: text...

c# - Persist one record at a time compared to the whole list at once -

c# - Persist one record at a time compared to the whole list at once - i have take between 2 approaches. persist list in info base of operations using mylist.foreach(p => doit(p)); -or- use doit(mylist); doit dal method in separate layer. what utilize cases them? i interested in resource usage , performance between these 2 scenarios. dal uses using create connection object everytime method called. even if connection kept in connection pool, create , utilize connection in one-off (and in using block) because looping , re-calling connection each element of collection undoubtedly cost more. although i'm not aware of inner workings @ time, internal checks on pool necessary see if connection still same beingness called, skipped if process list whole. c# linq list generics

r - How to avoid loop when doing addition of row(n) to row(n-1) for random walk -

r - How to avoid loop when doing addition of row(n) to row(n-1) for random walk - i simulating random walk starting coordinates(0,0). when loop works well: require(ggplot2) n <- 1000 #number of walks # first solution, w/ loop... works slooow coord <- data.frame (x=0, y=0, step=0) #origin (i in 1:n){ dir <- sample(c("w", "e", "n", "s"), 1) #random direction step <- sample(1:4, 1) #how far go in each walk startx <- coord[nrow(coord), 1] starty <- coord[nrow(coord), 2] endx <- ifelse (dir=="w", startx-step, ifelse(dir=="e", startx+step, startx)) endy <- ifelse (dir=="n", starty+step, ifelse(dir=="s", starty-step, starty)) newcoord <- data.frame (x=endx, y=endy, step=step) coord <- rbind(coord, newcoord) } rw <- ggplot(coord, aes(x=x, y=y)) rw + geom_path() + ggtitle(paste(n, "walks")) + geom_point(aes(x=0, y =0), color="green...

java - NDK installation is required for reuse NDK code? -

java - NDK installation is required for reuse NDK code? - i have downloaded code http://code.google.com/p/aacplayer-android/downloads/detail?name=aacplayer-android-r25.zip&can=2&q= playing aac file in android and below image of code in eclipse here can see there jni folder , libs folder in libs folder contain .so files currently have not installed ndk , have imported project working fine... if utilize files , code project should have install ndk? i have re-create , paste jni , libs folder application, should have do! how tell apps native code! my apps folder structor (after re-create paste) below if not want rebuild .so files should not need ndk. eclipse/java/android handle them fine native java libraries. need android ndk if want able compile c/c++ code android platform. java android

TCL throws invalid command name when writing csv data to a matrix within a namespace -

TCL throws invalid command name when writing csv data to a matrix within a namespace - this bizarre issue can't seem figure out. using tcl 8.5 , trying read info csv file matrix using csv::read2matrix command. however, every time it, says matrix trying write invalid command. snippet of doing: package require csv bundle require struct::matrix namespace eval ::iostandards { namespace export * } proc iostandards::parse_stds { io_csv } { # create matrix puts "creating matrix..." struct::matrix iostdm # add together columns puts "adding columns matrix..." iostdm add together columns 6 # open file set fid [open $io_csv r] puts $fid # read csv matrix puts "reading info matrix..." csv::read2matrix $fid iostdm {,} close $fid } when run code in tclsh, error: invalid command name "iostdm" as far can tell, code right (when don't set in namespace. tried namespace ...

Struts2- URL tag - Hide query String -

Struts2- URL tag - Hide query String - after lot of research on stackoverflow i'm posting question not find solution issue. requirement scenario : update client list of customers based on each client id parameter. solution tried: based on client id received jsp, pass action struts2 url tag. issue faced - query string visible on url. http://foo.com/struts2example/getcustomeraction?customerid=2 questions : can not hide query string if utilize struts url tag? if cannot hide using query string while using url tag? alternative above scenario. code struts.xml,jsp , action below - class="lang-html prettyprint-override"> <h2>all customers details</h2> <s:if test="customerlist.size() > 0"> <table border="1px" cellpadding="8px"> <tr> <th>customer id</th> <th>first name</th> <th>last name</th> ...

system verilog - SystemVerilog vs C++ assignment: reference or copy? -

system verilog - SystemVerilog vs C++ assignment: reference or copy? - i have c++ background. tracking downwards bug in systemverilog code working on , surprised find thought object-copying assignment reference assignment. simplified code shows mean: for (int = 0; < max_num; ++i) { var cls_obj obj1; obj1 = obj_array[i]; some_function(obj1); // modifies object passed in // @ point both obj1 , obj_array[i] modified. // other code goes here } i expecting obj1 modified. because of var keyword? how re-create assignment vs. reference assignment work in systemverilog? having hard time finding info web searches. class variables in systemverilog references, or handles. instances created when utilize new keyword. so in example, obj1 , obj_array[i] both refer (or point) same instance. by default, function parameters in systemverilog passed value. class handles treated values, class pass function passed reference. there built-in mechanism i...

Connecting to a MySQL database via php in bluehost -

Connecting to a MySQL database via php in bluehost - hi im having mysql database on bluehost , i'm trying connect using php. php files used stored in public_html under domain. given below 2 codes db_config.php <?php /* * database connection variables */ define('db_user', "siveradi_root"); // db user define('db_password', "tesh123"); // db password (mention db password here) define('db_database', "siveradi_test"); // database name define('db_host', "localhost:3306"); // db server define('db_port',"3306"); ?> db_connect.php <?php /** * class file connect database */ class db_connect { // constructor function __construct() { // connecting database $this->connect(); } // destructor function __destruct() { // closing db connection $this->close(); } /** * function connect database */ function connect() { // import database connection varia...

Java 1.6 : Learn how to handle exceptions -

Java 1.6 : Learn how to handle exceptions - i did extensive research on exceptions, i'm still lost. i'd know or not. and i'd give me expert sentiment on next illustration : public void myprocess(...) { boolean error = false; seek { // step 1 seek { startprocess(); } grab (ioexception e) { log.error("step1", e); throw new myprocessexception("step1", e); } // step 2 seek { ... } grab (ioexception e) { log.error("step2", e); throw new myprocessexception("step2", e); } grab (dataaccessexception e) { log.error("step2", e); throw new myprocessexception("step2", e); } // step 3 seek { ... } grab (ioexception e) { log.error("step3", e); throw new my...

Liferay If user is already login and he manually enters login page url? -

Liferay If user is already login and he manually enters login page url? - i need if user login , manually enters login path redirects home page?.please allow me know how how perform this. thanks as far understand want after login if come in next sign-in url: http://localhost:8080/web/guest/home?p_p_id=58&p_p_lifecycle=0&p_p_state=maximized&p_p_mode=view&savelastpath=0&_58_struts_action=%2flogin%2flogin then should taken home page i.e. http://localhost:8080/web/guest/home . so if case think can create servlet-filter hook intercept requests , check relevant parameters of url such struts_action=/login/login , next (in psuedo code): if(is_signin_url) { // check if sign-in url if(isuserloggedin) { // check if user logged-in // redirect home page configured in portal-ext.properties } else { // allow application work i.e. allow go sign-in page } } also info , in-depth understand can check lifeary's au...

excel - VBA paste method -

excel - VBA paste method - i've been working on learning ways improve code , taking examples site , others -- can't seem past runtime error 1004 "paste method of worksheet class failed". have 2 other similar macros , button run 3. runs first 2 same syntax around pasting "myqueue" file fine, 3rd not paste , throws error. can help? sub csqagentsummaryedit() dim mypath string mypath = " path " myfile = " file " queuepath = "path " myqueue = " file " dim wb1 workbook dim wb2 workbook set wb1 = workbooks.open(queuepath) set wb2 = workbooks.open(mypath) columns("a:v").delete shift:=xlup columns("b").delete shift:=xlup columns("c:r").delete shift:=xlup range("a1").select selection.end(xldown).select activecell.offset(2, 0).range("a1").select selection.consolidate sources:= _ "'file info " _ , function:=xlsum, leftcolumn:=true ...

lungojs in trigger.io -

lungojs in trigger.io - hi looking using trigger.io create mobile app utilize lungojs gui part. unable find reference of using these 2 without issues . hear experience . i'm interested in lungo too, thought best way seek it. i took lungo js illustration app https://github.com/tapquo/lungo.js/tree/master/example put /src folder of default trigger.io project , built android without problems. tested on android 4.1 device , works great. :) the built kitchen sink app available here: https://dl.dropbox.com/u/579708/android/lungojs/lungojskitchensink21.apk trigger.io lungojs

Building restartless Firefox extension with Addon SDK -

Building restartless Firefox extension with Addon SDK - i using latest version firefox addon sdk (https://github.com/mozilla/addon-sdk) build extension. additionally using erik vold's toolbarbutton bundle (https://github.com/erikvold/toolbarbutton-jplib) display extension button in top toolbar. when running cfx xpi , installing extension tells me went fine (no restart or whatsoever required) toolbar button shows when restarting browser. how can create restartless? use moveto function forcefulness insert toolbar button on install. believe it's bug in code haven't asked erik it. something work: var toolbarbutton = require('toolbarbutton').toolbarbutton; var tbb = toolbarbutton(options); tbb.moveto(options); firefox firefox-addon firefox-addon-sdk

Creating an Access Form -

Creating an Access Form - i not going pretend know creating forms in access, exclusively new concept me. have db in access contains number of tables , queries. create access form can utilize search form, particular fields need. type in looking , list of tables/queries relate appear. doable? the short reply question "is doable" is: yes absolutely doable. a place start utilize form wizard. training (plenty online) on how design forms. dlookup friend. alternatively, study way show specific record based on specified criteria (show me address person a). forms ms-access

jquery - Multiple $.getJSON requests return differently within promise -

jquery - Multiple $.getJSON requests return differently within promise - i have next code: var areq = $.getjson('/path/a'), breq = $.getjson('/path/b'); $.when(areq, breq).then(function(a, b) { console.log(a, b); // logs: [array[5], "success", object], [array[20], "success", object] }); why wrapped in "jqxhr array"? with single $.getjson doesn't happen: var areq = $.getjson('/path/a'); $.when(areq).then(function(a) { console.log(a); // logs: [object, object, object, object, object] // wanted in first version }); is there way accomplish first version works? maybe understood wrong promises/deferred objects. fwiw: using jquery version 1.7.1 in case. this documented in api intended behavior: http://api.jquery.com/jquery.when/ if wasn't returned in array, how homecoming different results each passed in promise considering each passed in promise have multiple arguments returned? fr...

actionscript 3 - AS3 advanced guide -

actionscript 3 - AS3 advanced guide - i think it's time asked. i'm learning as3, apart childhood tricks javascript it's first p.language. random tutorials teach basics, how initiate function, how "listen", how set variables etc. language much bigger, need complex understanding of it. randomly choosing tasks , finding ways perform may take pretty long. i need organized way go through important, if not all, possibilities of as3, step step. i'm sure who's willing reply as3 tagged question knows lot language , had his/her way of learning it, apart using else's code til understand or asking people every time. don't mind lastly know i'll many angry comment "serious_and_busy_people_forum" flooding. ;) so if found , complete, clear, online tutorial, please share. as examples of i'm interested in right now, i'm see how create many random instances share same code object rotation-watching closest one, storing info may shar...

parameter passing in C function -

parameter passing in C function - i have function written in c findbeginkey(keylisttraverser, beginpage, beginkey, key1); beginkey pointer before function invoking, , didn't initiate it, like beginkey = null; in findbeginkey() function, assign beginkey pointer, , seek print out current address of beginkey in function, works correct. when code returns function, seek print out address of beginkey again, shows 0x0 . why happen, , if want preserve address assigned in function, should do? to pass value out of function have pass by reference rather by value case c functions. create parameter pointer type want pass out. pass value phone call & (address operand). e.g. findfoo(foo** beginkey); and phone call it: findfoo(&beginkey); and in function: *beginkey = 0xdeadc0de; c function parameter-passing

ASP.NET Model Binding, ListView & CheckBox.Checked -

ASP.NET Model Binding, ListView & CheckBox.Checked - i using asp.net 4.5 model binding nowadays items in listview command editing. <asp:listview id="results" runat="server" selectmethod="selectclientstatus" datakeynames="id" itemplaceholderid="itemplaceholder" itemtype="clientstatus" onitemcommand="results_itemcommand" insertitemposition="lastitem" updatemethod="updateclientstatus" insertmethod="insertclientstatus"> <layouttemplate> <table> <tr> <th runat="server"> <asp:linkbutton id="sortbydescription" runat="server" clientidmode="static" commandname="sort" commandargument="description" text="description" /> </th> <th>active</th> <th></...

import - sqlalchemy mysterious NameError -

import - sqlalchemy mysterious NameError - the situation i have pretty involved database , models split multiple files because there loads of them. foo.py from ...models.capture_models import captureinstance ...models.access import dbsession ocaptureinstance = dbsession.query(captureinstance).get(icaptureinstance) # error this gives me nameerror on query. error talks model isn't used @ in foo.py. if import model it's complaining different nameerror. if include models using many from x import * statements executes fine. my thinking , experiments as far know behavior shouldn't happen because not referring straight models within other models. i'm using sort of syntax: foo_id = column(integer,foreignkey('foo_table_name.id')) etc foo = relationship('foo') also, removing relationships captureinstance doesn't alter error. since error occurs on query, not import, cant see how references undefined stuff have slipped th...

c++ - template operator overload base class -

c++ - template operator overload base class - i have base of operations class many kid classes. how implement template operator on loader in base of operations class work inheriting classes? tried create 1 + operator complained had many parameters. i'm not sure right way go doing (i'm starting utilize oop) if can think of improve way great. i'm making library in each metric space class. want create base of operations class "operations" every space inherits. my template base of operations class: #ifndef __libspace__operations__ #define __libspace__operations__ template< typename t > class operations{ public: friend t operator+( const t& sp, const t& nsp ){ homecoming t(sp.dimension + nsp.dimension); }; }; #endif child: #ifndef __libspace__euclidsp__ #define __libspace__euclidsp__ #include "operations.h" class euclidsp: public operations<euclidsp>{ public: euclidsp(int n = 0, ...); ...

asp.net - User control variable not declared -

asp.net - User control variable not declared - i have variable declared in user control. value of drop downwards list in user control. when seek utilize in if statement on aspx page says variable not declared. there way declare variable on aspx page or create recognize declared on user command page? give thanks you i'm calling code @ top of aspx page <%@ register src="ptype.ascx" tagname="ptype" tagprefix="uc2" %> i'm using if statement <%if pt.selectedvalue = "1" then%> \\do things <%end if%> in command pt defined by <asp:dropdownlist id="pt" runat="server"> i don't think can access properties of user command in aspx page. what know can declare user command in code behind , dynamically add together page. protected void page_init(object sender, eventargs e) { //mycontrol custom user command code behind file mycontrol myco...

sockets - English C++ program on foreign OS -

sockets - English C++ program on foreign OS - i have chat scheme works operating systems in english. uses multibyte character set, server drives it. i have chinese clients utilize program. when messages received, 1 of 2 things happens: if message typed in chinese, spaces aren't displayed. if written english, bits , pieces show foreign characters. any advice? as using windows 7 client , windows server 2008 r2 server, don't think issue due alter of "endianness". mentioned utilize "multibyte" character set. assume info not utilize 1 of standard unicode encodings such utf-8/utf-16/utf-32 rather uses pre-unicode style code pages encoding data. if 1 code page used when client enters text chat , displayed different code page on recepient's pc, text may not display properly. c++ sockets chat translation

C# cannot change DefaultCellStyle.WrapMode of a DataGridView -

C# cannot change DefaultCellStyle.WrapMode of a DataGridView - i using datagridview, bound datatable. defaultcellstyle.wrapmode set false , working way want it. however, want utilize custom cellpainting (code below), supposed to, wrapmode no longer respected , longer strings wrapped when added "url" column of datagridview1. private void datagridview1_cellpainting(object sender, datagridviewcellpaintingeventargs e) { if (e.rowindex < 0) return; if (e.columnindex == datagridview1.columns["url"].index) { if ((e.state & datagridviewelementstates.selected) == datagridviewelementstates.selected) return; e.cellstyle.wrapmode = datagridviewtristate.false; rectangle rect = new rectangle(e.cellbounds.x, e.cellbounds.y, e.cellbounds.width - 1, e.cellbounds.height - 1); using (system.drawing.drawing2d.lineargradientbrush...

gsoap: force WS-Discovery 1.0 instead of 1.1 -

gsoap: force WS-Discovery 1.0 instead of 1.1 - i using gsoap , plugin wsddapi implement ws-discovery. i need implement ws-discovery v1.0, plugin output v1.1 messages. in source-code of plugin, it's valid both v1.1 , v1.0, not able understand how can forcefulness gsoap utilize v1.0 messages. do have hint? in order generate soapclient.cpp code referenced wsddapi plugins ws-discovery 1.0, can utilize command : soapcpp2 -xa /usr/share/gsoap/ws/wsdd10.h -i /usr/share/gsoap/import in other hand code ws-discovery 1.1 generated : soapcpp2 -xa /usr/share/gsoap/ws/wsdd.h -i /usr/share/gsoap/import perhaps paths different depending on packaging, operating scheme ... gsoap ws-discovery

big o - What Big-O notation would this fall under? -

big o - What Big-O notation would this fall under? - what big-o notation fall under? know setsearch() , removeat() of order o(n) (assume either way). know without loop it'd o(n), certain, confused how calculate becomes loop thrown it. i'm not great @ math... so. o(n^2)? public void removeall(dataelement clearelement) { if(length == 0) system.err.println("cannot delete empty list."); else { for(int = 0; < list.length; i++) { loc = seqsearch(clearelement); if(loc != -1) { removeat(loc); --i; } } } } if removeat() , seqsearch() o(n) respect length of list yes, algorithm of order o(n^2). because within loop phone call seqsearch every time, possibility of calling removeat(loc). means each iteration doing either n or 2n operations. taking worst case, have 2n^2 operations o(n^2). big-o

Decorators, lambdas and member function calls in Python? -

Decorators, lambdas and member function calls in Python? - what's right syntax? programming attempt class foo: def hello(self): print "hello cruel world!" def greet_first(self, f): self.hello() homecoming lambda *args, **kwargs: f(*args, **kwargs) @greet_first def goodbye(self, concat): print "goodbye {0}".format(concat) if __name__=='__main__': bar = foo() bar.goodbye(' , fish') debug traceback (most recent phone call last): file "prog.py", line 1, in <module> class foo: file "prog.py", line 9, in foo @greet_first typeerror: greet_first() takes 2 arguments (1 given) reference click run code (ideone) a decorator called immediately, not treated method of foo rather seen local function instead. @greet_first syntax means: goodbye = greet_first(goodbye) and executed immediately. not bound method, self parameter not in...

javascript - Elements misposition at resize (using max-width:100% to scale rel. to window size) -

javascript - Elements misposition at resize (using max-width:100% to scale rel. to window size) - i using max-width: 100%; height: auto; on <img> elements , on image slider wrapper . when resizing browser window, images scale correctly, many surrounding elements don't follow along , misposition. self-correct 1 time page refreshed or next image loaded in image slider. ideas? demo - scale window, css @ line 25 pikachoose library sets sizes of few elements on each animation. <div class="pika-stage" style="height: 355px;"> <div class="pika-aniwrap" style="position: absolute; top: 0px; left: 0px; width: 835px;"> this why fixes when next animation happens. though source , replicate animations re-sizing code , set in $(window).resize event handler. looking @ docs pikachoose seems have goto method. you this: $(window).resize(function(){$('#pikame').data('pikachoose').goto(3)}) whe...

Find all list items via VBA -

Find all list items via VBA - i'm trying set document publishing website, need add together html tags before , after list items. however, it's not picking list items up. can please help? thanks. sub format_list() dim para paragraph dim is_list_item boolean is_list_item = false each para in activedocument.paragraphs if para.range.listformat.listtype = wdlisttype.wdlistbullet is_list_item = true para.range.insertbefore "<li>" para.range.insertafter "</li>" end if next end sub try using next instead of para.range.insertafter "</li>" para.range.select selection.endkey unit:=wdline selection.typetext text:="</li>" list vba ms-word word-2007

autoload - Autoloading Traits in PHP -

autoload - Autoloading Traits in PHP - is there way me differentiate between traits , classes in autoload function? have folder of classes , folder of traits; nice able like... spl_autoload_register(function($resource) { if ( /* $resource class */ ) { include 'classes/'.$resource.'.php'; } if ( /* $resource trait */ ) { include 'traits/'.$resource.'.php'; } }); the autoload callback function receives 1 piece of information; symbol name requested. there no way see type of symbol should be. what register multiple functions in autoload stack, 1 handle classes , other traits, using stream_resolve_include_path() or similar, eg spl_autoload_register(function($classname) { $filename = stream_resolve_include_path('classes/' . $classname . '.php'); if ($filename !== false) { include $filename; } }); spl_autoload_register(function($traitname) { $filename = stream_resolve_include_path(...

sql - Trigger to replace character following insert -

sql - Trigger to replace character following insert - is possible create trigger user replaces character after loading info table? for example, need replace '1' s '9' s in pers_id column when user loads info table. i finish newbie plsql, don't know start. i'm not sure if create clear goal, please sense free inquire clarification. technically, can... (for simplicity, i'm assuming pers_id string rather number-- if number, could, of course, convert string, run replace , convert number in trigger) sql> create table foo( pers_id varchar2(10) ); table created. sql> create trigger replace_data 2 before insert on foo 3 each row 4 begin 5 :new.pers_id := replace( :new.pers_id, '1', '9' ); 6 end; 7 / trigger created. sql> insert foo values( '123abc456' ); 1 row created. sql> select * foo; pers_id ---------- 923abc456 practically, however, requirement seems exceptional...

regex - Query CSV and write original CSV and results to single CSV Python -

regex - Query CSV and write original CSV and results to single CSV Python - i trying parse csv , if criteria met in either column write out new csv. for example if have csv looks like 123 street flat 1, 21 other road house, someother street i need analyse each line if number appears in first column , not sec need extract number, if there number in both columns need extract both , if there no number need extract text in first column. write new csv 2 original columns , 3 new ones number 1, number 2, text. ie flat number, house number, house name. new csv like 123 street, , 123, flat 1, 21 other road, 1, 21, house, someother street, , , house. any guidance helpful. thanks edited import csv csvfile = 'mydata.csv' csvout = 'myout.csv' reader = csv.reader(csvfile) author = csv.writer(csvout) row in reader: num = \d | \d\d | \d\d\d if row [0] || row [1] == num if row [1] == num writer.row [3] else row [0] =...

lucene - Solr 3.5 field type -

lucene - Solr 3.5 field type - i'm using solr 3.5 in application i'm working currently. have defined few field types custom prefixed values. mostly cost differs each , every prefix. example 123_34.99 define cost "34.99" in store "123". i need know whether exact/similar out of box fieldtype there in solr 4.1.0 handle above mentioned field types. i guess improve approach store info utilize solr dynamic fields. instead of storing info 123_34.99, wouldn't want store in price_storeid field price_123 = 34.99 or there specific reason want store 123_34.99 ? solr lucene zend-search-lucene

Implement Single Sign on in for Android Applications -

Implement Single Sign on in for Android Applications - i have 4-5 android applications , want implement single sign on these apps. if user has logged 1 of apps won't asked log in 1 time again other applications. how can accomplish in android?? i think mistaking concept of single sign on. sso letting users seamlessly login without having pull browser login when logged in default fb app. read sso here. an excerpt sso page linked above: easier login single sign-on 1 of challenges mobile developers wrestle login. after user logs in, can deliver beautiful, personalized experience. however, big number of consumers never bother logging in due hassle of typing in user name , password, or worse, dealing forgotten passwords. of these challenges exponentially worse on mobile phone. single sign-on provides simple solution these problems. users logged facebook app can utilize “login facebook” button , in 1 click through simplified permissions dialog, ...

MYSQL; IF then SET statement -

MYSQL; IF then SET statement - can't seem create below statement work, suggestions? set @input := '1234567'; if length(@input)= 7 set id=@input; end if; thanks in advance, rene try this: set @input := '1234567'; select if(length(@input)=7, @input, '((something here))') id; mysql

android - droidText unstaisfiedLink error while creating Image instance -

android - droidText unstaisfiedLink error while creating Image instance - i maintain on getting unstaisfied link error while creating pdf using droidtext lib.its on random basis , doesnt happen everytime the line throws is: image image = image.getinstance(url); stacktrace 02-19 12:09:02.534: e/androidruntime(14477): fatal exception: thread-10 02-19 12:09:02.534: e/androidruntime(14477): java.lang.unsatisfiedlinkerror: cmmopenprofile 02-19 12:09:02.534: e/androidruntime(14477): @ org.apache.harmony.awt.gl.color.nativecmm.cmmopenprofile(native method) 02-19 12:09:02.534: e/androidruntime(14477): @ harmony.java.awt.color.icc_profile.<init>(icc_profile.java:324) 02-19 12:09:02.534: e/androidruntime(14477): @ harmony.java.awt.color.icc_profile.getinstance(icc_profile.java:645) 02-19 12:09:02.534: e/androidruntime(14477): @ com.lowagie.text.pdf.codec.pngimage.readpng(pngimage.java:425) 02-19 12:09:02.534: e/androidruntime(14477): @ com.lowagie.text.pdf.c...

html - Draw a line on top of uiwebview i.e. custom drawing on top of uiwebview -

html - Draw a line on top of uiwebview i.e. custom drawing on top of uiwebview - how can draw line on top of uiwebview? on app, when user touches finger on top of uiwebview , moves finger (the underlying html content plain text , not clickable), want line drawn. is possible? apple allow custom drawing on top of uiwebview? you can set uiview above uiwebview frame equal uiwebview , set background color clearcolor . draw on it. html ios uiwebview drawing

arrays - How to create dynamic header for tables in php -

arrays - How to create dynamic header for tables in php - my array - $myfinal = array( 13 => array ( 5 => 85, 4 => 75, 3 => 65, 2 => 55 ), 12 => 11, 7 => 100 ); this want generate(table) dynamically - required output - http://jsfiddle.net/lckw6/ <table cellspacing="1" cellpadding="4" border="3" bgcolor="#f5f5f5"> <tbody> <tr bgcolor="#99cccc"> <th colspan="4">13</th> <th colspan="0">12</th> <th colspan="0">7</th> </tr> <tr bgcolor="#99cccc"> <th width="70">5</th> <th width="70">4</th> <th width="70">3</th> <th width="70">2</th> <th width="70">no...

ruby - Permutation between elements of an array -

ruby - Permutation between elements of an array - i'm coding plugin in google sketchup ruby , faced real problem while trying permute 2 arrays nowadays in array depending on user combination. i have array of arrays [["1"],["lol"], ["so"]] when have combination < [1, 2, 3] it's fine, should remain same : [["1"],["lol"], ["so"]] but when have combination [2, 3, 1] , output should : [["lol"], ["so"], ["1"]] for [3,1,2] => [["so"], ["1"], ["lol"]] ...etc edit sorry guys forgot array have bit : [["1, 2, 3"], ["lol1, lol2, lol3"], ["so1, so2, so3"]] combination [2, 3, 1] output should : [["2, 3, 1"], ["lol2, lol3, lol1"], ["so2, so3, so1"]] thanks helping me out. you utilize collect: array = [["1"],["lol"], ["so"...

java - How to get EclipseLink MOXy working in WebLogic in a JAX-WS based web service? -

java - How to get EclipseLink MOXy working in WebLogic in a JAX-WS based web service? - i want utilize eclipselink in weblogic 10.3.6.0 host web-services using jax-ws. works in tomcat. environment: java 1.6 weblogic 10.3.6.0 eclipselink 2.4.0.v20120608-r11652 jaxws 2.2.7-20120813 web-inf/lib contains: eclipselink.jar fastinfoset.jar gmbal-api-only.jar ha-api.jar javax.annotation.jar jaxb-api.jar jaxb-impl.jar jaxb-xjc.jar jaxws-api.jar jaxws-eclipselink-plugin.jar jaxws-rt.jar jaxws-tools.jar jsr181-api.jar mail.jar management-api.jar mimepull.jar policy.jar saaj-api.jar saaj-impl.jar stax-ex.jar stax2-api.jar streambuffer.jar woodstox-core-asl.jar my code follows: testrequestdto.java @xmlaccessortype(xmlaccesstype.field) @xmlrootelement(name = "test_request") public class testrequestdto implements serializable { @xmlpath("request/name/text()") private string requestname; @xmlpath("request/value/text()") private strin...

shell - Print out the distribution of words in multiple files -

shell - Print out the distribution of words in multiple files - i trying create executable take in number of text files , give output distribution of words number of occurrences. done in bash scripting, , have far is: #!/bin/bash y=$(cat $* | wc -w) cat $* | tr ' ' '//' | tr '[:upper:]' '[:lower:]' | tr -d '[:punct:]' | grep -v '[^a-z]'| sort | uniq -c | sort -rn | head -$y i error trying set y , can't figure out how head print out every word otherwise. is there improve way print out? why run head @ all? there's no guarantee there many words there words in files; indeed, practically guaranteed there won't (since there'll repeated words). , if want see data, show data; don't filter output sort -nr . the first tr needs 1 slash, think. normally, you'd map blanks , punctuation newlines (with -s alternative tr squeeze adjacent newlines one). slashes first tr count punctuation in 3...

c# - same String is not equal to another -

c# - same String is not equal to another - string s =@"&#173;"; string r = httputility.htmldecode(s); string r3 = string.format("1{0}jan{0}2007",r); console.writeline(r3); if(r3 == "1-jan-2007") { console.writeline("equal"); console.writeline("1-jan-2007"); } else { console.writeline("not equal"); console.writeline("1-jan-2007"); } the output 1-jan-2007 not equal 1-jan-2007 but when replace r "-" i.e string.format("1{0}jan{0}2007","-"); output 1-jan-2007 equal 1-jan-2007 &#173; unicode character 'soft hyphen' (u+00ad). although looks similar unicode character 'hyphen-minus' (u+002d), 2 characters not same. c#

Testing C# MySQL connection pooling fails with Exception: Connection must be valid and open -

Testing C# MySQL connection pooling fails with Exception: Connection must be valid and open - i trying utilize connection pooling on mysql's .net connector 6.6.4.0 serve multiple threads using code below: static public uint unonquery(string query) { using (connection = new mysqlconnection(connectionstring)) { if (connection.state == connectionstate.open) { console.writeline("its open..>!!!!"); } connection.open(); mysqlcommand cmd = new mysqlcommand(query, connection); cmd.executenonquery(); mysqldataadapter adapter = new mysqldataadapter("select last_insert_id() 'identity'", connection); datatable dt = new datatable(); adapter.fill(dt); uint ret = 0; if (dt...

assembly - Does each process has its own portion of utopia in the memory? -

assembly - Does each process has its own portion of utopia in the memory? - by doing cat /proc/*some pid*/maps on multiple processes on machine, notice have same starting point in regards memory address, beingness 0x8048000 . mean every process has "it's own memory space, including stack, heap etc." @ runtime? and if so, how can attackers instance distinguish between memory address of 1 process another? so if machine has 2gb of ram, , few processes running simultaneously - how can know memory address targeting? or getting wrong, , attack starts looking @ process , advancing there? pardon beginner's question, getting assembly , reading 5 tutorials simultaneously , having bit of hard-time grasping level of understanding. please note question set here , not in security since refer assembly side of things. each process has own "virtual memory", stores own stack, heap, instructions, etc. each process can utilize entire 32/64-bit address sp...

ruby on rails - LoadError in UsersController#create -

ruby on rails - LoadError in UsersController#create - to provide background info, i've been next michael hartls 'learning rails' tutorial via livelessons , i've made "lesson 8 - sign success". although problem quite specific, hope post useful others next along tutorial if brought halt similar error. (note: wasn't able find specific problem anywhere on stack, goal here shed lite on help!) now meat , potatos (when trying sign up, i'm redirected localhost:3000/users , following: loaderror in userscontroller#create library not found class digest::shaz2 -- digest/shaz2 rails.root: /users/anthonypanepinto/sites/rails_projects/sample_app1 app/models/user.rb:57:in `secure_hash' app/models/user.rb:53:in `make_salt' app/models/user.rb:44:in `encrypt_password' app/controllers/users_controller.rb:15:in `create' request parameters: {"utf8"=>"✓", "authenticity_token"=>"/seaqnrmf5x0pd4...