Posts

Showing posts from May, 2013

c# - How to get the log file location/name from Spring.Net Common Logging -

c# - How to get the log file location/name from Spring.Net Common Logging - i trying receive lastly line of message inserted log file (using spring.net mutual logging). first step retrieve name of file little tricker expected cant find relevant properties/cast this. i've found few articles of how retrieve filename given log4net file reader nil starting spring.net mutual logging class. after have received filename, utilize reverse file reader retrieve lastly name. wondering peoples thoughts reading in file whilst it's potentially beingness written mutual logging / log4net? you should able open file reading while still open writing logging infrastructure, i'm bit worried plans read "last" line. between point find need open file , point manage open file read else can write entry log file, making potentially hard line want assuming 'last' line in log. am right in assuming kind of way respond error status , acquire correlated lo...

javascript - JSDB for Android (and other mobile OS) -

javascript - JSDB for Android (and other mobile OS) - i love simplicity of jsdb develop windows program. want develop programme android. think useful if there jsdb equivalent mobile os (android start). any of know jsdb equivalent mobile os? thanks! javascript android sdk

java - Why are there compile errors when accessing an Enum from the main method? -

java - Why are there compile errors when accessing an Enum from the main method? - so i'm little bit confused i've never used enum before. want utilize enum in main method. reason, can't (i maintain getting errors anytime seek status s; in main). can phone call testingenum method main , of course of study works... 100% sure using enum way plain wrong. tell me how i'd go using in main properly? if seek do: status s; in main method, error - "connot find symbol status s;" background: new java , enums... class myclass { public status s; public enum status { status_open(1), status_started(2), status_inprogress(3), status_onhold(4), status_completed(5), status_closed(6); private final int status; status(int stat) { this.status = stat; } public int getstatus() { homecoming this.status; } } private void setstat...

c# - How to get a flattened list from nested class List? -

c# - How to get a flattened list from nested class List<T>? - i have question using these same examples - question focused on different issue. given next classes: [xmlroot] public class family { [xmlelement] public list<person> person; } public class person { [xmlattribute("member")] public membertype fellow member { get; set; } [xmlattribute("id")] public int id { get; set; } [xmlelement] public string surname { get; set; } [xmlelement] public string forename { get; set; } [xmlelement("person")] public list<person> people; } public enum membertype { father, mother, son, girl } if family has method defined such: public ienumerable<person> find (func<person, bool> predicate) { // how selectmany flatten list? foreach (var p in family.person.selectmany(p => p)) { if(pre...

ruby on rails 3 - Loading feeds / entries getting undefined method 'entries' for 0:fixnum error -

ruby on rails 3 - Loading feeds / entries getting undefined method 'entries' for 0:fixnum error - i trying load feeds blog resulting in error in title mentioned. the error message: nomethoderror (undefined method `entries' 0:fixnum): app/controllers/pages_controller.rb:6:in `home' this how i'm doing: i created file in lib folder called blog_feeds.rb , contains following: module blogfeeds require 'feedzirra' def load_feeds feeds = feedzirra::feed.fetch_and_parse('http://blog.shigotodoko.com/feed') end end and line #6 error is: @feeds = load_feeds.entries note error occurs sometimes, not always. so, thought what's going wrong here? thank you! when fetching feed, feedzirra homecoming http status code instead of object containing feed entries, if http fetch results in error (i.e. not 200 or 3xx). in order handle status gracefully, check type of object fetch_and_parse wrapping in like: unless feeds.is...

ios - how to play sound by AVAssetReader -

ios - how to play sound by AVAssetReader - i using avassetreader individual frames video file. know how can play sound mp4 file. the homecoming value of method [player play] false, there no sound play, why thanks. create avassetreader nsurl *url = [nsurl fileurlwithpath:[[nsbundle mainbundle] pathforresource:@"zhang" oftype:@"mp4"]]; avurlasset *avasset = [[avurlasset alloc] initwithurl:url options:nil]; avassettrack *track1 = [[avasset trackswithmediatype:avmediatypeaudio] objectatindex:0]; nsmutabledictionary *dic2 = [nsmutabledictionary dictionarywithobjectsandkeys:[nsnumber numberwithint:kaudioformatlinearpcm], avformatidkey, [nsnumber numberwithint:16],avlinearpcmbitdepthkey, [nsnumber numberwithbool:no],avlinearpcmisbigendiankey, [nsnumber numberwithbool:no],avlinearpcmisfloatkey, [nsnumber numberwithbool:no],avlinearpcmisnoninterleaved, nil]; o...

jquery - Wrap content in a Div with javascript without iframe refreshing -

jquery - Wrap content in a Div with javascript without iframe refreshing - basically want wrap content on page in div. i can using wrap function in jquery issue have few iframes in content contain advertising , when wrap content refreshes iframes. from can tell because behind scenes cloning content wrapped new div. html <div class="content"> <iframe src="http://something.com/ads"></iframe> </div> js $(content).wrap('awesome_container'); ideally slot in open div tags before content div , few close div tags afterwards can't seem add together divs page without adding close tags. does know of way around issue? cheers instead of removing html or making re-create of it, see if can desired result using jquery's detach() allow whatever events have associated element , children still function afterwards. may plenty preserve iframe object instead of killing off. var orphan = $(selector).detach() ...

Parsing twitter trending output as an array in PHP -

Parsing twitter trending output as an array in PHP - i'm trying parse twitter trending info isolate trending hashtags (not topics), , either echo them or save them variable. have next code: $json_output=json_decode(file_get_contents("https://api.twitter.com/1/trends/23424977.json"),true); print_r($json_output); which gives next output: array ( [0] => array ( [as_of] => 2012-01-19t18:13:39z [trends] => array ( [0] => array ( [promoted_content] => [query] => %23youknowdamnwell [name] => #youknowdamnwell [events] => [url] => http://twitter.com/search/%23youknowdamnwell ) [1] => array ( [query] => %23whyguysneedprenups [name] => #wh...

java - how to put data into array of integer -

java - how to put data into array of integer - i new android , java. in application need random numbers.which not repeated 1 time again. for illustration have textview , button on clicking button should show me random numbers , random numbers shoud not repeated. for thinking store random info array , check whether random number in array or not .if not there in array store number temporally .like on first click should show me random number in between 1-20 selected 5, value should stored array , on clicking next button if 1 time again 5 number come should skip number . please help me regarding this, talking info construction store generated random consider using java.util.set storing unique set of numbers. check whether number exists in set utilize set#contains(object o) method. code: int max = 20; system.out.println("generating random integers in range 0.." + max); set<integer> set = new hashset<integer>(max); random randomgenerator...

c# - Layered application: Store file in filestream in the database -

c# - Layered application: Store file in filestream in the database - for asp.net mvc project, need handle big files( 200-300mo, sometime 1go). i store them in database(for backup reasons/consistency reason). i'm concerned performance issue, want avoid can have array of byte anywhere in program, goal work stream every where. i've layered application, means i've several "datastore", responsible connect , retrieve/insert/update info database. since ef doesn't back upwards filestream now, i'm handling "file part" through simple sql requests. i've read article on filestream usage here: http://blog.tallan.com/2011/08/22/using-sqlfilestream-with-c-to-access-sql-server-filestream-data/ and i've additional questions, hope can help me/point me direction: since i've layered application, 1 time i've sqlfilestream object instantiated, dispose sqlcommand/sql connection/transaction scope? if not, how i'm supposed clos...

ruby on rails - No route matches for new show route -

ruby on rails - No route matches for new show route - actioncontroller::routingerror no route matches {:controller=>"user_prices", :action=>"show"..... this error getting when changed route in view to: <td class="show-link"><%= link_to "show", show_price_path(user_price) %></td> which new route: match "/:id/:product_name/:purchase_date/:price", :to => "user_prices#show", :as => :show_price what have can utilize route see user prices? the route specifying /:id/:product_name/:purchase_date/:price requires 4 parameters created. passing in 1 object, assume meant id. route have specified, need like. show_price_path(:id=>user_price.id, :product_name=>product_name_from_user_price, :purchase_date=>purchase_date_from_user_price, :price=>price_from_user_price) ruby-on-rails ruby ruby-on-rails-3

c - Queue/dequeue oddity? -

c - Queue/dequeue oddity? - i've been working on assignment involving implementing queues hold void pointers can generalized type of data. i'm encountering odd problem though dequeuing nodes reduces size of list not homecoming nodes expect to. omitting phone call free() in dequeue operation corrects this, want free dequeued nodes not desirable. tips? test run: routine.c #include <stdio.h> #include <stdlib.h> #include <stdbool.h> #include "queue.h" int main() { queue test = make_queue(); enqueue("one", test); enqueue("two", test); printf("item %s!\n", (char *)dequeue(test)); printf("item %s!\n", (char *)dequeue(test)); homecoming 0; } queue.h #include <stdbool.h> #include <stdlib.h> #include <stdio.h> /* queue implemented pointer construction not specified here. */ typedef struct queue_structure *queue; struct node { struct node * next; void * data; }; ...

jquery - Draggable & sortable widget define settings inline -

jquery - Draggable & sortable widget define settings inline - i using this tutorial define widgetindividual setting inline on individual pages. how can this. whenever seek add together inline doesn't work. illustration below: $(function(){ draggablewidgets.init({ widgetindividual : { intro : { movable: false, removable: false, collapsible: false, editable: false } } }); }); jquery draggable sortable

Jquery UI breaking all other tables on website -

Jquery UI breaking all other tables on website - i using jquery script called datatables, adds lot of functions tables searching , filtering etc , enables skin tables jquery ui. trying replicate next illustration on website can filter columns. http://www.datatables.net/release-datatables/examples/api/multi_filter_select.html problem having now, when utilize next script on website strips away jquery ui on other tables. for illustration on 1 of other tables have set in of page : $(document).ready( function() { $('#mailinglistmanager').datatable( { "bjqueryui": true, "binfo": true, "bautowidth": true, "bfilter": false, "blengthchange": true, "bpaginate": true, "bprocessing": true, "bsort": true, "spaginationtype": "full_number...

pom.xml - Maven not installing dependcies -

pom.xml - Maven not installing dependcies - i new maven basic cant seem bottom of it. i running m2eclipse. have simple project trying utilize classes in maven bundle servlet-api (group id : javax.servlet artifact : servlet-api version 2.5 scope : compile ). my repository assumed pulled from, in settings.xml (http://repo1.maven.org/maven2 ). followed url verify there jar , such @ address , there (http://search.maven.org/#browse|-182598336) however when run mvn compiler:compile (cannot find symbol symbol : class httpservletrequest ) also looked in repository , jar's , poms should installed there not. other classes not. i have looked in debug info got -x , didnt seem indicate wrong. i can post effective pom or whatever find helpful. thanks in advance. so able solve issue. bit strange, seems deed differently if select pom , click maven -> add together dependance. download , install dependency. if add together straight pom (as doing before) there a...

Unhandled Exception in C# , dnAnalytics class -

Unhandled Exception in C# , dnAnalytics class - what problem in next code? unhandled exception error, , dont see "not square matrix" output. unhandled exception: dnanalytics.linearalgebra.matrixnotsquareexception: exception of type 'dnanalytics.linearalgebra.matrixnotsquareexception' thrown.at dnanalytics.linearalgebra.densematrix.inverse () [0x00000] in :0 public static dnanalytics.linearalgebra.matrix calculatetransformation (dnanalytics.linearalgebra.matrix inputmatrix) { dnanalytics.linearalgebra.matrix transposeofinput = new dnanalytics.linearalgebra.densematrix(inputmatrix); transposeofinput= inputmatrix.transpose(); seek { dnanalytics.linearalgebra.matrix intermediate = (inputmatrix*transposeofinput).inverse() ; homecoming transposeofinput*intermediate; } catch(dnanalytics.linearalgebra.matrixnotsquareexception myex) { ...

PHP multi-dimensional array search for keys and display values -

PHP multi-dimensional array search for keys and display values - below result of array want grab coordinates , store them in 1 dimensional array. array ( [name] => jackson [status] => array ( [code] => 200 [request] => geocode ) [placemark] => array ( [0] => array ( [@attributes] => array ( [id] => p1 ) [address] => jackson, ms, usa [addressdetails] => array ( [@attributes] => array ( [accuracy] => 4 ) [country] => array ( [countrynamecode] => [countryname] => usa [administrativearea] => array ( [administrativeareaname] => ms [subadministrativearea] => array ( ...

php - Large SQL result set taking too much memory - CodeIgniter -

php - Large SQL result set taking too much memory - CodeIgniter - i issuing sql query using codeigniter can homecoming upwards of 80,000 rows results. each row has 3 columns of integers, , getting php error: fatal error: allowed memory size of 134217728 bytes exhausted it seems trying utilize more 128mb retrieve results mysql server. using $query->result_array() retrieve results. there serious overhead in terms of space in results getting. retrieve 100,000 rows, 3 integers. 100,000*((3*4 + 10)= 2.1mb. (the 10 number of bytes used column id etc). am doing wrong? ----------------------solved----------------------- solved modifying codeigniter code: link. execution faster , script taking ~3mb of memory instead of upwards of 128mb. i'm not sure how ci returns results, don't want entire info set in single array. why not loop through each row needed? <?php $result = $this->db->query('select ...'); while($row = $result->next_row())...

MySQL Workbench: "Can't connect to MySQL server on 127.0.0.1' (10061)" error -

MySQL Workbench: "Can't connect to MySQL server on 127.0.0.1' (10061)" error - i apologise.. know question has been asked many times before, i've tried lots of suggestions, , can't find solution. the problem: have mysql database running on hosted server. have utilize ssh connect it, , have relevant public , private key files. i want utilize pc version of mysql workbench, access database, running queries, checking data, etc. if run sequel pro on mac, connects fine, , can browse , query database. no problems. if run trial version of sqlyog on pc, connects fine. no problems. but if seek connect utilize mysql's own "mysql workbench" application, using same settings , ssh private key file, refuses connect, throwing well-known error: can't connect mysql server on 127.0.0.1' (10061) i find frustrating, as, in sql workbench, specified "mysql hostname" use, db01.mysql.vm.myhostingserver.net, workbench seems igno...

php - The second dimension in multi-dimension array never reached, why? -

php - The second dimension in multi-dimension array never reached, why? - can explain me why code not work: <?php for($i = 0; $i < 3; $i++) { for($j = 0; $j < 3; $j++) { $arr[$i][$j] = $i.$j; } } foreach ($arr $key => $value) { foreach ($value $key2 => $value2){ // line 8 = error echo $key." ".$key2."<br />"; } } ?> i error: warning: invalid argument supplied foreach() in c:\wamp\www\script\index.php on line 8 i cannot understand why error. array $arr should initiated values in both dimensions. right? i've tried it, , got output wamp 2.2: 0 0 0 1 0 2 1 0 1 1 1 2 2 0 2 1 2 2 are using latest wamp? seek downloading , installing new one. php multidimensional-array

c++ - Make reordered tuple from vector of tuple with use spirit::karma -

c++ - Make reordered tuple from vector of tuple with use spirit::karma - #include <tuple> #include <vector> #include <string> #include <iostream> //------------------------------------------------------------------------- #include <boost/spirit/include/karma.hpp> #include <boost/fusion/adapted/std_tuple.hpp> //------------------------------------------------------------------------- namespace ph = boost::phoenix; namespace karma = boost::spirit::karma; typedef std::back_insert_iterator<std::string> sink; typedef std::tuple<double,int> data; typedef std::vector<data> container; struct generator : karma::grammar<sink,container()> { generator(void) : generator::base_type(start,"generator") { start = info % karma::eol; //data = karma::delimit[???]; return; } karma::rule<sink,container()> start; karma::rule<sink,data()> data; }; //--------------------------------------------------...

How to insert form data into a database with validations in asp.net? -

How to insert form data into a database with validations in asp.net? - i trying build web application requires users register themselves. added custom validators , other validators according need. part of code in .aspx file <form id="form" name="form" action="../hi.aspx" method="post"> <table cellspacing="4" class="style1"> <tr> <td class="style4"> <asp:textbox id="txtfirstname" runat="server" width="157px"></asp:textbox> </td> td class="style5" id="fname"> <asp:customvalidator id="customvalidator1" runat="server" controltovalidate="txtfirstname" errormessage="your first name should @ to the lowest degree 2 characters long" onservervalidate="customvalidator1_servervalidate" forecolor="red" validateemptytext="true"></asp:custo...

c++ - Supporting my_2D_Array[x][y] (double operator[]) on a const 2D array; Cannot get things working -

c++ - Supporting my_2D_Array[x][y] (double operator[]) on a const 2D array; Cannot get things working - i creating 2d array class in c++. works fine non-cost array. have yet find explanation of const functions, , seem fumble around until works. now, however, @ impass. am not understanding how back upwards const objects? short of creating sec row class, can't think of solution, , solution seems unnecessary. main.cpp #include "array2d.h" int main() { int const x(1), y(1); array2d<int> arr(3, 3); int value(0); (int row(0); row < 3; ++row) (int column(0); column < 3; ++column) arr[row][column] = ++value; std::cout << arr[x][y]; array2d<int> const carr(arr); //everything's fine here std::cout << carr[x][y]; //error std::cout << "\n\n[ pause: press come in exit program. ]"; std::cin.get(); homecoming 0; } when seek access carr[x][y] throws ...

JQuery inline dialog? -

JQuery inline dialog? - the built in jquery dialog great widget organizing content. how create inline can have bunch of dialog in same parent div right next each other? want utilize organize content. you don't have have 2 separate dialogs organise info within dialog, split single dialog in 2 floating 2 divs together. css: div#dialogdiv { } div#dialogdiv div.div_left { float: left; width: 200px; height: 200px; } div#dialogdiv div.div_right { float: left; width: 200px; height: 200px; } html: <div id="dialogdiv"> <div class="div_left">left content</div> <div class="div_right">right content</div> </div> jquery

c# - semi-private inner-class -

c# - semi-private inner-class - i'm implementing union-find info construction in c#. elements must extend element inner-class, i'd to maintain fields in class private outside world. need public direct outer-class, however. folloowing code not compile due "inconsistent accessibility": class disjointsetforrests<t> t : disjointsetforrests<t>.element { private class privateelement { public element p; public int rank; } public class element : privateelement { } public void makeset(t x) { x.p = x; x.rank = 0; } public t findset(t x) { if (x != x.p) x.p = findset(x); homecoming (t)x.p; } public void union(t x, t y) { link(findset(x), findset(y)); } public void link(t x, t y) { if (x.rank > y.rank) { y.p = x; } else { x.p = y; if (x.rank == y.rank) y.rank++; } } } is ther...

c# - Error at initialising array variables -

c# - Error at initialising array variables - i pretty sure have initialised everything, still throws "object reference not set instance of object." cell[,] cell; bool[,] updatecell; int areasizex; int areasizey; int maxage; public void reset(int areasizex, int areasizey, int maxage) { areasizex = areasizex; areasizey = areasizey; maxage = maxage; cell = new cell[areasizex, areasizey]; updatecell = new bool[areasizex, areasizey]; (int = 0; < areasizex; i++) { (int j = 0; j < areasizey; j++) { cell[i, j].alive = false; //throws exception here ######### cell[i, j].age = 0; updatecell[i, j] = false; } } } what wrong in code? c# not allow dynamic array creation? i assume cell class (a reference type). means elements of array references. you're creating array, elements ...

windows phone 7 - Application crash when using 3G -

windows phone 7 - Application crash when using 3G - i developed application wchich using sockets connect several servers. application works fine wi-fi connection crashes on 3g connection (of course of study on real device, on emulator works fine). cannot debug due fact works wken phone connected pc. how handle problem? in advance subscribe both application.unhandledexception (for ui thread exceptions) , appdomain.current.unhandledexception (for unhandled exceptions) , seek write file before process terminated. after application crashes, utilize isetool command line re-create info machine. application.current.unhandledexception += (s,e) => writeexceptionfast(e.exceptionobject, "applicationunhandled"); appdomain.current.unhandledexception += (s,e) => writeexceptionfast(e.exceptionobject, "appdomainunhandled"); private void writeexceptionfast(exception ex, string name) { string filename = path.changeextension(name, "...

objective c - How to erase something drawn with NSBezierPath? -

objective c - How to erase something drawn with NSBezierPath? - i have created path using nsbezierpath , did [path fill] draw onto view. question how remove have drawn? one possible solution utilize [path fill] 1 time again background color not work if there background image instead of simple background color. has ideas? just remove path path array , phone call drawrect again. btw mai know in storing paths, mutable array or dictionary? objective-c cocoa uibezierpath nsbezierpath

xcode4.2 - View the malloc history in Xcode 4.2 -

xcode4.2 - View the malloc history in Xcode 4.2 - i'm trying find deallocated instance error in xcode 4.2. i've zombie objects, guard malloc , malloc stack options enabled. in console utilize shell malloc_history pid adress , shows nothing. my question knows how view malloc history of object in xcode 4.2 or i'm doing wrong? thanks. make sure input right pid , address. reference may help you: understanding malloc_history dump xcode4.2 malloc-history

c# - What are the 'intended' WCF web service consumers? -

c# - What are the 'intended' WCF web service consumers? - i have been given task display info on asp .net page on page load wcf web service returns soap xml. i've coded web service, , succesfully returns list. give-and-take downwards how consume service. naturally - sense want server-side on pageload , populate table way. impression whole concept of wcf web services soap xml response provide client-side script invoke methods receive these lists? mutual wcf web services invoke/consumed c# server-side? if service produces soap, consume on serverside. if json (rss, pox) service can straight utilize javascript. but of course of study required processing / storage plays roll in decision. c# asp.net wcf web-services soap

apache - htaccess: stop htaccess work in all folder -

apache - htaccess: stop htaccess work in all folder - i need help in htaccess code rewriterule ^([0-9a-z\-\_]+)?$ /index.php?url=$1 [l,qsa,nc] this code alter rewrite urls from /test-post-name /index.php?url=test-post-name but impact folders mean i have vb in path site.com/vb but url apper like site.com/vb/?url= how can prepare this to site.com/vb/index.php or site.com/vb the next rewrite take place if request not points valid directory or file: rewriteengine on rewritebase / rewritecond %{script_filename} !-f rewritecond %{script_filename} !-d rewriterule ^([0-9a-z\-\_]+)?$ /index.php?url=$1 [l,qsa,nc] to disable rewrites within /vb folder add together .htaccess folder , turn of rewrite engine: rewriteengine off apache .htaccess mod-rewrite

ruby - Render own partial via javascript in Rails -

ruby - Render own partial via javascript in Rails - say there partial called _hello_world.html.erb <% if toggle %> hello world on <%= link_to "turn off", what_should_come_here %> <% else %> hello world off <%= link_to "turn on", what_should_come_here %> <% end %> intially partial called index file this, <%= render :partial => 'test/hello_world', :locals => {:toggle => true} %> but after click toggle link should switch between on , off states should render own partial 1 time again overriding previous partial. how ? note: have given question in http://sscce.org/ format. instead of link_to improve utilize link_to_remote index.html.erb <div id="toggle_div"> <%= render :partial => 'test/hello_world', :locals => {:toggle => @toggle} %> </div> _hello_world.html.erb <% if toggle %> hello world on <%= l...

javascript - Zebra-like css styling for nested DIVs -

javascript - Zebra-like css styling for nested DIVs - i have nested div elements, don't know levels of nesting. need each have different background parent creating zebra-like colors. using 2 backgrounds - dark , white. effect needs similar styling odd , children in container in case children nested. can rules each nested element such as: div div div div { background-color: #fff; } div div div { background-color: #aaa; } div div { background-color: #fff; } div { background-color: #aaa; } but i'm looking more elegant solution. can done css? need javascript? any suggestions much appreciated. edit: looking solution not require elements have class, since need rearranged drag & drop (javascript) update: solution no longer relevant given update question. leaving here reference though. i utilize "even" , "odd" classes (or equivalent): div.even { background-color: #fff; } div.odd { background-color: #a...

http - Header Check C# is always 403? -

http - Header Check C# is always 403? - im trying ping list of domains initial indications if exist - if dont exist dont ping - throws , exception. not problem, except reason redirects dont ping back. so im trying http header responce of exception url. no matter 403 response. ideas? private void hunt_click(object sender, eventargs e) { listbox1.items.clear(); string hostaddress = txtkeyword.text; string combined; string[] strarray = new string[] { ".com", ".net", ".org", ".ca", ".gov" }; foreach (string str in strarray) { combined = hostaddress + str; string result = string.empty; seek { ping ping = new ping(); int timeout = 1500; pingreply pingreply = ping.send(combined, timeout); if (pingreply != null && pingreply.status.tostring() != "timedou...

fadein - Add fade-in or fade-out on the addclass / removeclass event -

fadein - Add fade-in or fade-out on the addclass / removeclass event - i beginner, please don't rough me. i created addclass , removeclass event : $(".myclass").click(function(){ $(".hiding").removeclass("hiding"); $(this).addclass("hiding"); }); this css : #wrapper a.hiding { display: none; } and html : <div id="wrapper"> <a class="myclass" href="#2"> <img src=""> </a> </div> so moment, works fine, add together fade-in action when addclass, , fade-out when removeclass tried css using -webkit-transition: 0.5s ease; but it's not working. i recommend seek this edit: realized using fadein() better, seek this: $(".myclass").click(function(){ $(".hiding").fadeout('slow', function() { $(".hiding").removeclass("oldstuffhere"); $(this).addclass("new...

PHP regex match data between html -

PHP regex match data between html - i have created regex, extracts info need, includes ">" character, how rid of it? here's code. <?php $content = file_get_contents('www.example.com'); $pattern = "/>([0-9]{2}\.[0-9]{3})/"; preg_match_all($pattern, $content, $matches); echo $matches[0][2]; ?> and html extract <td style="text-align:right" class="row">23.020</td> it gives me "<23.020" need "23.020" know it's n00b question, how rid of "<" $content = '<td style="text-align:right" class="row">23.020</td>'; $pattern = "/>([0-9]{2}\.[0-9]{3})/"; preg_match_all($pattern, $content, $matches); var_dump($matches); will give you array(2) { [0]=> array(1) { [0]=> string(7) ">23.020" } [1]=> array(1) { [0]=> string(6) "23.020" } } so ...

c++ - String implicit conversion operators to const char*/wchar_t * -

c++ - String implicit conversion operators to const char*/wchar_t * - i find mfc/atl cstring class convenient in win32 c++ code; in particular found convenient fact can pass instances of cstring win32 api's lpcwstr (i.e. const wchar_t * ) parameters directly, implicit conversion operator defined cstring . instead, when using std::wstring , explicit phone call .c_str() method required. so, why stl string classes (both std::string , std::wstring ) require explicit method phone call ( c_str() ) instead of defining implicit const char* / const wchar_t * conversion operator? are there serious pitfalls hidden implicit conversion operators? whatever theoretical concerns are, note in years of working cstring i've never been bitten feature. convenience far outweighs dangers. c++ stl

JAXB XML Marshalling Object Only, but Unmarshalling Requires Full Structure? -

JAXB XML Marshalling Object Only, but Unmarshalling Requires Full Structure? - i using standard jaxb api work xml. need marshal , un-marshal object (so result should same object). first marshal string, , opposite -- unmarshal string object. the problem marshaller.marshal(obj,os) giving me child only (enclosed in xml). when seek unmarshal back, errors missing parent tags expected. e.g. (1) marshalled string object "fieldset": <?xml version="1.0" encoding="utf-8" standalone="yes"?> <field1>field1</field1> <field2>field2</field2> (2) effort unmarshal xml string "fieldset" object: javax.xml.bind.unmarshalexception: tag name "field1" not allowed. possible tag names are: - linked exception: [com.sun.msv.verifier.validityviolation: tag name "field1" not allowed. possible tag names are: "parent"] in schema, "parent" top-level element should precede ...

css - Does setting the real HTML height and width of an image decrease load time? -

css - Does setting the real HTML height and width of an image decrease load time? - i have website , want improve it's performance. i've fixed mutual issues have 2 questions: 1) let's have 100x100px image , want show it. <img src=" test.jpg" height=100" width="100" alt=""> load slower <img src=" test.jpg" alt=""> ? 2) let's domain www.test.com. http absolute paths on same domain load slower relative paths ? <img src=" http://www.test.com/test.jpg" alt=""> slower <img src=" test.jpg" alt=""> ? thank ! in both of these cases, reply depends on browser implementations. these speculations: let's have 100x100px image , want show it. 'img src=" test.jpg" height=100" width="100" alt=""' load slower 'img src=" test.jpg" alt=""' ? the load time shouldn...