Posts

Showing posts from March, 2011

ios - UITableView - reloadData from separate class -

i searched , looked on many similar questions, yet still cannot find answer. how reference different class without initializing instance of it? how call "reloaddata" separate class reflect moc's data. moc seems saving have verified nsnotification. popover class: -(void)actionsave:(id)sender { maincontent *entitycontent = [nsentitydescription insertnewobjectforentityforname:@"maincontent" inmanagedobjectcontext:self.mdoc.managedobjectcontext]; entitycontent.date = [nsdate date]; entitycontent.title = self.titlename.text; //main question: how call viewcontroller's function in separate class? [viewcontroller reloadtableview]; //??? //separate question: how dismiss popover inside of function? } viewcontroller class: -(void)setuptable { self.tableview = [[uitableview alloc] initwithframe:cgrectmake(gridv1, 140, column1_width, 768-170) style:uitableviewstyleplain]; [self.tableview setbackgr...

object - iOS, Unable to delegate outside of viewDidLoad -

i have appdelegate.h #import <uikit/uikit.h> @interface appdelegate : nsobject <uiapplicationdelegate> { uiwindow *window; nsstring *name; } @property (nonatomic, retain) nsstring *name; @end and .m file @synthesize name; - (bool)application:(uiapplication *)application didfinishlaunchingwithoptions:(nsdictionary *)launchoptions { name=@"john"; return yes; } now...i want name controller, if try call inside viewdidload methods, works.. - (void)viewdidload { appdelegate *test= (appdelegate *)[[uiapplication sharedapplication] delegate]; nslog(@"%@", test.name); } but if try same thing in initwithnibname didn't work... - (id)initwithnibname:(nsstring *)nibnameornil bundle:(nsbundle *)nibbundleornil { appdelegate *test= (appdelegate *)[[uiapplication sharedapplication] delegate]; nslog(@"%@", test.name); } anyone can me out? problem driving me crazy... if overrid...

joomla - Virtuemart lost category bypassing shop.browse -

i can't believe, no 1 got problem before. using joomla 1.5 , vm 1.1.9. i'd have personal menù (jquery) linking directly products (is portfolio/catalog). if don't follow shop.browse page, lose category id , can't go forward , backward other elements. tru a product can in multiple categories, must specify category_id want. once vm finds in query string, can navigate category in same way you're expecting. works shop_browse because vm includes first category_id finds product.

objective c - ViewController Delegate -

is possible access viewcontroller's methods appdelegate, possible inverse following code:? appdelegate *ad = (appdelegate *) [[uiapplication sharedapplication] delegate]; when try viewcontroller *vc = (viewcontroller *) [[uiapplication sharedapplication] delegate]; i error... thanks! viewcontroller *vc = (viewcontroller *)[uiapplication sharedapplication].keywindow.rootviewcontroller; or if delegate have properties yourappdelegate *ad = (yourappdelegate*)[uiapplication sharedapplication].delegate; viewcontroller *vc = ad.yourviewcontrollerproperty;

java - Writing messages to client socket using DataOutputStream to Server Socket only sent after closing the Client Socket why? -

i had socket-client programming in java . using dataoutputstream send messages server socket . writed messages on dataoutputstream not sent serversocket . think it's due not flushing after sent message . no use . if terminate class execution receive messages serversocket . my code : public class loggingclient { linkedblockingqueue<byte[]> messages = new linkedblockingqueue<byte[]>(); public static loggingclient clientobj; /* * waiting 2 seconds connecting centralized log server . if it's not reachable writing log's in local machine * log's collected on eclipse restart. */ public static final int socket_timeout = 2000; /** * server log server running. */ public static final string server = "bharathi"; /** * port log server running. */ public static final int port = 10000; /** * client socket used connect server . */ socket client = null; public static logger logger = logger.getlogger(loggingclient.class.getname()); /** * ...

Android sub activity -

iám new in android. my questions sub-activity. main activity child sub-activity 1 , 2. i have main activity 3 buttons these buttuns pass values child activity number 2 , in child 2 these values. when push button in child 2 return values child number 1 , put values in textviews. now problem when finish child 2 values return automaticaly main activity. this not want there solution this. were can place startactivityforresult . don't want place in main activity. thanks in advance. i add values extras intent use start child 1, did when passed values child 2.

.net - WebServiceSecurity Reference. What is it? -

Image
i inherited project includes reference "webservicesecurity". dll? .net assembly? and additionally, is located in system? here screen shot of relevant section of solution explorer vs. tia it ends not being .net assembly, part of third-party crm vendor (pivotal).

jquery - How to I append li's to a current ul using .load? -

i'm working on search amd have following line of code: $('#searchresults').add($('li:last').load(url + '&' + urlextra)); this adds 10 li tags content rather adding ul it's nesting last li loaded in list. try , clarify outcome: <ul> <li>already in list</li> <li>already in list</li> <li>already in list</li> <li>already in list</li> <li>new li load</li> <li>new li load</li> </ul> but i'm getting this: <ul> <li>already in list</li> <li>already in list</li> <li>already in list</li> <li>already in list <li>new li load</li> <li>new li load</li> </li> </ul> any pointers in right direction appreciated. kind regards rachel use jquery.get() instead : $.get(url + '&' + urlextra,function(data) { $('#sear...

logging - ffmpeg set report log filename -

i running ffmpeg.exe on command prompt. trying generate report file using -report option. how explicitly specify report name? looks can set [?] environment variable export ffreport=file=/home/someone/log/ffmpeg-$(date +%y%m%s).log this because, otherwise, have parse output filename command line parameters, means "ffmpeg running, has started logging things" kind of cat or mouse game, apparently. ref: https://ffmpeg.org/trac/ffmpeg/ticket/1823 , mailing list posts.

python - Modify tick label text -

Image
i want make modifications few selected tick labels in plot. for example, if do: label = axes.yaxis.get_major_ticks()[2].label label.set_fontsize(size) label.set_rotation('vertical') the font size , orientation of tick label changed. however, if try: label.set_text('foo') the tick label not modified. if do: print label.get_text() nothing printed. here's more strangeness. when tried this: pylab import * axes = figure().add_subplot(111) t = arange(0.0, 2.0, 0.01) s = sin(2*pi*t) axes.plot(t, s) ticklabel in axes.get_xticklabels(): print ticklabel.get_text() only empty strings printed, plot contains ticks labeled '0.0', '0.5', '1.0', '1.5', , '2.0'. caveat: unless ticklabels set string (as case in e.g. boxplot), not work version of matplotlib newer 1.1.0 . if you're working current github master, won't work. i'm not sure problem yet... may unintended change, or may not ...

objective c - adding custom BarButtonItem to top navigation bar -

Image
using interface builder in storyboard, put bar button item in top left corner of navigation toolbar toggles edit view of table view cells. have text "edit cells" my question is, how change use image? created own custom image edit cells on state , edit cells off state, when specify image in interface builder, image stretched in bar button item. need make bar button item programmatically code make use frame of image? how specify state? i feel there should way in interface builder tried programmatically: uiimage *image = [uiimage imagenamed:@"edit-off.png"]; uibutton *showeditbutton = [uibutton buttonwithtype:uibuttontypecustom]; showeditbutton.bounds = cgrectmake( 0, 0, image.size.width, image.size.height ); [showeditbutton setimage:image forstate:uicontrolstatenormal]; uibarbuttonitem *showeditbuttonitem = [[uibarbuttonitem alloc] initwithcustomview:showeditbutton]; now how add showeditbuttonitem top left of navigation bar? actual image: ic...

html - javascript to change form data not working -

i have following code when change drop down doesnt matter choose puts first part selected.... <script type="text/javascript"> function changevalue(){ var option=document.getelementbyid('block').value; if(option=="1"){ document.getelementbyid('a').value="18005551212"; document.getelementbyid('b').value="pw"; } else if(option=="2"){ document.getelementbyid('a').value="5551212"; document.getelementbyid('b').value="collector"; } if(option=="3"){ document.getelementbyid('a').value="3"; document.getelementbyid('b').value="3"; } else if(option=="4"){ document.getelementbyid('a').value="4"; document.getelementbyid('b').value="4"; } } </script> <form method="post...

python - Efficiently accumulating a collection of sparse scipy matrices -

i've got collection of o(n) nxn scipy.sparse.csr_matrix , , each sparse matrix has on order of n elements set. want add these matrices regular nxn numpy array. (n on order of 1000). arrangement of non-zero elements within matrices such resulting sum isn't sparse (virtually no 0 elements left in fact). at moment i'm doing reduce(lambda x,y: x+y,[m.toarray() m in my_sparse_matrices]) which works bit slow: of course sheer amount of pointless processing of zeros going on there absolutely horrific. is there better way ? there's nothing obvious me in docs . update: per user545424's suggestion, tried alternative scheme of summing sparse matrices, , summing sparse matrices onto dense matrix. code below shows approaches run in comparable time (python 2.6.6 on amd64 debian/squeeze on quad-core i7) import numpy np import numpy.random import scipy import scipy.sparse import time n=768 s=768 d=3 def mkrandomsparse(): m=np.zeros((s,s),dtype=np.float32)...

android - "Surface" tag errors in LogCat -

i have been getting set of specific errors when developing basic camera application. code identical on android website. the galaxy sii phone giving me error appears follows in logcat console: 06-28 16:28:40.098: e/surface(1650): surface::init token -2 identity 18 the number follows "identity" changes (42, 38, etc) error persists. i think may related following class, still unsure meaning: public class camerapreview extends surfaceview implements surfaceholder.callback what galaxy sii might cause error? testing on htc vivid , pantech burst. fear may leading larger problems. trying understand error may about. here source: package com.basicam.android; import android.app.activity; import android.content.context; import android.content.pm.activityinfo; import android.content.pm.packagemanager; import android.hardware.camera; import android.os.build; import android.os.bundle; import android.util.log; import android.view.surfaceholder; import android.view.surfac...

c++ - Why user-defined move-constructor disables the implicit copy-constructor? -

while i'm reading boost/shared_ptr.hpp, saw code: // generated copy constructor, destructor fine... #if defined( boost_has_rvalue_refs ) // ... except in c++0x, move disables implicit copy shared_ptr( shared_ptr const & r ): px( r.px ), pn( r.pn ) // never throws { } #endif what comment "generated copy constructor, destructor fine except in c++11, move disables implicit copy" mean here? shall write copy ctor ourselves prevent situation in c++11? i've upvoted ildjarn's answer because found both accurate , humorous. :-) i'm providing alternate answer because i'm assuming because of title of question op might want know why standard says so. background c++ has implicitly generated copy members because if didn't, would've been still-born in 1985 because so incompatible c. , in case wouldn't having conversation today because c++ wouldn't exist. that being said, implicitly generated copy members akin "deal...

html - Internet Explorer Can't Adjust Inline List Item Width? -

i have unordered list list items displaying inline. however, layout rather complicated, let me show fiddle: fullscreen: http://jsfiddle.net/spryno724/f5cfd/embedded/result/ code: http://jsfiddle.net/spryno724/f5cfd/ notice how unordered list items stretch height of tallest list item, using display: table-cell property (except first list item). allows first list item have vertical line extend entire height of unordered list, letter "a" vertically aligned top. this presentation works excellent in browsers, notable exception of internet explorer 8 [1] , of course. here screenshots, in case don't have ie8: excellent rendering in chrome: https://picasaweb.google.com/lh/photo/oi6rwht8is_0nkvqrb1o_hv2jjoobc4dmf1moksl3b4?feat=directlink ie8 rendering same page, ie developer tools highlighting erratic width of third list item: https://picasaweb.google.com/lh/photo/_n-wvfhygurpj6jtdk24kxv2jjoobc4dmf1moksl3b4?feat=directlink any ideas can keep same see in chrome...

internet explorer - Javascript Error in FireFox Not in IE and Chrome -

i use following function decimal validation.the textbox allow enter numbers , .(dot) symbol only.it working fine in ie , chrome.my problem event not defined error .how solve this?i have lot of textbox validation.so create decimal validation common like, //call function $('.decimalvalidate').live('keypress',function(){ var decimalid=$(this).attr("id"); var decimalval=$('#'+decimalid).val(); var decimalvalidate=applydecimalfilter(decimalval); if(decimalvalidate == false) return false; }); //function decimal validation.it allows 1 . symbol.everything works fine on ie , chrome function applydecimalfilter(id) { try { return newdecimalfilter(id, event); } catch (e) { alert(e.mes...

Cakephp: How to validate an array to make sure that it has at least five items or more -

hie guys need code. have form student selects subjects, marks , grades obtained. subjects , grades dropdown menu , in loop. want student enter @ least 5 subjects including english language. each subject referenced subject code. array of students details saved. can me this? my controller function follows public function add($app_id = null) { if($app_id != null){ if ($this->request->is('post')) { //saving data in variables $applicant_id = $this->data ['applicantolevelqualification']['applicants_detail_id']; $centre_number = $this->data['applicantolevelqualification']['centre_number']; $candidate_number = $this->data['applicantolevelqualification']['candidate_number']; $exam_body_code = $this->data['applicantolevelqualification']['exam_body_code']; $year_written = $this->data['applicantolev...

postgresql - JDBC Postgres stored function call returning setof 'myType' -

i'm trying protect database sql injection. have many stored functions return setof predefined data types. example: create type userloginuseridpasswordreturntype ( userid integer, -- user.id password text ); create or replace function "user_login_get_id_password"(usernamein text) returns setof userloginuseridpasswordreturntype $$ declare sql text; begin sql = 'select id, cryptpwd "user" username = ' || usernamein ||';'; return query execute sql; end; $$ language 'plpgsql'; i call these stored procedures java front-end. i've read, using callablestatement safer regards sql injection. have far: public arraylist<string> userlogingetidpassword(string username){ arraylist<string> result = new arraylist<string>(); try{ string commandtext = "{call user_login_get_id_password(?)}"; this.cstmt = this.myconnection.preparecall(commandtext); ...

jquery - Is it possible to wait until all javascript files are loaded before executing javascript code? -

we have several javascript files load @ bottom of master page. however, have situation need perform javascript before other scripts loaded. possible wait till javascript files loaded , execute javascript code? i thought $(document).ready() did this, turns out, doesn't. of course can move script files bottom top, wondering if it's possible want. you can use $(window).on('load', function() { // code here }); which wait until page loaded. $(document).ready() waits until dom loaded

apache - Is there a way to run PHP 5.3 next to PHP 5.4 -

is there way run php 5.3 next php 5.4? i'd run simultaneously under apache. i'd on windows 7 (using xampp) , on ubuntu 12.04. it's possible have multiple versions of php installed. iis it's easy swap 1 other, , should possible in apache well. don't know how 1 web-server support multiple instances simultaneously. hopefully these links of help: how setup multiple php versions on apache running multiple apache instances

ios - iCarousel multiple nibs -

i've been messing around icarousel (linky: https://github.com/nicklockwood/icarousel ) while , there's 1 thing can't head around. it's loading 2 or more nibs 1 carousel. current code load same nib items in carousel: - (uiview *)carousel:(icarousel *)carousel viewforitematindex:(nsuinteger)index reusingview:(uiview *)view { if (!view) { //load new item view instance nib //control events bound view controller in nib file view = [[[nsbundle mainbundle] loadnibnamed:@"itemview" owner:self options:nil] lastobject]; } return view; } it's standard code controlsdemo in icarousel. am right in saying simple if statement can applied code above populate carousel different nib each item? or have go down route of loading array of nib files @ start , reference them in method above? or there different way this? the issue incredibly simple, on complicating big time. here's code added above sample fix it: - (uiview *)caro...

json - function not executing in correct step by step order -

i've got 2 webclient methods executing 1 after another. problem is, first 1 executes finishes executing after second one. my main issue that, in order second method excecute, first method first needs complete because second method requires data first method execute successfully. { string name; string surname; string url1 =" //sample/1"; string url2 ="//sample/2"; //execution point! public void listbox_selectionchagned(object sender, selectionchangedeventargs e) { var sel = ((listbox)contextmenupopup.child).selecteditem; subname = convert.tostring(sel); try { webclient webclient = new webclient(); uri uri = new uri(url1); webclient.openreadcompleted += new openreadcompletedeventhandler(webclient_openreadcompleted1); webclient.openreadasync(uri); } catch (exception ex) { ...

c# - Command prompt do not show up -

possible duplicate: command prompt not opens when calling (.exe) console application web application c# i working console application in have not hidden command prompt. call application web application. when run web application in visual studio shows command prompt opened, when hosts web application on iis command prompt not show process running somewhere @ backend. can give idea why command prompt show when console application call iis your web application isn't running in context of interactive user - it's running in context of windows service, typically doesn't, shouldn't , can't interact desktop. (you can allow services interact desktop, don't think should , @ least iis...)

Best php practise display errors -

is there best practice display errors in during controller action executing on view? mean, how display errors when 'login not found in database' or 'input value has incorrect format', or 'field require value'? is there array errors or else? code looks like: if ($_server['request_method'] == 'post') { $sitename = isset($_post['sitename']) ? trim($_post['sitename']) : null; $siteurl = isset($_post['siteurl']) ? trim($_post['siteurl']) : null; if(isnulloremptystring($sitename) || isnulloremptystring($siteurl)) { exit('site name or site url not empty'); } elseif (!preg_match('/^http\:\/\/[a-za-z0-9\-\.]+\.[a-za-z]{2,3}(\/\s*)?$/', $siteurl)){ exit('site url has wrong format'); } $filters = array('sitename' => $sitename, 'siteurl' => $siteurl); if($sitesrepository->select($filters)) { exit('site exist')...

php - ajax request hidden fields -

i'm developing site (only fun , learn programming jquery) , i'd know what's wrong : $(window).unload(function(){ var myid = $('input#v1').attr('value'); // hidden var playauth = $('input#v2').attr('value'); // hidden var srvid = $('input#v3').attr('value'); // hidden var result = 'myid='+ myid +'&auth='+ playauth +'&srvid='+ srvid; $.ajax({ type: "get", data: result, url: "closing.php", complete: function(data) { alert(data.responsetext); } }); }); i'm trying update database table. when close window nothing happens. previous version of function : window.onunload = function () { var xhreq = new xmlhttprequest(); var n = document.getelementbyid("v1").innerhtml; var o = document.getelementbyid("v2").innerhtml; var p = document.getelementby...

php security for cookies and sessions -

regarding php security cookies , sessions, have done far prevention of attacks. have done incorrectly/unsafely? login.php if ($username==$dbusername&&$hashed_password==$dbpassword){ setcookie('username[0]',$username,time()+(60*60*24*365)); setcookie('username[1]',$userid,time()+(60*60*24*365)); setcookie('password',$hashed_password,time()+(60*60*24*365)); if($admin=='1') { setcookie('username[3]',$admin,time()+(60*60*24*365)); } $_session['logged-in']=1; logout.php $time = time()-(60*60*24*365); setcookie('username[0]', '',$time); setcookie('username[1]', '',$time); setcookie('username[2]', '',$time); setcookie('username[3]', '',$time); setcookie('password', '',$time); unset($_cookie['username']); unset($_session['logged-in']); i call session_regenerate_id() on everypage, correct stop session fixation/hijacking?...

c# - Convert stringbinary to ascii -

i'm started dev-ing app wp7 , i'm trying convert string of binary ascii using c#. but have no idea how can done. hope me out here. example : input string: 0110100001100101011011000110110001101111 output string: hello the simple solution, using substring , built in convert.tobyte this: string input = "0110100001100101011011000110110001101111"; int charcount = input.length / 8; var bytes = idx in enumerable.range(0, charcount) let str = input.substring(idx*8,8) select convert.tobyte(str,2); string result = encoding.ascii.getstring(bytes.toarray()); console.writeline(result); another solution, doing calculations yourself: i added in case wanted know how calculations should performed, rather method in framework you: string input = "0110100001100101011011000110110001101111"; var chars = input.select((ch,idx) => new { ch, idx}); var parts = x in chars group x x.idx / 8 g select g.se...

sql server - NHibernate incorrectly creating ManyToMany table - Cannot define PRIMARY KEY constraint on nullable column error -

i have started implementing iset 's instead of ilist 's in project better reflects collection's have. this has thrown odd error in creation of 1 table. error i'm getting is. cannot define primary key constraint on nullable column in table 'useraddressassignments'. i have many many relationship between users , addresses. public class user : baseentity { public virtual system.guid userguid { get; set; } public virtual string username { get; set; } public virtual company company { get; set; } public virtual iesi.collections.generic.iset<address> useraddressassignments { get; set; } } the sql generating lookup column causing issue , shown below. userid column being nullable causing problem. create table useraddressassignments ( useraddressassignmentid int not null, addressid int identity not null, userid int null, primary key (userid, addressid) ) the odd part here have identical relationship between company...

javascript - jquery function to search array values -

i have structure this: var var1 = { array1 : ['value1','value2', ...], array2 : ['value3','value4', ...] ... }; i need javascript function search values in structure, , if exists, function return name of array. function find(value, obj) { (var x in obj) { if ($.inarray(value, obj[x]) >= 0) { return (x); } } } var var1 = { array1: ['value1', 'value2'], array2: ['value3', 'value4'], array3: ['value5', 'value6'] }; var value = 'value3'; alert(find(value, var1));​ ​ live demo

Ruby gem dependencies on offline server -

i have server totally disconnected internet (for strange security reasons). how can make ruby dependencies various gems work in environment? might work bundler , how install bundler using gem without internet connection? you can download bundler .gem file rubygems , install on server with gem install /path/to/bundler.gem then can pack gems required application ./vendor/cache directory with bundle package if deploy app (along ./vendor/cache directory) server , run bundle install --local bundler won't go rubygems, instead install gems ./vendor/cache directory. see bundler-package docs more information.

javascript - adding percentage to calculated form -

hope here can help. need form javascript auto calculates totals. have been messing around form script downloaded (hats off paul mcfedries) totals working fine need calculate tax (at 10%) , add sub total. have basic form working here: http://www.onsiite.com/html/onsiite_calc.html i'm complete javascript beginner , don't have clue begin. can or show me way? use when u populate final value... there nothing special it... jus use simple javascript final update of value var total = round_decimals(order_total, 2); frm.total.value = total + ((10/100)*total);

Jquery plugin to rotate DIV in 3D -

do know jquery plugin can rotate div in 3d. have similar size divs 1 on top of other. can see them because 1 on top of other. want rotate them in z-axis people can see of them. i think jquery transit might you're looking for. it can rotate in 3d, , using rototex, rotatey , perspective, pretty awesome. did not see rotatez support, that's pretty normal rotate isn't it? anyway, think it's worth checking out.

jquery - change class name when dragged and dropped and vice versa - jqueryUI -

i'm using jqueryui drag/drop list items 1 list sortable list. there anyway can change class of dropped item 'sortedli' 'droppedli' when dropped all-colls-list sortable list coll-selected-list , vice versa? when drop it, retains original class name. $(function() { var lists = [{"listid":"#all-colls-list", "connectid":"#coll-selected-list", "drop":true}, {"listid":"#coll-selected-list", "connectid":"#all-colls-list", "drop":true}]; $.each(lists, function(i, list) { $(list.listid).sortable({ connectwith: list.connectid, droponempty: list.drop }); }); }); <ul id="all-colls-list" class="droptrue ui-sortable"> <li class="sortedli">ahsbah</li> <li class="sortedli">bachs</li> <li class="s...

javascript - Create a Regular expression using the gi flags from a variable -

var metin = "baris"; var icerikoku = "hello baris. surname baris. bye bye baris. how metin."; var n = icerikoku.replace(/metin/gi, "ziya"); $("#icerikoku").html(n); print: hello baris. surname baris. bye bye baris. how ziya. but, must be: hello ziya. surname ziya. bye bye ziya. how metin. you need use regexp constructor that: var n = icerikoku.replace(new regexp(metin, 'gi'), "ziya"); this allow pass variables regexp.

ASP.NET MVC: ActionMethodSelector / ActionFilter (Attribute) naming conventions -

what think best naming convensions actionmethodselector differentiate actionfilter (attributes). i need actionmethodselector same authorizeattribute-actionfilter does, how name actionmethodselectorattribue? (the implementation not issue) what think best naming convensions actionmethodselector differentiate actionfilter (attributes). the suffix: xxxactionmethodselector xxxattribute or xxxactionfilterattribute where xxx function classes supposed accomplish.

can we change the css styles of jquery widgets and plugins internally with in our page? -

can any1 tell me how change css style properties internally without changing custom.css file in jquery..so internal properties can effect webpage..like changing properties of widgets , jquery-ui(ex:buttons,datepickers etc)... you can override styles defined in jquery style sheets in own stylesheets. css stands cascading style sheets. cascading part means 1 style can override another. have place further down evaluation chain (or make more specific, or number of other ways). you create own style sheet. make sure comes after jquery-ui stylesheet in page, , redefine styles.

Encoding a PNG with JavaScript -

i have arbitrary pixel data want save png. how can encode png javascript accomplish this? the data series of 1's , 0's want use create qr code. it's qr code arbitrary data i'm not using dom, jquery , createelement's out. if understand correctly, use library generate qrcodes: http://www.onlineqrlab.com/js_doc.php haven't tried it, seems documented

hlsl - How can I check existence of texture in shader programming? -

g_meshtexture : texture file name sampler meshtexturesampler = sampler_state { texture = <g_meshtexture>; mipfilter = linear; minfilter = linear; magfilter = linear; }; : sampler i use " tex2d(meshtexturesampler, in.textureuv) " which condition in hlsl similar if(g_meshtexture == null) in c++? there's nothing built-in hlsl test this. you can add client-loaded parameter tell shader if texture valid or not, or create second alternative shader executes without texture read in cases texture isn't deined (and assigned client c++ prog)

entity framework 4.1 - EF: Reconnect to database if disconnected -

is there in ef 4.1 allows reconnect database should connection broken. if can ef remember wasn't yet committed , commit once reconnected? if not there way can program occurrence not lose data? when connection broken during saving changes exception. whole saving done in transaction not committed due exception , ef doesn't mark current changes set completed. can try save changes again - ef try open new connection , execute same transaction.

Displaying child categories indefinitely with PHP -

i don't know if possible current db schema, here goes. have main categories, these marked boolean value in db. there comma-delimited list of subcategories. for example: maincat1 subcat1 subcat2 subcat2-1 subcat3 so in maincat1's subcategory field there "subcat1" , in subcat1's subcategory field there "subcat2, subcat2-1" , forth. i hope makes sense! don't mind how show it, nested lists. db schema: id |maincat | subcats | ---+---------+--------------------------+ maincat1 | 1 |subcat1 | subcat1 | 0 |subcat2, subcat2-1 | subcat2 | 0 | | subcat2-1 | 0 |subcat3 | subcat3 | 0 | | you can create sublevels: maincat1 // sublevel = 0 subcat1 // sublevel = 1 subcat2 // sublevel = 2 subcat2-1 // sublevel = 2 subcat3 // sublevel = 3...

java - how to preserve image quality after adding it to a jasperreport(created in iReport)? -

i've been struggling since 72hours image issue.anytime add image ireport 4.6 image blur , blur image appears on pdf generated jasperreport after running it. after googling pointed dpi of image. i've tried increasing dpi of image seems same.i've tried save svg version of image online converter , went through trouble of adding .svg version of image. am wondering if there trick it? can shed light? looking @ timeline officially 1 day late on this. thanks reading , helping out add line jasperreports.properties. find makes sharper reports. net.sf.jasperreports.image.dpi=300

objective c - How to get commas in my number ie 24,532,664 using UILabel? -

how set display show commas: 24,532,664 opposed 24532664? using nsnumberformatter . listing 1 nsnumberformatter *numberformatter = [[nsnumberformatter alloc] init]; [numberformatter setnumberstyle:nsnumberformatterdecimalstyle]; nsnumber *mynumber = [nsnumber numberwithinteger:122344]; nsstring *formattednumberstring = [numberformatter stringfromnumber:mynumber]; [numberformatter release]; // if aren't using arc. nslog(@"formattednumberstring: %@", formattednumberstring); // output locale en_us: "formattednumberstring: formattednumberstring: 122,344"

box api - Box.net v2 API has a java client library -

i looking library make easier manage of box v2 api in java, found https://github.com/box/box-java-sdk but not sure if use v2 box.net api. knows library in java ? that library built third-party on v1 api. if there 1 in development v2, we'll post here.

c# - What does ClassName.ctor>b__11 stand for in dotTrace Profiler? -

while using dottrace profiler getting lots of calls namespacename.classname.ctor>b__11 (when used equatec profiler on application got similar results mysterious function being called namespacename.classname.<ctor>b__11 ). first assumed constructor of classname break point inside of constructor of classname hit once. assuming auto generated function , if how can find gets called? relation have constructor of classname if constructor gets called once? it's lambda declared in constructor. did subscribe event in constructor using => syntax, or else called frequently? when use lambda, c# compiler turns private method, , uses delegate method. (and other fancy tricks if you're doing variable capture.) looking @ other classes in reflector, looks c# compiler numbers each lambda when turns them methods, naming convention you've noticed, <methodname>b__<number> , numbering each 1 goes.

c++ - partially sorting in decending order -

we have partially sort array in descending order. i know std::partial_sort in ascending order. http://en.cppreference.com/w/cpp/algorithm/partial_sort . is other such function can or fast algorithm so. the second overload in reference linked takes comparer – pass in instance of std::greater<t> .

c# - Small issue with listbox.sort and string compareto-function -

i'm having trouble differences in way listbox sort elements , compareto-function. the thing is, using 2 listboxes, , trying make 2 lists of elements occurring in 1 of them. both listboxes sorted using sorted property. my program runs through listboxes, , compare elements 1 one, using compareto-function: if (listbox1.items[x].tostring().compareto(listbox2.items[y].tostring())) > 0 etc. now, works fine, except items containing apostrophe (') - in "donald's pizza": in sorted listbox, "donald's pizza" comes before "donald duck". apostrophe less space. using compareto-function, "donald's pizza" greater "donald duck" . "compareto" says, apostrophe greater space ! this messes system. if knew apostrophe causes problem, make workaround, i'm not secure if apply other characters too. as solution i´ll have make own sort-procedure listboxes, overlooking obvious? edit: answer. i ended maki...

Issue with mysql multiple left join and group by -

well got 3 tables: tb1: tb1_id pk tb1_name tb2: tb2_id pk tb1_id fk tb3: tb3_id pk tb2_id fk and got query: select a.tb1_nome ,b.tb2_id ,count(c.tb2_id) lins tb1 left join tb2 b on a.tb1_id=b.tb1_id left join tb3 c on b.tb2_id=c.tb2_id group b.tb2_id order a.tb1_id desc but doesn't returns rows of tb1. i got 3 tables need get rows of tb2 matches tb1 , show count of rows of tb3 matches tb2 i think need use inner join instead of left join . inner join selects rows has records on table joined. give try , have feed later :) select a.tb1_name, b.tb2_id, count(c.tb2_id) totalcount tb1 inner join tb2 b on a.tb1_id = b.tb1_id inner join tb3 c on b.tb2_id = c.tb2_id group a.tb1_name, b.tb2_id order a.tb2_id desc

javascript - How to go to login form(login.js) when click submit on the register form(register.js) in sencha touch 2 -

i'm trying sencha touch app user first needs register. after that, pop alert have registered , when user presses 'ok' button, register form (register.js) go login form (login.js). this register.js: ext.define('demo.view.register',{ extend:'ext.form.panel', xtype:'register', requires:[ 'ext.form.fieldset', 'ext.field.email', 'demo.view.login' ], config:{ title:'register', iconcls:'user', url:'doregister.php', items:[ { xtype:'fieldset', title:'registration!!!', items:[ { xtype:'textfield', name:'username', label:'name' }, { xtype:'passwordfield', name:'password', label:'password' ...

Python: split list of strings to a list of lists of strings by length with a nested comprehensions -

i've got list of strings , i'm trying make list of lists of strings string length. i.e. ['a', 'b', 'ab', 'abc'] becomes [['a', 'b'], ['ab'], ['abc']] i've accomplished so: lst = ['a', 'b', 'ab', 'abc'] lsts = [] num in set(len(i) in lst): lsts.append([w w in lst if len(w) == num]) i'm fine code, i'm trying wrap head around comprehensions. want use nested comprehensions same thing, can't figure out how. >>> [[w w in l if len(w) == num] num in set(len(i) in l)] [['a', 'b'], ['ab'], ['abc']] also, itertools little more efficient.

servlets - Set/Get Objects from HttpSessions (Java) -

i set object httpsession . object instance of class user . then, in class i'm trying this: user user = session.getattribute("userobject"); i read serializable can't understand how works. there direct , easier way this? imagine session simple, type-unsafe map . can put in it, , can take out, provided know type expect. so, if have put user object, use: user user = (user) session.getattribute("userobject"); if have put long (the userid) long id = (long) session.getattribute("userobject"); user user = getuserbyid(id);

displaying gstreamer with opencv -

i'm wondering if it's possible capture frame gstreamer , display opencv, or if there has trick equivalent of cvwaitkey in gstreamer (or other library) more appreciated! thanks in advance you can have appsink in pipeline buffers (eventually use tee ! queue ! appsink). use image in buffer opencv functions if like.

objective c - An AppDelegate's property is unexpectedly set to null -

first of all, appreciate helps. well, use 3 nsstring objects in common in 2 views. , these view segued embedded navigationcontroller, mean start programming singleview. in appdelegate.h, write @property (weak, nonatomic) nsstring *crnturl; @property (weak, nonatomic) nsstring *crnttitle; @property (weak, nonatomic) nsstring *crnthtml; for delegation. and in first view, have webview , write -(void)webviewdidfinishload:(uiwebview *)webview { appdelegate *appdelegate = [[uiapplication sharedapplication] delegate]; [uiapplication sharedapplication].networkactivityindicatorvisible = no; nsstring *url = [[nsstring alloc] initwithstring:[mywebview stringbyevaluatingjavascriptfromstring:@"document.url"]]; nsstring *title = [[nsstring alloc] initwithstring:[mywebview stringbyevaluatingjavascriptfromstring:@"document.title"]]; nsstring *html = [[nsstring alloc] initwithstring:[mywebview stringbyevaluatingjavascriptfr...

Foursquare Merchant API call to retrieve limit of number of active Campaigns -

is there possibility increase number of campaigns running merchant (currently limited 2)? if so, there api call retrieve actual limit? thanks! you're limited 2 active campaigns per venue . can create more, non-active campaigns if you'd like, there can't more 2 active specials on given venue.

jquery - How to add element on jCarouselLite at runtime? -

i having hard time achieve thing. want add element on ul on runtime, doesn't work on jcarousellite. when add li element, adds @ bottom not aligned flow. for mean, see code here hope help. jcarousellite doesn't appear support dynamic addition of elements. may want consider using jcarousel instead seem have support this. when add li being wrapped onto next line because jcarousellite has set explicit width on ul element. can stop li wrapping, adding width add new li item: $("#list").width(52 + $("#list").width()); however, doesn't solve problem because jcarousel object contains private member variable itemlength uses boundary checking, stops before can end of carousel , see new added item. you may able fudge removing + recreating carousel, if need functionality, feels should try , use plugin supports out of box.