Posts

Showing posts from March, 2011

codeigniter - Email library not sending the correct link -

i have following code: $link = "www.domain.com/profile/forgot_password?user=".$username . "&key=".$key; $this->email->message('you requested reset password. follow link. <a href="'.$link.'"> ' . $link . "</a>. thank you,system support."); all trying here create friendly message user when wish reset password. supposed be: you requested reset password. click here so! on click here word should have link in href go reset page. not working above code seems escaping html showing below in message sent. should interpret html tags not send them. <a href='hdkjahskjdaskhdsjkahd'> djadjalksjdklasjdkajsd</a> ensure have set appropriate email preferences send email in html format, particularly mailtype preference: //you can add more email preferences here $config['mailtype'] = html; $this->email->initialize($config); $link = "www.domain.com/profile...

java - Hibernate: how to get a list of all the objects currently in the session -

i'm getting good, old , dreaded transientobjectexception , and, happens in such case, i'm having problems locating kind of subtle bug in code causing problem. my question is: there way obtain list of every object that's in current hibernate session? i'll have solved current problem time answer question, but, anyway, being able list session lot in next time happens. hibernate not expose internals public, won't find searching in public api. can find answer in implementation classes of hibernate interfaces: method (taken http://code.google.com/p/bo2/source/browse/trunk/bo2implhibernate/main/gr/interamerican/bo2/impl/open/hibernate/hibernatebo2utils.java ) tell if object exists in session: public static object getfromsession (serializable identifier, class<?> clazz, session s) { string entityname = clazz.getname(); if(identifier == null) { return null; } sessionimplementor sessionimpl = (session...

php - SQL querying for a record and then searching in the previous records for existence -

i have task in have search details of ids in csv file. have used 'in' clause can process 1000 ids @ time. problem after getting records example email associated id have search database if same email has made entry within given time period (one year) , declare id old , not new otherwise new. database large. i have used 'in' clause again this. have around 1,00,000 ids process. every 1000 ids requires 2 queries 1 getting email , second searching them. entire process taking me more 25 minutes. trying find better ways achieving same result.

javascript - tabcontainer with active tab when page load -

i using tabcontainer 3 tabs.using css tabcontainer,not ajax tabcontainer.then set automatic refresh of every 1 minute.now select tab2,but when page refresh automatically go tab1.so how maintain selected tab when page load or refresh,i want jquery.please me.i trying,tab click event got tab selected index,then value pass page load,but not working,is other way keep selected tab when page load.cookies try no use,then hidden field used,but don't know how hidden value cs page.my code <div id="nav" class="tabnav" style="width: 80%; height: auto; float: left; margin-left: 8.9%;" onclick="pageload()"> <ul class="tabnav" id="tab"> <li><a href="#nogo" title="address info" linkrel="#tab-1">address info</a> </li> <li><a href="#nogo" title="additional info" linkrel="#tab-2">additional info</a...

Using Nanoc with Bower and CoffeeScript -

i had use static datasource bower packages because nanoc ( filesystem_unified datasource) not allow multiple files same filename , different extension. but static datasource treats each item binary , not allow me apply filters , can not apply filter .coffee files in order compile .js any suggestions? it lets apply filters, not text filters, since static data source items "binary". nanoc 4 fixing whole mess of things this, need fix sooner :) the easiest fix drop copy of static data source in lib directory, change name/class unique, switch item type text, , use version instead.

c# - The main form is frozen after finishing copying file (with a progress indicator) using CopyFileEx? -

i have main form, form has button clicking on show copying window progressbar. use thread copying job, after finishing copying (the file copied ok , copying window closed) main form frozen (the controls on form seem not interactive with). task manager shows there not work (0%). there strange here. here code copying dialogue, please see: public partial class filecopier : form { [dllimport("kernel32")] private extern static int copyfileex(string source, string destination, copyprogressroutine copyprogress, int data, ref int cancel, int flags); private delegate int copyprogressroutine(long totalbytes, long bytescopied, long streamsize, long streamcopied, int streamnumber, int callbackreason, int source, int destination, int data); public filecopier() { initializecomponent(); } #region private members int cancel; int copyfinished = -1; #endregion #region public methods public void copy(strin...

ruby on rails - cucumber step: how do i get the input data from a different step? -

i have scenario: given on edit_stamp page , change date "14.5.2010" #<-- need data ... should see new times has been set #<-- down here i'm updating date of model, , in last step want verify model indeed updated date selected in first step. how can grab selected date top, in last step-definition? then(/^i should see new times has been set$/) s = stamp.first find_by_id("day_date#{s.id}").has_text?("14.5.2010") end this have now, don't want write date(14.5.2010) step-definition, want fetch previous step. try this: and (/^i change date "(.*?)"$/) |input_date| @new_date = input_date # , here whatever doing date end then(/^i should see new times has been set$/) s = stamp.first s.date_or_whatever_attribute_you_are_using.to_s.should == @new_date end those instance variables (@xx) persist alongside whole scenario.

ios - Core Plot - X-Axis moving position when plotting less points -

Image
i have strange problem x-axis moves down plot area when i'm plotting less points. graph has 2 lines plotted - 1 previous year , 1 current year values. original graph plotted 12 points both lines, regardless of month in , works fine. have changed app current year line plots points upto current month. e.g. in may plot 5 points. when x-axis moves down plot area detached y-axis , labels hidden - see screenshots : why reducing number of plot points change x-axis position? i'm using core plot 1.1 (static library) , xcode 4.6.2. the yrange of plot space changed point x-axis crosses y-axis close bottom edge of graph. have 2 options: ensure yrange puts crossing point (the "orthogonal coordinate") far enough edge labels , title remain visible. use axisconstraints position axis fixed distance edge of graph. let crossing point float along y-axis.

linux - C write() function sending 2 bytes hexadecimal -

i'm working tcp sockets. i'm sending data open socket using write function. write(socket_fd, "test", 4); that works. when way. #include <stdio.h> #include <stdlib.h> typedef unsigned char byte; typedef struct lanc { byte start; byte end; } lcode; int main(int argc, char *argv[]){ lcode command; command.start = 0x28; command.end = 0x06; short value = (command.start << 8) | command.end; write(socket_fd, value, sizeof(value); return 0; } when check size of value 2 bytes correct since combined 0x28 , 0x06. doing printf. printf("%x\n", value); output is: 2806 correct. printf("%d\n", sizeof(value); output is: 2 bytes correct. i'm getting error when i'm trying write hexadecimal open socket using write. doing wrong? you're committing 2 disgusting errors in 1 line (how compile?). you're passing integer (value) write() expects pointer (that won't compile, you're trying deceive ...

php - Variables in javascript, auto populate form -

i'm having problem receiving more 8 values javascript on script... should auto populate fields on dropdown option (select), work properly, can't more 8 values... where's problem? thanks! <script type="text/javascript"> // format of storedetails() // name,addr1,addr2,addr3,phone,fax,email,webpage, url var storedetails = [ ['please select','','','','','','','',''], ['please select','test1','test2','test3','test4','test5','test6','test7','test8'] // note: no comma ]; function setup(ta) { var str = "<select id='store' class='styled-select' onchange='storeinfo()'>"; (var i=0; i<storedetails.length; i++) { str += '<option value="'+storedetails[i].join('|')+'">'+sto...

iis - FineUploader Delete File error when on Production Server -

i'm using fineuploader upload , delete files. upload process works fine on production server. when tried delete file error 500. i've checked permission , looks good. note: locally upload/delete process work fine. issue occurs when push code production server. i'm using iis 7.5 , https url. does know cause error 500? a 500 doesn't mean server not support specific request method. 405. likely, code server-side tripping on request. it's hard specific problem without having access server. you'll need track request after hits server , see what, specifically, rejecting request 500. forcing delete file feature use delete method has been headache users. i've created enhancement request allow integrators, such yourself, change method used delete file requests post. see case #831 in github repo more details.

sorting - I don't understand stable algorithm definition -

in computer science, stable sorting algorithm preserves order of records equal keys. i don't understand why sorting algorithm stable , others none. basic sorting algorithm orders items of array of int. if create class or struct , use same algorithm considering swapping of whole object, , choosing order key, o age ecc, every algorithm can preserve order of records! i think missed definition. thanks lot. say have array following: a = [5, 4, 2a, 2b, 1] where a , b there denote first 2 ( 2a ) comes before second 2 ( 2b ). in stable sorting algorithm, result be: a_stable = [1, 2a, 2b, 4, 5] that is, relative order of elements hasn't changed - 2a came before 2b in original array, , remains way in sorted array. with non-stable algorithm, result be: a_nonstable = [1, 2b, 2a, 4, 5] this still correctly sorted, it's positions relative in original, unsorted array have changed.

php - Mysql error while inserting a paragraph -

i trying insert paragraph (which contains single quote in middle) database below. $rule="**mobile's** not allowed room...................soon"; mysql_query("insert table_name (rule) values('$rule')"); while executing query paragraph not inserting. , have directly tried in mysql using sql option. there shown error. any suggestions..? thanks use $rule = mysql_real_escape_string("**mobile's** not allowed room...................soon");

php - Create a facebook app with a page account -

is possible create facebook app page account instead of personal one? have created page of our company , want use create facebook app login our website. no, that's not possible. have 1 of page admins create app instead.

IOS: Stay on the first view controller before complete all controls (StoryBoard) -

Image
i connected first view controller second 1 using storyboard push segue , interface builder. the button named go on top/right. i have 3 textfield must filled before going second controller. i display alert when 1 of them empty. the problem code after displaying correct alertview goes secondcontroller instead of remaining on maincontroller. if ([segue.identifier isequaltostring:@"datadisplay"]) { if (![self verifyselection]) { return; } else { rowviewcontroller *rowviewcontroller = segue.destinationviewcontroller; // rowviewcontroller.delegate = self; } } 1) have segue wired directly go button sensor data view controller. don't want this, because anytime touches go , segue going happen ... no stopping it. so, first step remove segue have going go second view controller. 2) instead, wire segue file's owner icon below view controller second view controller. give name datadisplay . 3) in ibaction go ...

osx - How do you get current keyboard focus coordinates in Mac OS X's Accessibility API? -

i'm looking mac os x accessibility api coordinates of location of current keyboard (not mouse) focus. according page 2 of document found @ http://www.apple.com/accessibility/pdf/mac_os_x_tiger_vpat.pdf , it's doable: supported: mac os x exposes location of current keyboard , mouse focus assistive technologies via accessibility api , provides visual indication of focus on-screen. despite statement above, can't seem find api itself. i'm seasoned dev (coding since 1982), have never developed on mac os x; please gentle. osx appears have asymmetric accessibility api; can use nsaccessibilityprotocol make own app accessible, access accessibility of app, have use separate set of interfaces/objects, axuielement , friends. i found article on retreiving window has focus may of use here: seems key steps are: use axuielementcreatesystemwide create 'system wide' accessibility object ask object focused application calling axuielementcopya...

java - spring-hibernate transaction- changes not reflecting? -

i using spring , hibernate. have method annotated @transactional . method has 2 database calls. 1 call update data in table , other call retrieve data same table based on first call's updated data. problem first call's database change not reflected immediately. change reflected after flow comes out of method annotated @transactional . still tried calling session.flush() no use. please suggest me. @transactional public void method1(){ dao.updatem1(); dao.getdata(); } in knowledge after completion of transaction method changes reflect in database. but here calling before completion of method.so not getting updated result.

javascript - jquery-ui-map (google maps jquery plugin) style infowindow -

anyone had success styling infowindow in jquery google maps plugin ? i managed style map canvas, add mouseover/out functions on markers, have control on infowindow content not infowindow color, radius, background, etc. thanks go infobox. example here . css tips here . works great. remember pane: "floatpane" avoid having infobox under markers.

Java how to print two different values from one array -

i striving print 2 different values 1 array of stored models of computers. @ moment program print first computer index cannot how print 1 of particular model. fragment of main class computerlist list = new computerlist(); coputer item; string model; switch (option) { case 'm': model = console.askstring("enter model?: "); item = list.findmodel(model); if (item == null) system.out.println("cannot find " + model); else item.print("computer details..." + model); ... , computerlist class arraylist<laptop> laptops; private arraylist<string> models; public seriallist() { laptops = new arraylist<laptop>(); models = new arraylist<string>(); } public void add(computer ancomputer) { laptops.add(ancomputer); models.add(ancomputer.getmodel()); } public void print() { int nitems = computer.size(); (int i=0; i<nitems; i++) { system.out.println(computers.get(i)); } public co...

php - Access control and XHR requests -

i'm struggling access control implementation custom framework. rbac granularity not needed decided go kind of acl resources controller actions. here database structure: users: john mary greg user_groups: administrators accountants managers users_to_user_groups: john => administrators mary => accountants greg => managers resources (controller actions): users/edit invoices/add customers/delete resources_to_user_groups: users/edit => administrators invoices/add => accountants customers/delete => managers and here [pseudo]code. $user = new user; // logged in user ... $acl = new acl($user); $dispatcher = new dispatcher($acl); $dispatcher->dispatch('users', 'new'); class dispatcher { public function dispatch($controller, $action) { $permission = $controller . '/' . $action; if(!$this->acl->isallowed($permission)) { throw new accessdeniede...

Conditional options for Rails methods? -

i want add class form_for method, how that? <% if @plan.price == 0 %> <%= form_for @account, :html => { :class => 'new_account' } |f| %> <% else %> <%= form_for @account, :html => { :class => 'new_account payment-form' } |f| %> <% end %> seems there's gotta more concise way pull off. you this: <%= form_for @account, html: { class: "new_account #{(@plan.price == 0) ? '' : 'payment-form'}" } |f| %>

build - Using WebDeploy for ASP.NET website -

i contemplating idea of using webdeploy deploying asp.net websites. going through various articles of deploying asp.net web application , not website. when right-click on web application project, lot of options configure through webdeploy same not in case of website. i sure webdeploy can used deploy websites confused start. have use webdeploy command line api's through msbuild? it? can please let me know standard procedure? thanks, i wrote second article packaging websites using webdeploy. http://www.dotnetcatch.com/2016/12/15/package-asp-net-website-not-app-in-a-ci-build/ the quick summary can use msdeploy.exe package website within custom cs.proj file , integrate ci process.

vba - No existing macros availble when Excel is opened from Outlook macro -

i have macro in outlook, , have opening excel file saved on desktop. once file open, run macro have written in excel, none of excel macros available. macros available whenever open excel other way, , macros enabled when open excel through outlook vba. question is, how make these macros available when open excel via outlook macro? please reference code below. 'pre:none 'post:excel have been opened, , macro "createpowerpoint()" ' have been run on excel document sub gimba() dim xlapp object, xlwkb object 'open excel set xlapp = createobject("excel.application") xlapp.visible = true ' can false if not wont see reaction, ' byt make sure not fail 'do not show alerts xlapp.displayalerts = false 'open excel document set xlwkb = xlapp.workbooks.open(file path goes here) 'call macro on excel document call xlapp.run("createpowerpoint") end sub i a...

html - Cross-browser and JavaScript-less solution to submit button value issue -

given following 2 buttons: <button type="submit" name="mybutton" value="foo">do foo</button> <button type="submit" name="mybutton" value="bar">do bar</button> when clicking these buttons, browsers except ie7 , below post button's value ("foo" or "bar"), whereas ie7 , below instead post text ("do foo" or "do bar"). (this mvc project, issue not specific mvc.) this thread has lot of answers, none of them work when: the value , text different, and javascript disabled we want support flexible button text business can change these through our cms without code change. can't assume our text , values same. don't want depend on javascript solve this. however, can't think of way solve without either requiring javascript, or keeping value , text same. the usual hack key off name instead of value. <button type="submit...

linux - Why does this sed command to match number not work? -

my command this: echo "12 cats" | sed 's/[0-9]+/number/g' (i'm using sed in vanilla mac) i expect result be: number cats however, real result is: 12 cats does have ideas this? thanks! expanding + modifier works me: echo "12 cats" | sed 's/[0-9][0-9]*/number/g' also, -e switch make + modifier work, see choroba’s answer.

Use Django 1.5 StreamingHttpResponse to deliver reportlab pdf -

just wondered if have done pdf generation using reportlab , new streaminghttpresponse objects supported in django 1.5; https://docs.djangoproject.com/en/dev/ref/request-response/#streaminghttpresponse-objects i generating lots of pdfs using normal way described in django docs , using httpresponse file-like-object; https://docs.djangoproject.com/en/1.5/howto/outputting-pdf/ now wondering if new streaming object in django can used , if idea @ all? / jens

c++ - How do I write move constructor and assignment operator for a class which has a private object as property? -

i learned move constructors today. read this answer , , tried apply move constructor example in code. class unicodestring { public: enum endianness_type {little_endian = 0, big_endian = 1} endianness; bool replace_non_ascii_characters; char replace_non_ascii_characters_with; float vector_reserve_coefficient; unicodestring(unicodestring && other); // ... unicodestring & operator=(unicodestring other); // ... private: std::vector<unicodechar> ustring; // ... } unicodestring::unicodestring(unicodestring && other) { this->replace_non_ascii_characters = other.replace_non_ascii_characters; this->replace_non_ascii_characters_with = other.replace_non_ascii_characters_with; this->vector_reserve_coefficient = other.vector_reserve_coefficient; this->endianness = other.endianness; this->ustring = ???...

MySQL Query Optimization and joins -

i wondering whether query should run faster, , whether can make run faster query optimization. have 2 tables, tweets , ngrams contain 600,000 , 13.8 million rows respectively. interested in joining them ( inner join ) however, testing purposes, want 20 rows want order them measure: select tw.hash_tag, ng.ngram, count(*) cnt, tweets tw inner join ngrams ng on ng.tweet_id = tw.tweet_id group tw.hash_tag, ng.ngram order cnt desc limit 20 i not have experience larger datasets; how long should take? think should run faster is. if need more information, please let me know. also, try include can find such information not experienced. using mysql workbench run query. how can make query run faster? all appreciated!

javascript - Jquery knob - the circle is not showing up in android device (micromax canvas) -

i using jquery knob in 1 of project display circular input control. works fine in browsers supports html5 when viewed in micromax canvas a110 device circle of knob not showing ? problem browser or device ? in advace. atlast myself found out solution, had give data-angleoffset=1 input field knob binded.

iphone - ARC Semantic Issue: No Visible @Interface for 'UIViewController' declares the selector 'loginResult:' -

i have made lot of googling title above not solutions want. have project arc uses static library service calls. when click login button credentials passed library , gets response login view controller, problems occurs. not able pass data view controller send request. here code error occurs: - (void)loginresult:(logindata *)logdata { [viewctrl loginresult:logdata]; ->no visible @interface 'uiviewcontroller' declares selector 'loginresult:' } in .h (static library class) #import <uikit/uikit.h> @interface mobilewebmethods : nsobject { uiviewcontroller *viewctrl; } @property (nonatomic, retain) uiviewcontroller *viewctrl; - (void)loginresult:(logindata *)logdata; apologies didn't notice nsobject class, there logical error here in doing. you have created class mobilewebmethods, of type nsobject, not uiviewcontroller. need inside separate viewcontroller import file , create instance of it: mobilewebmethods *webmethods = [[mobilewebm...

java - Pause and Continue a Runnable object? -

i have implemented runnable in code, , have start pressing button in app, , stop pressing button. the problem occurs when press stop button. stops runnable, can't start again, when press start button. my code: public void onclick(final view v) { switch (v.getid()) { case r.id.button_timerstart: log.e("mainactivity", "clicked"); r = new runnable() { public void run() { if (mservice != null) { if(running) { str2 = ef.gettext().tostring(); str2 = str2.substring(0, 0) + "e" + str2.substring(0, str2.length()); mservice.sendalert(mdevice, str2); v.postdelayed(r, 6 * 1000); } } } }; v.post(r); break; case r.id.button_timerstop: log.e("mainactivity", "clicked"); if(running = ...

c# - Save multiple records from a database in a string -

i have table in db (record id same 1 student, increments 1 automatically different students): id | firstname | lastname | subject | grade | recordid | ----+-----------+----------+---------+-------+----------+ 1 | john | doe | 1 | | 1 | 1 | john | doe | 2 | b | 1 | 3 | max | smith | 1 | c | 2 | using c# want save data id = 1 string in format: name: john doe details: 1a; 2b name: max smith details: 1c what i've done far is: sqlcommand cmd = _connection.createcommand(); string res = null; cmd.commandtext = "select count(distinct recordid) table1"; int numb = convert.toint32(cmd.executescalar().tostring()); int currentrecord = 1; (int = 0; < numb; i++) { cmd.commandtext = "select firstname, lastname table1 recordid="+currentrecord+";"; res += "name: " + cmd.executescalar().tostring() + "\n details: "; cmd.commandtext = "select ...

php - file_get_contents grab remote page, content is not updated -

in localhost php file test.php, use php function file_get_contents grab forum index page. echo file_get_contents('http://www.xx.com/forum.php'); when forum data, sunch posting , member changes, refresh test.php, content hasn't changed, want know why? there number of possible reasons: you behind caching proxy server , receiving cached copy of page this can exist @ network or server level the target site detects such requests , provides cached versions performance or security reasons your browser has cached output of script. you need examine configuration, talk network administrator, or check own browser's cache find source of problem.

xsd - Error orchestrating web service deployed in azure with Apache ODE -

i trying orchestrate web service deployed in windows azure apache ode. testing services eclipse integrated web service explorer. azure ws works fine when test artifacts.wsdl throws following error: 14:41:38,777 info [deploymentpoller] deployment of artifact bpel_process successful: [{http://artifacts}process-132] 14:41:49,474 warn [simplescheduler] dispatching jobs more 5 minutes delay. either server down time or job load greater available capacity 14:41:57,594 warn [externalservice] fault response: faulttype=(unkown) <?xml version='1.0' encoding='utf-8'?><s:envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><s:body><s:fault><faultcode xmlns:a="http://schemas.microsoft.com/net/2005/12/windowscommunicationfoundation/dispatcher">a:internalservicefault</faultcode><faultstring xml:lang="en-us">the server unable process request due internal error. more information error, either turn o...

c++ - Is there a boost equivalent to this "safe_read" call -

i new boost threading (came win32 threading, has ruined me). so i'm trying make more "raii" way check working loop should still going. made simple function: template<typenamet> t safe_read(const t& t,boost::mutex& mutex) { boost::interprocess::scoped_lock lock(mutex); return t; } is there boost equivalent this, since seems i'd use time? acceptable call? the idea able safely without using weirder lock: while(!safe_read(this->is_killing_,this->is_killing_mutex_)) { dowork(); } boost::atomic<bool> added in boost v1.53.0, based on c++11 std::atomic s. example: #include <boost/atomic.hpp> boost::atomic<bool> is_killing (false); while (!is_killing) { } this eliminate explicit mutex , safe_access function code, providing synchronization required.

c++ - Is there a function that is to std::search what std::count is to std::find? -

if title sounds weird here explanation: if have range a , , want count how many times range b appeared in range a , there std:: function it? if no, there simple way (ofc can manually loop using std::search - i'm talking more elegant)? i think you'll need build own. here's comes mind implementation. template <typename iterator1, typename iterator2> size_t subsequence_count(iterator1 haystack_begin, iterator1 haystack_end, iterator2 needle_begin, iterator2 needle_end) { size_t count = 0; while (true) { haystack_begin = std::search(haystack_begin, haystack_end, needle_begin, needle_end); if (haystack_begin == haystack_end) return count; count++; haystack_begin++; } } template <typename iterator1, typename iterator2, typename binarypredicate> size_t subsequence_count(iterator1 haystack_begin, iterator1 haystack_end, iterator2 needle_begin, iterator2 needle_end, binarypredicate predicate) ...

machine learning - Random Forest: mismatch between %IncMSE and %NodePurity -

i have performed random forest analysis of 100,000 classification trees on rather small dataset (i.e. 28 obs. of 11 variables). i made plot of variable importance in resulting plots there substantial mismatch between %incmse , incnodepurity @ least 1 of important variables. variable in fact appears seventh importance in former (i.e. %incmse<0) third in latter. could enlighten me on how should interpreter mismatch? the variable in question correlated 1 other variable appears consistently in second place in both graphs. clue? the first graph shows if variable assigned values random permutation how mse increase. higher value, higher variable importance. on other hand, node purity measured gini index the difference between rss before , after split on variable. since concept of criteria of variable importance different in 2 cases, have different rankings different variables. there no fixed criterion select "best" measure of variable importance depends...

fonts - Which Unicode characters can be typed using the keyboard? -

Image
i had trouble figuring out title question, know sounds little stupid. i'm working on webfont generator. have on 1,000 svgs (and growing), and, use of fontforge scripts, plan on assigning each 1 of files character position. this red x rectangle next blue 1 down here mean "character position": the problem: each 1 of positions have code correspondent. print directly, don't. know fact control characters from table here don't print. there other characters don't print either, such soft-hyphen (u+00ad). 1 sadly discovered accident. i don't want allow end-users pick whatever characters positions want, because then, icons filling positions won't show in browser. looked on , on over unicode website see if have list or something, there's nothing helpful there. so there way can know sure character positions safe use icons, or ones aren't? i can guess @ intentions, i'll guess you're looking private use areas of unicode....

How do you optimize a MySQL query that joins on itself and does a "custom" group by? -

Image
i have following query starting become slow size of db table increases: select t.*, e.translatedvalue englishvalue ( select distinct propertykey translations ) grouper join translations t on t.translationid = ( select translationid translations gt gt.propertykey = grouper.propertykey , gt.locale = 'es' , gt.priority = 3 order gt.modifieddate desc limit 1 ) inner join translations e on t.englishtranslationid = e.translationid order t.reviewervalidated, propertykey first, selecting translations, joined me corresponding english value also. then, want limit results 1 per propertykey. group except need pick specific record 1 returned (instead of way group gives me first 1 finds). why have inner query returns 1 translationid. when run explain following info: is there way can return same set of results without having have mysql use slower derived table? thanks! ...

NoClassDefError showing in SolrJ calls inside GWT -

i'm making calls solr using solrj inside gwt project. have included solrj dependent classes in project including noclassdeffound error showing. don't understand whats missing. here's error. [warn] server class 'org.apache.solr.client.solrj.impl.httpsolrserver' not found in web app, found on system classpath [warn] adding classpath entry 'file:/c:/users/nick/documents/project/project/war/web-inf/lib/solr/solr-solrj-4.2.1.jar' web app classpath session additional info see: file:/c:/users/nick/documents/eclipse/eclipse/plugins/com.google.gwt.eclipse.sdkbundle_2.4.0.v201208080120-rel-r37/gwt-2.4.0/doc/helpinfo/webappclasspath.html [warn] server class 'org.apache.http.nohttpresponseexception' not found in web app, found on system classpath [warn] adding classpath entry 'file:/c:/users/nick/documents/eclipse/eclipse/plugins/com.google.gwt.eclipse.sdkbundle_2.4.0.v201208080120-rel-r37/gwt-2.4.0/gwt-dev.jar' web app classpath sessio...

matlab - Matching rows in CSV data sets -

in matlab, need someones expertise. have csv file following (extra spaces make readable): state, damage, blizzards, texas, 2, 2, alabama, 1, 0, alabama, 0, 1, texas, 5, 3, montana, 0, 8, arizona, 0, 0, arizona, 0, 1, texas, 8, 5, i have applied textread , strcmpi. here goal: need develop loop gets each individual state associated data state , plot on 1 plot, , repeats each state until finish. loop one: alabama has 2 data sets, need extracted , plotted. loop two: texas has 3 data sets need extracted , plotted. , process repeats until states have been applied. here code: filename = 'datacollect.csv' [state,damage,blizzards] = ... textread(filename,'%s %d... %d','delimiter',',','headerlines',1); index1 = strcmpi(state, 'texas'); damage = damage(index1) blizzards = blizzards(index1) plot(damage,blizzards) %for texas trying make loop, automatic, don't ...

How to write to and read data from Android's ApplicationContext? -

in app need central storage object accessed different parts of application (like singleton data holder). afaik clean way implement singletons in android use applicationcontext . how can put data (like instance of list<mypieceofinformation> ) in applicationcontext , get them out of it ? is correct way store more or less complex data in android use built-in sqlite database? you can use mysql , others well. depends if want save data in local or external. external, example, can use mysql , web server, communicate using json. for saving list, can use static.

python - Gunicorn throws OSError opening file when invoked by supervisord -

i have application presents form , generates pdf file pdflatex returned browser file attachment. works when invoke application server manually, when server process started supervisord, breaks... django throws oserror: [errno 2] no such file or directory request method: post request url: http://apps.xxxxxxxx.com/pdf/view/1/85/ django version: 1.4.5 exception type: oserror exception value: [errno 2] no such file or directory exception location: /usr/lib/python2.7/subprocess.py in _execute_child, line 1249 python executable: /home/ubuntu/envs/venv/bin/python python version: 2.7.3 the error thrown line : subprocess.call(shlex.split(proc_string), stdout=open(os.devnull, 'wb')) the full traceback: traceback: file "/home/ubuntu/envs/venv/local/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response 111. response = callback(request, *callback_args, **callback_kwargs) file "/home/ubuntu/current/project/appn...

qt - pyside show.ui > showGui.py error: No module named pkg-resources (Windows 7 64 bit) -

i trying convert .ui-file .py-file , not find module named above in title. information setup (perhaps here problem?): c:\entwicklung\python33 <== python v.3.3.0, 64 bit c:\entwicklung\python33... <== pyside v.1.1.2, 64 bit (idle python33 can find pyside correct) c:\entwicklung\qt\qt5.0.2 <== qt 5.0.2-mingw47_32-x86-offline, 32 bit (i used 32 bit qt because hoped, there qt-designer included... no.. designer, way?) with commandline cmd navigated folder c:\entwicklung\python33\scripts pyside-uic.exe placed, , put show.ui-file folder. i've ran "pyside-uic.exe show.ui -o showgui.py" , error shown in title occured! what did wrong? you need install distribute package. download , run distribute_setup.py [python-distribute.org/distribute_setup.py] : python.exe distribute_setup.py

Oracle versions supported by WSO2 Registry 4.5.3? -

what oracle versions supported wso2 registry 4.5.3 ? regards wso2 greg support oracle has not been tested again every version should work version. check out documentation on oracle here

java - String from database gives nullPointerException using isEmpty -

i have method returns string db. problem when im trying use isempty() or charat(0) nullpointerexception. here log cat: 05-09 15:56:47.002: e/androidruntime(6914): fatal exception: main 05-09 15:56:47.002: e/androidruntime(6914): java.lang.runtimeexception: unable instantiate application android.app.application: java.lang.nullpointerexception 05-09 15:56:47.002: e/androidruntime(6914): @ android.app.loadedapk.makeapplication(loadedapk.java:504) 05-09 15:56:47.002: e/androidruntime(6914): @ android.app.activitythread.handlebindapplication(activitythread.java:4364) 05-09 15:56:47.002: e/androidruntime(6914): @ android.app.activitythread.access$1300(activitythread.java:141) 05-09 15:56:47.002: e/androidruntime(6914): @ android.app.activitythread$h.handlemessage(activitythread.java:1294) public boolean setthecorrectparameterfields(){ string mine = ""; string spinnerexercise = workoutchoose.getselecteditem().tostring(); ...

java - How to customize the locale for javax validation -

i've 1 class in java i'm validating using javax.validation following code: validatorfactory validatorfactory = validation.builddefaultvalidatorfactory(); validator validator = validatorfactory.getvalidator(); set<constraintviolation<applicationrequest>> validationerrors = validator.validate(request); (constraintviolation<myobject> valerrors : validationerrors) { errors.add(valerrors.getpropertypath() + " " + valerrors.getmessage() + ". "); } now, if execute in spanish server, error messages shown in spanish. however, when execute in testing server (which installed in english enviroment), messages shown in english. how tell javax validation use locale spanish language. possible? when starting application can set default locale: how set default locale jvm? if using application server @ docs how - there configuration that, instance jboss need add -duser.language=en java_opts section of run.conf. ...

knockout.js - How to set valueUpdate binding globally in knockoutjs? -

i started using knockoutjs , couldn't find way bind valueupdate on afterkeydown input fields @ once. there way or have add valueupdate: afterkeydown every input fields? thanks in advance you can use binding provider plugin https://github.com/rniemeyer/knockout-classbindingprovider or can create custom binding http://jsfiddle.net/4jrkv/ ko.bindinghandlers.value2 = { init: function(element, valueaccessor, allbindingsaccessor, viewmodel, bindingcontext) { ko.applybindingstonode(element, { value: valueaccessor(), valueupdate: "afterkeydown" }); } };

c# - Operator '==' incompatible with operand types 'Guid' and 'Guid' using DynamicExpression.ParseLambda<T, bool> -

i'm using dynamic linq library , there source code , basic docu , nuget version pm> install-package dynamiclinq i'm trying construct clause involves guids i have tried string "id == @0" . parameter array object[] value ( guid xxxx ) var whereclausesb = buildlogicalkeywhereclause2(entity, logicalkey); //build string var parms = buildparamarray(entity, logicalkey); // object[] var wherelambda = ofsi.bos.core.dynamicexpression.parselambda<t, bool>(whereclausesb.tostring(),parms); //parse an exception thrown in dynamicexpression.parselambda operator '==' incompatible operand types 'guid' , 'guid' i have tried guid , string.(fail) i tried , "id = @0" (fail). string == string works, int32==int32 not guid == guid not any ideas? try using equals method instead of == operator in string: "id.equals(@0)"

ember.js - How to remove the views while using the properties from the context of outerview in emberjs -

i have scenerio in wanted render properties in child view properties of parent view on basis of properties. when properties evaluates false view should destroyed giving error as: cannot call unchain of undefined , errors related this. code: template <script type="text/x-handlebars"> <h2>welcome ember.js</h2> {{outlet}} </script> <script type="text/x-handlebars" data-template-name="address"> {{item.address.addressline1}}<br /> {{item.address.addressline2}}<br /> {{item.address.city}}, {{item.address.state}}<br /> </script> <script type="text/x-handlebars" data-template-name="index"> {{#if addressvisible}} <button {{action hideaddress}}> hide address </button> {{else}} <button {{action showaddress}}>show address</button> {{/if}} <ul> {{#each item in model}} <li> {{item.name}}<br /> {{#...

database - Multiple schemas works for clean and init, but not for migrate -

with command-line option, tried multiple-schemas thing: have gold schema metadata table, , series of user sandboxes slaved it. flyway -schemas=schema1,schema2 clean this worked ok. schemas wiped. flyway -schemas=schema1,schema2 init this worked ok, or @ least expected: created metadata table in first schema. flyway -schemas=schema1,schema2 migrate this did not work - migrated first schema, subsequent ignored. is broken in 2.1.1? seems basic point of having multiple schemas.

I need to extract data from multiple .txt files and move them to an Excel file, using Python -

the .txt file contains 68 lines. line 68 has 5 pieces of data need extract, have no idea how. have 20 .txt files, of need line 68 read. need of extracted data, however, dropped onto 1 excel file. here line 68 looks like: final graph has 1496 nodes , n50 of 53706, max 306216, total 5252643, using 384548/389191 reads i need numbers. use following open textfile: f = open('filepath.txt', 'r') line in f: #do operations each line in textfile repeat each text file want read here's link python library reading/writing to/from excel. want use xlwt, sounds like

Get cdc tables in visual studio 2012/2010 database project -

i trying create database project in visual studio 2012/2010 need cdc ( change data capture ) tables , because lot of views dependent on cdc tables. couldn't find way import cdc schema/tables :(. read in many blogs importing cdc not supported. there work around. please suggest generally wouldn't want cdc tables created database project, want them created using sys.sp_cdc_enable_table if allow database project create tables in normal manner cdc tables end existing change data capture wouldn't enabled. obviously can script calls sys.sp_cdc_enable_table in either pre or post scripts, far can tell neither place ideal. if put sys.sp_cdc_enable_table calls in pre script changes not original tables exist (on fresh deploy none of them exist), or these original tables change shape part of main deploy occurs after pre run. if put sys.sp_cdc_enable_table calls in post script, can't have views rely on cdc tables existing deployed part of main database project d...

Pass javascript variable to php -

i know had been disputed lot , short answer can't pass javascript variable php variable in same file. instead here want try: user inputs code, send php file post . there check if code matches code database , post again boolean there. in first file, tell user whether code correct or not. can achieved way? webdev newbie , trying learn. jquery: $.get( url, { userinput: value }, function( response ) { if( response.status ) alert( "matches found" ); else alert( "no matches" ); } javascript: function get( url ) { var xhr = new xmlhttprequest(); xhr.open("get", url, false ); xhr.send(); return xhr.responsetext; } var response = json.parse( get( url ) ); if( response.status ) alert( "matches found" ); else alert( "no matches" ); php: header( 'content-type: text/json' ); if( get_matches( $_get['userinput'] ) ) exit( '{ "status": true }' ); else exit( '{ "stat...

linux - IPv6 address by hostname -

is there command in linux ipv6 address of hostname? i tried nslookup , doesn't seem have option ipv6 address specified hostname or perhaps missed it. i have c program deals ipv6 , want check if getting correct results using different method obtain ipv6 address of host. with nslookup , query aaaa record type used ipv6 addresses: nslookup -query=aaaa $hostname

c# - Scripting.Dictionary Performance Suffers In Multiple Processes -

to illustrate problem, compile c# project reference microsoft scripting runtime, , code below. run single instance of resulting executable. on 12 core machine, read loop consistently takes 180ms. starting instance of executable slows down, approximately 100ms per additional executable. any ideas what's going on? , solutions other switching different dictionary implementation? using system; using system.collections.generic; using system.linq; using system.text; namespace consoleapplication4 { class program { static void main(string[] args) { system.diagnostics.stopwatch stp = new system.diagnostics.stopwatch(); var dict = (scripting.idictionary)(new scripting.dictionary()); stp.start(); (int = 1; < 1000; ++i) { object s = i.tostring(); dict.add(ref s, ref s); } console.writeline("after add {0}", stp.elapsedmilliseconds); ...

excel vba - Trying to save sheet 2 of a workbook on the desktop as CSV -

this function, when clicked on should ideally copy of worksheet 2 workbook , save sheet csv file. not working... , don't know how tell save file (i want save desktop). please? is there easier way can this? private sub commandbutton2_click() 'save csv' fname = "cambs_uploader.csv" sheet2.saveas fname, xlcsv end sub if it's simple saving desktop every time can put full path in string, rather file name. however, if want save selection directory tree, easiest way in excel use application.getsaveasfilename() method. documentation: http://msdn.microsoft.com/en-us/library/office/ff195734.aspx example: sub commandbutton2_click() dim fname string dim savesheet worksheet set savesheet = activeworkbook.sheets("sheet2") ' change sheet name savesheet.saveas application.getsaveasfilename("cambs_uploader.csv", ".csv", 1, "save file") set savesheet = nothing exit sub