Posts

Showing posts from August, 2013

jQuery animate, doesn't animate -

i'm using animate() function change background position of button on hover, problem instead of 'animating' waits duration (500) , flicks new background position - without smooth transition. $('.confirm').hover(function() { $(this).animate({backgroundposition: '0, -40px'}); }, function() { $(this).animate({backgroundposition: '0, 0'}); }); that's js i'm using. ideas why it's not doing smooth transition? it's acting timeout. have both jquery , ui defined. thanks! you can't natively animate background position. animation properties expect single value, opacity:1 , left:'50px' , etc. this plugin should add functionality need: http://www.protofunc.com/scripts/jquery/backgroundposition/

javascript - Can i do the effect shown in this page using jquery? -

please @ page: http://www.nike.com/nikeos/p/nikegolf/en_us/ in slide number 2, there midpanel growing effect onmouse over.some panels step aside @ same time or grows on another. can see, background changes, box grows content. think flash, but, there way obtian same results using jquery? have jquery experience dont wich function usefull combine results thanks i flash if want thing try http://api.jquery.com/animate/ i did flash effect customer using .animate() can using images each part.

c# - problem with HttpContext in mvc 2 -

i error when try access httpcontext.current controller. want session add session specific data, , gives me problem: var = httpcontext.current.session; the error, allegedly 'system.web.httpcontextbase' not contain definition 'current'. when try access httpcontext.current controller you should never use httpcontext.current . simply use session property access session: public actionresult index() { session["foo"] = "bar"; ... } the reason error getting because controller class has property called httpcontext when write httpcontext.current property used , not static current property on httpcontext class.

c# - Remove or Refresh DataTable -

i running issues application wrote. month calendar made out of panels/listboxes each day of month. populate listboxes using following: private void populateeventlistboxes(int offsetnumber, int monthdays) { string locationselected = this.locationcombobox.text.tolower(); (int = 0; <= (monthdays - 1); i++) { datetime dateselected = convert.todatetime(m_arraydatelabel[offsetnumber + i].text).date; var tempcalendar = new data.dataset.vwget_calendardetailsdatatable(); switch (locationselected) { case "all": data.manager.calendardetailstableadapter.fillbydate(tempcalendar, dateselected); break; default: data.manager.calendardetailstableadapter.fillbydatecity(tempcalendar, dateselected, locationselected); break; } foreach (data.dataset.vwget_calendardetailsrow row in tempcalendar) { ((listbox)m_arrayevent...

NSMutableArray empties after tableView editing turned on -

very simple situation... strange problem. i have retained ivar nsmutablearray load few objects in on viewdidload. array used populate tableview. fine... until i turn editing on tableview. array empty! ideas? you may need initialize nsmutablearray in init method. that's common problem i've noticed- adding objects array hasn't been created doesn't let access objects later.

flash - embed .obj (or any 3d file) on a website -

how go embedding 3d object onto website allows drag rotate (preferably directions not horizontally) using javascript, should possible 1 of javascript 3d engines: free javascript 3d engine i have no experience javascript 3d can't comment except note probable possibility. flash: several 3d graphics engines: free flash 3d engines i working away3d , find fit needs. has air app called prefab made 1 of developers makes work 3d formats easier. whether other engines have same or harder workflow can not comment. which 1 choose though. prepared battle out few days working though, can hard if new stuff. there other options, java applet or unity3d plugin, not looking for.

java - Android problem drawing a bitmap with opengl es -

i'm using https://github.com/markfguerra/glwallpaperservice/ make android live wallpaper. i'm trying load png file fullscreen background, black screen. i've searched few days still haven't found out problem. i'm doing following: public void onsurfacecreated(gl10 gl, eglconfig config) { gl.glenable(gl10.gl_texture_2d); gl.gltexparameterf(gl10.gl_texture_2d, gl10.gl_texture_min_filter, gl10.gl_linear); gl.gltexparameterf(gl10.gl_texture_2d, gl10.gl_texture_mag_filter, gl10.gl_linear); } and every frame: public void ondrawframe(gl10 gl) { bitmap bitmap = bitmapfactory.decoderesource(context.getresources(), r.drawable.target00074); int[] textures = new int[1]; gl.glgentextures(1, textures, 0); gl.glbindtexture(gl10.gl_texture_2d, textures[0]); glutils.teximage2d(gl10.gl_texture_2d, 0, bitmap, 0); } i recommend dive opengl basics don't seem know doing. screen black because uploadin...

Search through Drop down list in asp.net -

i making page in asp.net using c# , page consists of 2 drop down list 1 state , 1 subjects, both data coming database, , there third database table storing user details , third table consists of name class , subject now problem on click of search button want search users table , return value selected person searching through drop down list on master page , result displayed on next page please search button, , write on second page on want display results. your badly needed thanks in advance. this sounds homework assignment... have tried solve on own? did try, , what-if-any problems did run into? here's 1 (of thousand other) tutorials walk through filtering result page using drop-down. http://msdn.microsoft.com/en-us/library/aa581789.aspx good luck!

Is it possible to resize the canvas in android? -

[android] have linearlayout contains 2 views, 1st imageview , th 2nd 1 have canvas on it. if mlinearlayout.addview(i); , mlinearlayout.addview(c); shows both if in reverse oder (mlinearlayout.addview(c) , mlinearlayout.addview(i)) shows canvas. wanted share screen between these 2 views. can me on this? @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); mlinearlayout = new linearlayout(this); mlinearlayout.setbackgroundcolor(0xff74ac23); imageview = new imageview(this); view c = new drawview(this); i.setimageresource(r.drawable.bol_groen); i.setadjustviewbounds(true); mlinearlayout.addview(i); mlinearlayout.addview(c); setcontentview(mlinearlayout); } } public class drawview extends view { private shapedrawable mdrawable; public drawview(context context) { super(context); setfocusable(true); //necessary getting touch events mdrawable = new shapedrawable(new ovalshape()); ...

data structures - Multiple Keys to Single Value Map Java -

i think question similar one: how implement map multiple keys? important difference. in question (if understanding of correct, please let me know if isn't), keys supposed unique. want have map in form: mymap keys aren't unique. if doesn't make sense, want 2 dimensional array, rather refering elements coordinates, want refer them pairs of objects. anyone have ideas either library works or way implement myself? far libraries go, i've looked @ apache commons , guava, neither seem have want. the table data structure in guava seems meet requirement of refering value pair of objects.

Folding of text in vim with Markdown syntax plugin -

i have markdown syntax highlighting plugin installed vim (macvim). it's working well, automatically folds down headings, lists, etc. does know how disable folding of sections completely plugin this? want able open markdown documents without having every section collapsed every time... since question popped first in search, i'll duplicate zeuxcg's answer this question : set nofoldenable " disable folding

Having a problem with pass by reference in two dimensional array in c++ -

i have variable called names 2 dimensional array. declared below there maximum of 5 names , each name consist of 256 characters. int main(){ char names[5][256]; strcpy(names[0],"john"); strcpy(names[1],"matt"); printf("%d\n",sizeof(names)/256); //this prints out 5 correct passit(names); } void passit(char names[][256]){ printf("%d\n",sizeof(names)/256); //this prints out 8 seems size of pointer } how should change in passit function, number of elements printed correctly? your code c-style. if you're writing c++ suggest using std::cout , std::vector , std::string : void passit(std::vector<std::string> const& names) { std::cout << names.size(); } int main() { std::vector<std::string> names(5); names[0] = "john"; names[1] = "matt"; std::cout << names.size(); passit(names); } other...

Remove html special character with regex and jQuery -

what necessary regular expression match € special character following html string? &euro;20.000.000,00 ultimately, want strip € symbol number. currently, code looks this: num = $("#number").html(); num.replace('&euro;',''); $("number").html(num) but of course need replace '&euro;' correct regex. it appears time manipulating text jquery, html abbreviation &euro; has been replaced actual unicode value -- true single character € . regular expression refers unicode character value should trick you. var x = $('#number').html(); x = x.replace(/\u20ac/, ''); $('#number').html(x);

How to dynamically load javascript function (with Ajax in Dojo) with arguments -

i implementing require/load function retrieves , executes remote piece of javascript code. works fine, , using workaround give arguments declaring global variables, wanted know best way pass arguments in situation. here function loads remote script module.require = function (modulename , args){ if (! module.has(modulename)){ dojo.xhrget({ url: 'module.require.php', handleas: "javascript", content : { module : modulename }, load: function() { }, error: function(errormessage) { console.log('there error module.require()'); console.error(errormessage); } }); } }; my first question context modulename executed in when code stored in modulename.js fetched , dynamically executed? if in scope of function module.require can refer args . if executed in global scope ( window ) know how declare lo...

Rendering a form together with other content into a Drupal 7 block -

i'm trying render block in module contains both form , list of links. can display 1 or other correctly, apparently not understand render array format enough them both rendered @ same time (one above other) in same block. using drupal 7.4 example setting block content show list: $block['subject']='title'; $items= // code generates list of links array $theme_args=array('items'=>$items,'type'=>'ul'); $block['content']=theme('item_list',$theme_args); return $block; example setting block content show form: $block['subject']='title'; $block['content']=drupal_get_form('mymodule_myform_function'); // call function returns usual form array return $block; each case works fine individually me. how can combine form , list 1 block['content'] array can rendered in 1 block? in advance. i think should work, haven't tested though: $block = array( 'items...

jQuery (content slider) not working in WordPress template -

the problem i've added jquery content slider (coda slider 2.0) wordpress template page breaks (only text "loading" appears). demos i've provided live examples here see code in action: broken slider | working slider what i've tried i've tried substituting dollar sign "jquery" in templates head no avail. <!--slider--> <!-- begin stylesheets --> <!--<link rel="stylesheet" href="<?php bloginfo('stylesheet_directory') ?>/js/coda-slider/stylesheets/reset.css" type="text/css" media="screen" />--> <!--commented out because it's called previously.--> <link rel="stylesheet" href="<?php bloginfo('stylesheet_directory') ?>/js/coda-slider/stylesheets/coda-slider-2.0.css" type="text/css" media="screen" /> <!-- end stylesheets --> <!-- begin javascript --> <!--...

c# - How to do optional parameters in LINQ? -

here i'm trying do: (dc.det_cases.where(c => c.productid == pl.productid && oldtor == false ? c.oldtor == oldtor : && (productlinename.toint() == 0 || productlinename.toint() == c.productlineid) && (productcategory.toint() == 0 || productcategory.toint() == c.productcategoryid) && (issuetype.toint() == 0 || issuetype.toint() == c.issuetypeid) && (issue.toint() == 0 || issue.toint() == c.issueid) ) .firstordefault() != null) this line i'm trying do. oldtor == false ? c.oldtor == oldtor : inside where linq statement. if value false compare value. if not, ignore it. the easiest way set other option true . ie: !oldtor ? c.oldtor == oldtor : true this means if oldtor false, want compare oldtor's, otherwise, keep evaluating rest of expression. as aside, split each part ...

javascript - Where do I put the $(document).ready()? -

i've been trying add javascript html/css, been running around in circles. my current set-up html, css, , javascript files (2 files; javascript code, , jquery's code) separate, linked each other via html page. so here questions: 1) put link jquery code within html head? or within javascript code page? 2) code go? html page, or javascript page? $(document).ready(function(){ //code here }); 3) above, 'code here', mean javascript code, right? not html code? 4) i've read initializing javascript code @ bottom of html page. take though, don't have jquery's .ready function, right? you should javascript files either in <head> or above closing </body> tag. the code can go anywhere really, suggest external javascript page. yes this correct.

c++ - Memory leak with map -

i can't clear map memory (i checked valgrind ). #include <map> class testmap { public: testmap(){} ~testmap(); void insert_map(int, int); private: std::map<int,int> _map; }; void testmap::insert_map(int i, int j){ _map.insert( pair<int, int>(i,j)); } i tried _map.clear() , erase() , deleted _map->second manually not still no luck. thanks replies. map alone not problem map singleton causing leak. what's wrong code below? #include <iostream> #include <string> #include <map> #include <algorithm> #include "object.h" #include<boost/smart_ptr.hpp> using namespace std; class singleton { public: // wrapper around object class class object { public: object() : _object(new object()) {} object get(void) { return _object.get(); } private:...

wolfram mathematica - Plot3D: Drawing Points at Mesh Intersections -

Image
i want draw points @ visible mesh intersections, this: plot3d[sin[x + y^2], {x, -3, 3}, {y, -2, 2}, mesh -> {1, 4}, boxed -> false] desired output: i calculate mesh going be, based on plotrange , mesh cardinality, , draw points there, think there should easier alternative way. a big plus able chose point color based upon function value. also, labeling points wonderful. any ideas? for it's worth, simple solution well. plus easy use same coloring function both surface , points: g = plot3d[sin[x + y^2], {x, -3, 3}, {y, -2, 2}, mesh -> {1, 4}, boxed -> false, colorfunction -> "rainbow"]; p = listpointplot3d[table[{x, y, sin[x + y^2]}, {x, -3, 3, (3 - (-3))/(1 + 1)}, {y, -2, 2, (2 - (-2))/(4 + 1)}], colorfunction -> "rainbow", plotstyle -> pointsize[large]]; show[g, p] edit: if want make customized myplot3d, think following should do: myplot3d[f_, {x_, xmin_, xmax_}, {y_, ymin_, ymax_}, mesh -> {i_integer...

c - Assign to 2D array a 2D array in a struct -

i have function tries loop through 2d array in struct: typedef struct node { int grid[3][3]; } node; void somefunction(node *node) { int grid[3][3] = node->grid; //loop through } when try compile mp.c:42: error: invalid initializer you cannot assign arrays in c. not allowed. when wrote: int grid[3][3] = node->grid; you attempting initialize local array, grid , passed in node . if permitted (which isn't), you'd not need loop afterwards. you can assign structures, though, if contain arrays, if local structure node , have written: node local = *node; you not need loop through arrays afterwards initialize local . you can loop through arrays, doing copy 1 element @ time: for (int = 0; < 3; i++) (int j = 0; j < 3; j++) grid[i][j] = node->grid[i][j]; you can use memmove() or memcpy() : int grid[3][3]; assert(sizeof(grid) == sizeof(node->grid)); memcpy(grid, node->grid, sizeof(grid)); at ...

mysql - sql select in relation many-to-many not works as expected -

i have following tables in relation many-to-many: table product: prd_cod (pk) cat_cod (fk) prd_nome table description_characteristic: prd_cod(fk) id_characteristic(fk) description table characteristic: id_characteristic(pk) name we suppose cat_cod 1, show data this: i have done select below solve problem: select p.prd_cod,p.prd_name,c.name_characteristic,dc.description product p,description_characteristic dc, characteristic c p.prd_cod = dc.prd_cod , dc.id_ccharacteristic = c.id_characteristic , p.cat_cod = 1 but data shown way: prd_cod prd_name name_characteristic descript 1 pen color pink 1 pen manufacturer kingston 1 pen type brush 1 pen weight 0.020 i want show result way: prd_cod prd_name name_characteristic descript name_characteristic descript 1 pen color pink type brush ...

c# - programmatically adding files to the Kentico Media Library -

using cmsdesk , click on tools tab, media library can add files inbuilt kentico media library. there way using api? you can using kentico api. quite rich documentation , samples out there bit lacking. following sample method (actually used web service method have both remote , local pages use it) , sample method calls (say 'edit' web page). filelogo - > protected system.web.ui.webcontrols.fileupload filelogo; [webmethod] public bool import(int libraryid, string foldername, string filename, byte[] bytes) { siteinfo siteinfo = siteinfoprovider.getcurrentsite(); medialibraryinfo libraryinfo = medialibraryinfoprovider.getmedialibraryinfo(libraryid); filename = filename.replace(" ", "-").replace("&", "-").replace("'", "-").replace("+", "-").replace("=", "-").replace("[", "-").replace("]...

mono - how to get Text Messages list from iphone in monotouch -

hi im working on iphone application using monotouch im trying list of text messages stored in iphone (inbox), getting contact information there abaddressbook class not found class text messages can 1 me in regards how can list of text messages .thanks in advance. you can't text messages messages app in iphone. apple not allow this.

How to check number of facebook app invitation sent by a particular users? -

i encourage facebook app users invite more friends join app. therefore, let them freely use app after invite more 50 friends (no matter friends join app or not ok). but problem is: how can check number of invitation sent users? thanks. rgds there no built in option in facebook this. i'm using fb request dialog , whenever send request facebook return set of request id's (in case of multiple simultaneous requests) . and have own table 'tbl_requests' can update current user_id request_id returned facebook dialog.. advantage can backtrack these request_ids when invited person accepts invitation. the sample code be, function invite(){ var receiveruserids = fb.ui({ method : 'apprequests', message: 'just invite msg' title: 'select friends join app', }, function(receiveruserids) { if(receiveruserids){ $.ajax({ type: "post", url: "your_file.php", req_ids="+receiveruserids.r...

c# - Reloading MainPage in WP7 to restart the app -

my app has 1 page - mainpage. when user selects "new" applicationbar menu want clear source data , reload page. can navigationservice? following line gets navigation failed exception in rootframe of app when called within mainpage itself: this.navigationservice.navigate(new uri("mainpage.xaml", urikind.relative)); can done easily, or need create second page navigate before navigating mainpage? using navigation purpose sounds horrible way of doing it! if create second page workaround problem facing, remain on back-stack, meaning reachable when user hits button. i recommend adopting mvvm pattern (see example here ). when new button pressed, create new view model , associate mainpage setting datacontext , have affect desire of clearing , resetting state.

array problem in javascript : Logic -

i have 2 arrays of equal length. array1 = {a,a,a,b,b,b,b,b,c,c,c,c,c,c,d,d,d,d,e,e} array2 = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20} want create object. var obj = { 'a': {1,2,3} 'b': {4,5,6,7,8} 'c': {9,10,11,12,13,14} ..... ..... } can me logic. var group = {}; if (array1.length == array2.length) { (var i=0, j=array1.length; i<j; i++) { if ( !(array1[i] in group) ) group[array1[i]] = []; group[array1[i]].push(array2[i]); } }

oracle adf - Which is best to use? ADF faces components or trinidad components? -

i got know trinidad of apache myfaces. web application have seen peoples using adf faces components. trinidad components web application rich user interface? both trinidad , adf faces components based on jsf components. adf faces have component set richer trinidad. can choose based on type of application going work with.

objective c - 3D transforms in UIWebView not captured properly with 'renderInContext' -

i starting out objective-c ios. i've created simple app lives in uiwebview , generates imagery based on user input, , needs allow users capture , share creations in online gallery. have made method captures image of uiwebview . don't have code in front of me right now, it's similar code in how take screenshot programmatically , other sources online, , i'll upload later if necessary. the trouble i'm having entire app relies on css3 3d transforms within uiwebview create imagery, , when screenshot generated, transforms appear flattened. understanding renderincontext: supposed show uiwebview appears user, not what's happening. know why cold be, or how around it? i've tried research on one, , closest thing find unanswered question: gray box on uiwebview screenshot .

iphone - Heavy bug in Apple's Reachability source code? (reachabilityForLocalWiFi) -

i wanted integrate network status notification project , used apples's reachability class this. nevertheless might have found bug in code or maybe caused simulator itself. code here: - (void)start { [[nsnotificationcenter defaultcenter] addobserver:self selector:@selector(updatestatus:) name:kreachabilitychangednotification object:nil]; reachability *wifi = [[reachability reachabilityforlocalwifi] retain]; [wifi startnotifier]; } - (void)updatestatus:(nsnotification *)notice { networkstatus s = [[notice object] currentreachabilitystatus]; if(s == notreachable) { nslog(@"wifi not reachable"); } else { nslog(@"wifi reachable"); } } now, happens when "start" called: 1) updatestatus message isn't fired - okay, might not bug, maybe normal behaviour 2) ...

php - How not to submit a form if no radio button is checked -

i using php in order create html form. form has 3 radio buttons , submit button. in initial state of form, none of radio buttons checked. want make form not submitted if non of radio buttons checked. there way that? attached part of php code. for($i=0; $i<$nchoices; $i++) { $text='<input type="radio" name="answer" value="' . $idchoices[$i] . '"'; $text.="> ". $choices[$i] . "</input>"; $choiceoutput.= $text."<br /><br />"; } thanks! this javascript can used simple client-side validation. it's not considered safe validate on client-side if purpose see if user selected value do. otherwise further validation needs taking place in php script. <script type="text/javascript"> function validate() { var retval = false; (var i=0; < document.myform.r.length; i++) { if (document.myform.r[i].checked) { retval = true; } ...

iphone - Character assignment issue with Objective C -

i try assign value char this char cipher1[16] = {55,149,31,253,212,158,217,64,226,62,149,241,255,147,115,155}; but after assigning assign value chiper1 not exact value  55 -107 31 -3 -44 -98 -39 64 -30 62 -107 -15 -1 -109 115 -101  is correct assignment char in objective c this difference between signed , unsigned byte ... print in form of unsigned char , should same result. note: char --- signed value greater 128 take 8 bits hold -- values greater 128 shown in negative(it refers sign bit.)

Can a Window Handle in .NET change it's value? -

during lifetime of .net process, handle of system.windows.forms.form , lets main form used in application.run(form) change it's value, i.e. if using value of handle in different process, e.g. intptr handle = user32.findwindow(null, "name") , there case handle might invalidated .net runtime? edit i need know handles because want use sendmessage , wm_copydata , ipc. a window handle guaranteed valid , not reused long window lives. it's index in nature, valid globally , behaves more global id kernel handle(which valid in 1 process , pointer in nature). once window gets closed window handle might reused , points window. but what's not obvious if lifetime of form , underlying windows window same. vaguely remember in delphi's vcl(which spiritual predecessor of windows.forms) property changes recreated window in background. the existence of control.recreatinghandle property seems strong indication indeed lifetime of underlying window can sh...

javascript - extract province from location using google api -

i'm trying extract information location using google map api. take , it's possible don't understand i've put bounds parameter. request: var address = document.getelementbyid("address").value; geocoder.geocode( { 'address': address}, function(results, status) { if (status == google.maps.geocoderstatus.ok) { alert(results[0].formatted_address); } else { alert("geocode not successful following reason: " + status); } }); i suppose add bound after 'address':address not clear how. tryied doesn't works: geocoder.geocode( { 'address': address, "types":["sublocality","political"]}, function(results, status) { i don't know if have familiar italian province need that: request: venezia response: ve or venezia request: murano response: ve or venezia ---- improved: using http://maps.googleapis.com/maps/api/geocode/json?address=murano&sensor=f...

javascript - How to change registry settings on a system through web browser -

i trying develop web page allow user edit registry settings in windows system. can achieve client side scripting language.? if yes please suggest me language do. can jquery or other type of library. due obvious security concerns, possible in internet explorer(!). not jquery library, activex control; it's quite unpleasant use. you have been warned, here documentation : http://technet.microsoft.com/en-us/library/ee156602.aspx

soapui - Using excel Datasource test step that contains more than one Worksheet? -

is possible use 1 excel datasource contains more 1 worksheets? you can use excel file contains more 1 worksheet. in soapui in worksheet input field (in configuration of datasource ) can specify 1 worksheet... what can specify name of worksheet in property (e.g. ${#testcase#worksheet} ) , change value of property if want change worksheet.

apache - Domain .htaccess redirect issue -

i'm trying create redirects .htaccess never manage functional. maybe here can me. what need is: http://domain.se , http://domain.com redirect http://www.domain.com . i need http://domain.se/somefolder , http://domain.com/somefolder http://www.domain.se/somefolder redirect http://www.domain.com/folder . i've tried accomplish myself end errors data not being sent. options +followsymlinks -multiviews rewriteengine on rewritebase / # folder rewrite rewriterule ^somefolder$ folder [l] # domain redirect rewritecond %{http_host} =domain.com [or] rewritecond %{http_host} =domain.se rewriterule (.*) http://www.domain.com/$1 [r=301,l] this placed in .htaccess file in website root folder. if placed elsewhere tweaking may required. first rule rewrite (internal redirect) requests /somefolder /folder . if need 301 permanent redirect, replace [l] [r=301,l] second rule domain redirect job. rule redirect if domain domain.com or domain.se . if want have redir...

Event binding in MooTools like jQuery -

is there way assign multiple event types in mootools jquery? mootools: $$('#id').addevents({ keyup: fn, click: fn }); jquery: $('#id).bind('keyup click' ,fn); yes, there way, through powerful implement : element.implement({ fakebind : function(evtsstr, callback){ var events = evtsstr.split(' '), = 0, l = events.length; (; < l; i++){ this.addevent(events[i], callback); } } }); $$('div.myclass').fakebind('click mouseleave', function(event){ console.log(event.type); }); demo

Magento - custom collection query to load the products that have the same attribute value -

i want make custom collection query load products have same custom attribute "art_nr". i have done : $art_nr = mage::getmodel('catalog/product')->load($_product->getid())->getart_nr(); to load attribute in current product page, , want use in request. thanks :) a basic example like: $_artcollection = mage::getmodel('catalog/product')->getcollection() ->addattributetoselect('*') ->addfieldtofilter('art_nr', $art_nr); also note magic getter 'art_nr' 'getartnr', no need underscores!

c# - Can I use a UserControl to reuse a DropDownExtender despite having page-specific parameters? -

in application, have large number of pages repeat similar grids, , every single 1 going have 'dropdownextender' ajax control in leftmost column, contain many links other pages row. now, i'd avoid code repetition having dropdownextender user control. however, 1 crucial aspect of control contain hidden fields/values links relating specific row - example, have <asp:hiddenfield id="hdnid" runat="server" value='<%# bind("id")' /> i'm assuming not work - how pass on values user control in efficient manner? if have public property in user control can set either in code or in markup, doing hidden field above. you may need: [bindable(bindablesupport.yes)] if need data-binding support.

Is it possible to mass edit contacts using the google android api -

i know if possible using android api access of contacts on samsung galaxy s2 , string replace on every telephone number , remove dashes. for reason when changed phones recently, new s2 has these dashes in telephone numbers , want remove them. thanks.

java - Inputstream handled by different objects depending on the content -

i writing crawler/parser should able process different types of content, being rss, atom , plain html files. determine correct parser, wrote class called parsefactory, takes url, tries detect content-type, , returns correct parser. unfortunately, checking content-type using provided in method in urlconnection doesn't work. example, string contenttype = url.openconnection().getcontenttype(); doesn't provide correct content-type (e.g "text/html" should rss) or doesn't allow distinguish between rss , atom (e.g. "application/xml" both atom or rss feed). solve problem, started looking clues in inputstream. problem having trouble coming elegant class design, need download inputstream once. in current design have wrote separate class first determines correct content-type, next parsefactory uses information create instance of corresponding parser, in turn, when method 'parse()' called, downloads entire inputstream second time. public parser ...

.net - Initialize sbyte** in C# unsafe context -

how can sbyte** initialized in c# unsafe context? i need sbyte** parameters; to filled 3 strings: "first", "second", "third". here possible solution using byte** . should compatible sbyte** encoding used ascii , has values 127. unsafe static void main(string[] args) { fixed (byte* arg0 = encoding.ascii.getbytes(args[0]), arg1 = encoding.ascii.getbytes(args[1]), arg2 = encoding.ascii.getbytes(args[2])) { byte*[] arr = { arg0, arg1, arg2 }; fixed (byte** argv = arr) { ... } } }

java - Music library in android -

in objective-c there class bring ipod songs array, , looking in android can connect music library of device. use mediastore or more specifically, mediastore.audio .

mysql - View and table in same name is it possible -

is possible create mysql view , table in same name for example have table hs_hr_employee want create view same name create view hs_hr_employee select * hs_hr_employee; i m getting following error #1050 - table 'hs_hr_employee' exists any thankful regards you can't , give view different name like hs_hr_employee_view from manual within database, base tables , views share same namespace, base table , view cannot have same name.

java - How to calculate an angle of a right triangle knowing two sides? -

i need calculate angle between 2 points in 2d space. idea calculate using right triangle? please give me formula, written in java code. thank you! here's code: public boolean onareatouched(touchevent pscenetouchevent, float ptoucharealocalx, float ptoucharealocaly) { double angle = math.atan2( ptoucharealocalx - boundspritecenterx, boundspritecentery - ptoucharealocaly); angle = math.todegrees(angle); log.i("egor", "angle " + angle); return true; }; and here's i'm getting when rotate finger around sprite: 07-21 16:07:00.736: info/egor(12600): angle -11.401802094139539 07-21 16:07:00.786: info/egor(12600): angle -11.349729213136412 07-21 16:07:00.826: info/egor(12600): angle -11.422536712363058 07-21 16:07:00.956: info/egor(12600): angle -11.234933754467884 07-21 16:07:00.986: info/egor(12600): ang...

windows phone 7 - WP7 Tile Notification with invalid background image name -

from web service, if send tile notification background image name(eg:noname.jpg) not exist in app client bundle. application tile image pinned start turns phone accent color(i have set phone theme background color blue, application tile image becomes plain blue color image). expected behavior or there should not change in tile image? this expected. the accent colour displayed layer behind image use on tile. how can use transparency include accent colour in tile image. if use invalid uri no image displayed, background layer.

sql - Binding a database view to a c# .net gridview -

i have been using excel view database tables binding sql database views in excel , making spreadsheet. works fine want solution in code. is there way in c# asp.net bind database view directly gridview when given view name string? ** * solved * **** i did more research , found solution. main issue didn't want have make business objects or have stored procedure on database. the solution found use sqldatasource. set sqldatasource.connectionstring , set sqldatasource.selectcommand "select * from" +myviewname , bind datasource gridview. using method have pass in table/view name , gridview populated database directly. allows me use same code , thing needs changing database view name string.

How to write a xquery in SQL Server to read all the childnodes from an XML data column in a table? -

i have table in sql server named [queryresult] columns of type init, of type xml. here sample xml of result column data. <output> <item> <value001>2023038.09</value001> <value002>265127.97</value002> <value003>459868.86</value003> <value004>16000.01</value004> <value005>552010.15</value005> <value006>21404.96</value006> <item> <item> <value001>15655501.89</value001> <value002>17172.50</value002> <value003>8345.31</value003> <value004>-117264374.12</value004> <value005>-160893.48</value005> </item> </output> i need query returns output follows: id element value ----------------------------------- 1 value001 2023038.09 2 value001 2023038.09 3 value002 265127.97 4 value003 459868.86 5 value004 16000.01 6 value005 552010.15...

iphone - crash at drawInRect:rect, I've the solution but don't know how? -

the app works fine iphone simulator when run in actual iphone device crashes @ following line: [ucdview.image drawinrect:rect]; i've searched , found solution don't know how solve time short when have present on friday. @ following solution: must drawinrect: separate context executed on main thread? the part crash happen in sculpture.m inside viewdidload() - (void)viewdidload{ [super viewdidload]; clcontroller = [[corelocationcontroller alloc] init]; clcontroller.delegate = self; [clcontroller.locmgr startupdatinglocation]; currentloc = [[uiimageview alloc] initwithimage:[uiimage imagenamed:@"redpin.png"]]; uiimage *ucdimage = [uiimage imagenamed:@"ucd.png"]; self.ucdview = [[uiimageview alloc] initwithimage:ucdimage];//creating view ucd image ucdview.userinteractionenabled = yes; [self loadingfile]; uiscrollview *myscrollview = [[uiscrollview alloc] initwithframe:cgrectmake(0, 0, self.view.frame.size.width, self.view.frame.size.height)]; ...

windows - Moving hg repo folder using copy-paste? -

i have hg repo on local drive. new hg , want know if can move folder around freely. not talking folder under version control, talking folder contains repo self. i've found lot of similar questions seem talking folder under version control. answer use hg clone want know if can cut , paste whole repo. i using windows xp if matters. yes, can copy repository copying .hg folder. imagine following folder structure: myrepo myrepo\.hg myrepo\file_under_version_control.txt myrepo whole repository (or called it, "folder under version control"). when remove .hg folder it, myrepo normal folder without version control. when move .hg folder somewhere else, can create new working directory running hg update , new folder .hg resides complete repository again.

sqlite - many-to-many query runs slow in windows phone 7 emulator -

my application using sqlite database. in database, have many-to-many relationship. when use sqlite addon/tool firefox, sql query joining tables in many-to-many runs pretty fast. however, when run same query on emulator, takes long time (5 minutes or more). haven't tried on real device, thus. can tell me going on? for example, have 3 table. 1. create table person (id integer, name text); 2. create table course (id integer, name text); 3. create table registration(personid integer, courseid integer); my sql statements have tried follows. select * person, course, registration registration.personid = person.id , registration.courseid = course.id and follows. select * person inner join registration on person.id=registration.personid inner join course on course.id=registration.courseid i using sqlite client http://wp7sqlite.codeplex.com . have 4,800 records in registration table, 4,000 records in person table, , 1,000 records in course table. is queries? sqlite clien...

Prevent gdb from stopping at watchpoints -

file main.c: #include <stdio.h> int main() { int i; (i=0; i<30 ;i++) { printf ("%d\n", i); } return 0; } in gdb, set breakpoint, specify watchpoint command executed on breakpoint: (gdb) break main breakpoint 1 @ 0x4004b0: file main.c, line 6. (gdb) command type commands when breakpoint 2 hit, 1 per line. end line saying "end". >watch >end execution gonna stop whenever watched variable changed, problem there no way(to knowledge) tell gdb print value of watched variable , continue because nested watchpoint. if standalone watchpoint done using command 'continue' (when i'm in scope if main()): (gdb) watch hardware watchpoint 2: (gdb) command type commands when breakpoint 2 hit, 1 per line. end line saying "end". >continue >end so, there way gdb not stop on nested watchpoint, , print value change? or better yes, specify commands executed on nested watch/breakpoints? i further tried ...

cocoa - Mac OS Lion and Sandboxing -

i developping file manager app mac os , wondering can impact of new sandboxing function of mac os. any experience? thanks sandboxing application optional. have put code in application sandbox using sandbox_init() function. references : http://techjournal.318.com/security/a-brief-introduction-to-mac-os-x-sandbox-technology/ http://developer.apple.com/library/mac/#documentation/darwin/reference/manpages/man3/sandbox_init.3.html

mapping Properties in Entity Framework without PK? -

i tried create ef-model(vs2010, .net4) 3 tables, each table pk called sync_id. table_head: (sync_id (pk), grid_id int, serialnumber int, year int) table_point: (sync_id (pk), grid_id int, serialnumber int, year int,point_number int) table_plant: (sync_id (pk), grid_id int, serialnumber int, year int,point_number int,plant_number int) associations: table_head "1 many" table_point "1 many" table_plant as can see grid_id, serialnumber, year of table_head should mapped grid_id, serialnumber, year of table_point and grid_id, serialnumber, year of table_point should mapped grid_id, serialnumber, year,point_number my first approach use grid_id, serialnumber, year grouped pk, violation of condition. so way use sync_id pk. how possible map other field described above? can map pk_columns? hope have ideas me. other approaches welcome, . best regards ! other approach create correct database structure!!! you have sync_id pk use fk in dependent e...

initialization - CDI / Weld SE - @Observes ContainerInitialized doesn't work -

i have weld se, bootstraped way: weldcontainer weld = new weld().initialize(); and following bean @applicationscoped public class entitymanagerstoreimpl implements entitymanagerstore { static { system.out.println(" aaaaaa emsi static"); } public entitymanagerstoreimpl() { system.out.println(" aaaaaa emsi constructor"); } public void init( @observes containerinitialized containerinitialized ) { system.out.println(" aaaaaa emsi init"); } ... } according weld docs, init() method should called. it's not. other beans working fine. can wrong? oh... should have read docs more carefuly. containerinitialized only fired startmain helper class. don't that, i'd expect fired weld.initialize() . created https://issues.jboss.org/browse/weld-949 (pls vote if share oppinion me.)

javascript - Google map markers - filtering based on category -

can show me example of displaying google map markers belong multiple categories , filtering these markers checkboxes - keeping in mind 1 marker may belong more 1 category? i built map interface allows user filter markers category (with multiple categories per place). http://www.audleytravel.com/destinations/southeast-asia/thailand/places-to-go.aspx from memory, categories stored data on each marker, , when category clicked markers iterated through create matching set. js in: http://www.audleytravel.com/js/2011/home/destinations/continents/countries/places%20and%20excursions/places%20map.js hope helps - let me know if need more explanation.

php - Subtract one DateTime from another and return days -

i have 2 datetime objects. 1 represents 2 days , other represents 2 days , 6 months now. i need able count number of days between these 2 dates display users dates can book on. i have calculated 2 dates struggling finding way subtract them , return difference in days. $first; // first datetime object $second; // second datetime object $diff = $first->diff($second); echo $diff->days; also take @ dateinterval class @ php.net

xslt - Help on converting XML to positional text file without stripping spaces -

i'm trying create positional file out of xml. created xslt , work fine unless field filled spaces. in case xsl returns 1 space. i'm using msxml (6.0). i have tried following no luck: <xsl:strip-space elements="*"/> <xsl:preserve-space elements="*"/> <fo:block white-space-collapse="false" white-space-treatment="preserve" > <!-- code here --> </fo:block> here xml input, xslt , output. <document> <header> <title>long life queen </title> <author>sam catnip </author> <year>1996</year> <edition> 1</edition> <price> 12.99</price> <pages> 1244</pages> <authornotes> </authornotes> <abstract>it great book </abstract> </header> <header> <title>life , live...

javascript - What's the difference between Shared Worker and Worker in HTML5? -

after reading blog post: http://www.sitepoint.com/javascript-shared-web-workers-html5/ i don't it. what's difference between worker , sharedworker ? very basic distinction: worker can accessed script created it, sharedworker can accessed script comes same domain.

regex - Using powershell, in a csv doc, need to iterate and insert a character -

so csv file looks like: j|t|w j|t|w j|t|w i'd iterate through, using regex after 2 pipes , content \|.+{2}, , insert tab character `t. i'm assuming i'd use get-content loop through, i'm unsure of go there. also...just thought of this, possible line overrun next line, , therefore 2 pipes on different lines, i'm pretty sure makes difference. -thanks ok, i'll move comment discussion answer since seems potentially valid solution: import-csv .\test.csv -delimiter '|' -header 'one', 'two', 'three' | %{$_.three = "`t$($_.three)"; $_} | export-csv .\test_result.cs this works file known have 3 fields. more generic solution, if have ability determine number of fields being exported csv, then: import-csv .\test.csv -delimiter '|' -header (1..$fieldcount) | %{$_.$fieldcount = "`t$($_.$fieldcount)"; $_} | export-csv .\test_result.cs