Posts

Showing posts from July, 2012

sql server - Maximum row size of 8060 Error -

i stuck , can not figure out. have ideas? appreciate help. i have table in sql server 2008 following defintion: i can insert/delete/update without error. however, when run select statement filter out 1 single item, got following error: msg 511, level 16, state 1, line 1 cannot create row of size 8104 greater allowable maximum row size of 8060. if remove condition a15.member_parent_level_id4 in (91329) ran fine. if add 5 or 10 criterias ran fine, including 1 throwing error if add itself. [mstr_prod_hier_id] [int] not null, [mstr_prod_hier_desc] [varchar](50) null, [member_group_level_id1] [int] null, [member_group_level_desc1] [varchar](60) null, [memberkey_sort1] [int] null, [member_group_level_id2] [int] null, [member_group_level_desc2] [varchar](60) null, [memberkey_sort2] [int] null, [member_group_level_id3] [int] null, [member_group_level_desc3] [varchar](60) null, [memberkey_sort3] [int] null, [member_level_id4] [int] null, [member_level_desc4] [varchar](60) n

Unix syntax for the grep command for only an ending character -

for file james , when run command: cat james | grep ["."] i lines contain dot. how lines end dot? to find lines end . character: grep '\.$' james your cat command unnecessary ; grep able read file itself, , doesn't need cat job it. a . character special in regular expressions, matching 1 character; need escape \ match literal . character. and need enclose whole regular expression in single quotes because \ , $ characters special shell. in regular expression, $ matches end of line. (you're dealing characters treated specially shell, , others treated specially grep ; single quotes shell out of way can control grep sees.) as square brackets used in question, that's way escape . , it's unusual. in regular expression, [abc] matches single character that's of a , b , or c . [.] matches single literal . character, since . loses special meaning inside square brackets. double quotes used: ["."] unneces

facebook - How to tell when FB.init() completed? How to tell if the user is not connected when to app starts? -

i'm developing using facebook plugin phonegap/cordova. read maybe every single post or example plugin in stackoverflow , wherever, still have unresolved issure. when app starts, need if user logged in --> continue logged in main page. if user not logged in --> present screen "push connect button login" now, when app starts- call "fb.init" method. problem is, don't have callback use know when completes, , check login status. if subscribe auth.statuschange event before fb.init, event raised when user logged in. not enough, because need know when not logged in. if call "fb.getloginstatus" after fb.init, doesn't work since thing async , tries login status before "fb.init()" completed. in other words, can't tell when user not logged in when app starts. thank you, liran. ok, solved issue right timeout + little things. don't timeout, solution found "unknown" session status moment. here code:

Cascading/Inherited/Shared Rails configuration environments -

my staging , production environment rails configuration 99% same few things set differently (e.g. log level), , i'd eliminate duplication between 2 environment files. for example, have this: # config/environments/staging.rb myapp::application.configure config.cache_classes = true config.static_cache_control = "public, max-age=31536000" config.log_level = :debug # ... end # config/environments/production.rb myapp::application.configure config.cache_classes = true config.static_cache_control = "public, max-age=31536000" config.log_level = :info # ... end any recommendations on best way create shared configuration doesn't affect development environment? in projects, have 3 production-like environments have file called shared_production.rb under config/environments put common configuration myapp::application.configure config.cache_classes = true config.consider_all_requests_local = false #more shared configs end and

schema - Propel ORM - how do I specify tables to reverse engineer? -

i have database few dozen tables. app deals 1 of tables. i'd propel generate schema table. there way can specify table(s) in build.properties? a solution write own schema parser ignores tables. these tables exclude read config file or so. take @ mysqlschemaparser.php idea of how such parser works. extend such existing parser , override parse() method. when tables added, check them exclusion/inclusion , add them if meet subset criteria. how create custom propel tasks described in propel cookbook . instead of invoking propel-gen reverse invoke customized reverse engineering task. if done neatly, i'd find worth being added contribution propel project , you'd deserve fame that! :-)

vba - Excel Do While Find -

below code uses .find function in excel find location dodcell appears in sheet2 , add reecell column 18 in sheet2 sheet1. suppose loop based on how many times finds strsearch in rrange. but, running once , stops, think there mistake in "do while loop" can't seen fix it. any thoughts? so after fixing errors pointed out in code have revised sub. think have addressed loop issue, know program running once , freezing excel , need restart excel. think have created infinite loop don't know how fix ideas? sub addnumber() 'used add ree value dod projects dim ssht worksheet, dsht worksheet dim lastrow integer dim firstaddress string dim strsearch string dim reecell range, dodcell range, arange range, rrange range, aarange range dim hold1cell range, holdcell range, lastcell range set ssht = worksheets("sheet1") set dsht = worksheets("sheet2") set rrange = ssht.columns(18) set arange = ssht.colum

c# - GroupBox growing in a inherited form -

i´ve created base form. in base form, has groupbox component. when use form inherit, groupbox inherited growing more form. need ajust time when close , open design of forms inheriteds form base. thanks! using dock property of group box in pagecontrol i´ve resolved problem. reply.

html - Responsive design: complicated display table for showing photo and content in single row -

i've asked question before (sort of), , answer wasn't able me i'm trying do. after working on website more, , countless hours trying figure out solution (i'm not entirely sure can done), i'm trying figure out. it's centerpiece home page, it's kind of important works way want, visually. the problem: have 2 "modules" (displayed table cells) in container (displayed table). have created jsfiddle way show how model interact landscape image , portrait image. i'll go ahead , list requirements. the content container should have minimum width of 30% - 30px (10px padding , border of 20px on right) of container. if photo isn't big enough take 70% of container, content container width should grow , photo container width shrink. the height of content container (which news/blog post) should never taller or shorter image. if contents overflow, should scrollable. to prevent block being absolutely super tall, shouldn't have height on

android - Make Header View (not Section Header) of ListView Stick on Top -

i have listview headerview. i want 1 of views in headerview stick on top. i've seen lot of examples sticky section headers. i looked @ stickyscrollviewitems since i'm using listview , cannot use scrollview . is there library available or should override onscrolllistener of listview ? thanks. i have written load of code cant share contractoral reasons. follow approach outlined here , apply listview rather scroll view. main points are create wrapper view contains floating/sticky header , listview siblings use proxy method when adding headers issticky boolean - if sticky add fake blank header listview of same size , intended header view floating header wrapper (use relative layout here) set scroll listener of listview tracks top px position of dummy header view in list , setting top margin of floating header sits inside relative layout handle annoying edge cases / oem overscroll crap work in situtions (like this samsung) remember set initial

In R, how to select a year-specific datum from multiple year columns? -

i have dataset in each column, want select response datum based year of observation. version of dataset has first 4 columns; want create fifth column using r syntax. in fifth column, yr.response, datum corresponds correct year. i'm considering iteration if ifelse() statements (e.g. if year==2000, select column y2000 etc), can't work. should add actual dataset has thirty years , 19k rows, want able automate. year<-c(2000,2000,2001,2002) y2000<-c(65,43,42,74) y2001<-c(98,93,987,948) y2002<-c(875,983,776,736) yr.response<-c(65,43,987,736) x<-data.frame(cbind(year, y2000,y2001,y2002,yr.response)) my.df <- data.frame(year, y2000, y2001, y2002) rownames(my.df) <- as.character(rownames(my.df)) my.df$yr.respnose <- my.df[cbind(rownames(my.df), paste0("y", my.df$year))]

how do I generate random timestamps in Excel -

i need generate bunch of random times in excel 2013. the time needs between 7am 8:45am the number of rows varies typically between 30 60 in excel, 1 day = 1 7am = 7/24 845am = 8.75/24 enter formula: =7/24+rand()*(8.75/24-7/24) on home tab of ribbon, select 'time' dropdown in number area. this generate random time starting @ 7am , continuing through 845am.

javascript - How to get scrollheight of CkEditor -

i trying scrollheight of ckeditor in javascript returns 0 though works fine in case of simple textarea object. can please tell me how can scroll height of ckeditor content in javascript? thanks.. assuming use framed editor: ckeditor.instances.yourinstancename.editable().$.scrollheight; >> 827 while editable() returns <body> element within editor's <iframe> , $ let access native dom object.

forms - Rails links not connecting properly -

i rails beginner , have created 3 models/controllers/views using rails generate scaffold : subjects, have many topics topics, have many notes notes when go http://localhost:3000/subjects/1/topics , rails lists empty list of topics , when 'new topic' link clicked, taken http://localhost:3000/topics/new . should , how link 'new topic' take user http://localhost:3000/subjects/:id/topics/new instead of http://localhost:3000/topics/new , should new topic form submit http://localhost:3000/subjects/:id/topics/new instead of http://localhost:3000/topics ? views/topics/index: <h1>listing topics</h1> <table> <tr> <th>name</th> <th></th> <th></th> <th></th> </tr> <% @topics.each |topic| %> <tr> <td><%= topic.name %></td> <td><%= link_to 'show', topic %></td> <td><%= link_to 'edit&

javascript - how do you create muliple charts with the same options but with different data -

i draw multiple charts on 1 page using same options different json data each chart. little code possible, need omit code duplication. here example of first chart: $(function() { $.getjson('login.php', function(data) { var options= { chart : { renderto : 'container' }, rangeselector : { enabled:false }, series : data }; var chart = new highcharts.stockchart(options); }); }); how use above code create multiple charts using different getjson data? you create helper function: $(function() { var genoptions = function(data) { return { chart : { renderto : 'container' }, rangeselector : { enabled:false }, series : data }; }; $.getjson('login.php', function(data) { var options = genopti

c# - Should properties be emitted as methods using Reflection.Emit? -

i'm using types reflection.emit namespace generating dynamic assembly on fly (with dynamic types in it). both reflection , reflection.emit namespace provide apis dealing methods , properties of clr types. to knowledge, properties implemented methods c# compiler, , i'm wondering how should these treated when emitting them dynamically? should properties emitted using methodbuilder or using propertybuilder ? (i.e: calling definemethod or defineproperty ?) is there recommendation 1 approach on other? should properties emitted using methodbuilder or using propertybuilder ? both. if have read-write property x , in cil it's represented a method (usually called get_x ), set method (usually called set_x ) , called x points 2 methods. so, create property using reflection.emit, should: use methodbuilder create method (probably reading field). use methodbuilder create set method (probably writing same field). use propertybuilder create proper

javascript - Image preview overflow the browser height -

using image preview plugin, need preview automatically goes when thumbnail way bottom of screen. tried code, doesn't work well. if((e.pagex <= $(document).width()/2) && (e.pagey <= $(document).height()*0.75)) { $("#preview") .css("top",(e.pagey - xoffset) + "px") .css("left",(e.pagex + yoffset) + "px"); } else if((e.pagex > $(document).width()/2) && (e.pagey <= $(document).height()*0.75)) { $("#preview") .css("top",(e.pagey - xoffset) + "px") .css("right",($(document).width() - e.pagex + yoffset) + "px"); } else if((e.pagex <= $(document).width()/2) && (e.pagey > $(document).height()*0.75)) { .css("bottom",($(window).height() - e.pagey + xoffset) + "px") .css("left",(e.pagex + yoffset) + "px"); } else { $("#preview")

grabbing tomcat startup time -

i'd grab tomcat's "server startup in xxms" (in http://svn.apache.org/repos/asf/tomcat/tc6.0.x/trunk/java/org/apache/catalina/startup/catalina.java ) , log elsewhere. is there way either grab value or hook wrap start() function? don't need exact number, needs reasonably close. i'd prefer not grep catalina log if possible. have looked @ http://tomcat.apache.org/tomcat-6.0-doc/config/listeners.html ? i think can achieve goal adding own lifecyclelistener implementation underneath server or engine element in server.xml your listener implement timing mechanism think convenient, , log way like. hope helps!

c# - Isolated Storage & Saving Multiple Objects -

i wish know best way create saving , loading logic can save , load x items. example, in isolated storage can save composite/poco object doing this: var settings = isolatedstoragesettings.applicationsettings; settings.add("key", myobject); and load this: var settings = isolatedstoragesettings.applicationsettings; return settings["key"] myobject; but how load x amount of objects isolatedstorage? best create list<myobject> collection , save , whenever want save object load existing , .add(newobject) , save again? so this: list<myobject> myobjects = new list<myobject>(); myobjects.add(newobject); settings.add("myobjects", myobjects); and when loading: var myobjects = settings["myobjects"] list<myobject>; this require deleting , adding collection in settings.add requires unique key. best way? i'd rather use settings iso file. due msdn : isolatedstoragesettings provide convenient way store

Execute php from java program -

here code: string cmd = "bash -c \"php /users/phyrrus9/projects/java-web/test.php | say\""; system.out.println("executing: " + cmd); runtime rt = runtime.getruntime(); process pr = rt.exec(cmd); yet, never executed. can run command shell , works fine. here contents of test.php <?php echo hello; ?> runtime.exec() not shell or command interpreter, , not treating command way think is. single-string argument version of exec() simple brain-dead split on spaces, quotes , escaped quotes meaningless; never making bash in way think. always always use 1 of execs take string[] cmdarray your args in case are "bash" "-c" "\"php /users/phyrrus9/projects/java-web/test.php | say\"" that is, running bash -- first arg giving -c , second arg string. also see this answer more general question of how execute external program java .

c# - Handling DATETIME and DATE for Start and End dates -

i have table holds information when person on leave. 2 key fields are: **sql startdate date not null, enddate date null within .net code, these stored datetime types. so, if user has holiday 13th of august, until 13th of august, thats 1 days leave. dates should inclusive, start being @ 0:00 (midnight), , enddate being 23:59.59 basically. so, depending on if it's start, or end, they're treated differently. my system works whole days. i.e. date values. don't use time @ all, forced because of datetime type in .net. they're set midnight when reading database. the code focusing on, isn't working, this: public string availabletoday { { if (nonavailibility != null) { var = nonavailibility.firstordefault(t => datetime.utcnow <= t.enddate && datetime.utcnow >= t.startdate); if (i != null) return i.nonavailibilitytype ; return "";

android - ListView item onClick color stays the same for a second after I return to the activity, how to refresh it? -

so using following can change on click color of listview item. however, annoyed @ happening when return activity after click - color stays same when clicked on second , refreshes normal background. also, if hold listview item , slide finger away, listview item stays continuously clicked on , not return until tap on listview item. how can change background color of listview item on tap , not have stay same after switch same activity? here code. thanks! <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/background_repeatable" android:paddingbottom="@dimen/activity_vertical_margin" android:paddingleft="@dimen/activity_horizontal_margin" android:paddingright="@dimen/activity_horizontal_margin" androi

bash - how to get basename in -exec of find? -

i cannot following piece of script (which part of larger backup script) work correctly: backupdir=/backup/db01/physical/incremental # backups base directory fullbackupdir=$backupdir/full # full backups directory incrbackupdir=$backupdir/incr # incremental backups directory keep=5 # number of full backups (and incrementals) keep ... first_delete=`expr $keep + 1` # add 1 number of backups keep, first deleted file0=`ls -ltr $fullbackupdir | awk '{print $9}' | tail -$first_delete | head -1` # search first backup deleted ... find $fullbackupdir -maxdepth 1 -type d ! -newer $fullbackupdir/$file0 -execdir echo "removing: "$fullbackupdir/$(basename {}) \; -execdir bash -c 'rm -rf $fullbackupdir/$(basename {})' \; -execdir echo "removing: "$incrbackupdir/$(basename {}) \; -execdir bash -c 'rm -rf $incrbackupdir/$(basename {})' \; so find works correctly on own output this: /backups/db01/physical/incremental/full/2013-08-12_17-51-28 /backups/

javascript - Snake body segments not appending to snake correctly -

Image
i'm trying port working java snake game javascript people can play on website. demo game here ... press arrow keys , try run on sprites. for snake, wanted hang of cameras... implemented camera follows snake (snake in middle). when camera reaches edge of "world", snake allowed keep going until reaches world edge. normally, append new segment end of snake getting last element's x,y in array, set new segment once last segment has moved. move segments tail, store pre-moved segment x,y , set segments 1 before it. something like: function getprevcoords() { (i = 1; < players.length; i++) { prevx[i] = players[i-1].x; prevy[i] = players[i-1].y; } } function movetail() { //just need move head, , set rest of player containers last position of head.. (j = 1; j < players.length; j++) { players[j].x = prevx[j]; players[j].y = prevy[j]; } } my question: camera , putting objects in relation camera coordinates versus world coordinates throwi

sql - MySQL Innodb Full text Proximity Search Gives Horrible Performance -

i have mysql database simple table named item. item contains following fields , has 55,000 records: id (pk) description (innodb full text) date by design forced index way down 1 character words since descriptions contain names such item 1 2 42 spaces must kept intact. running full text search against table , here results following code: select id, description, date item date > date_sub(now(), interval 15 month) , description concat('%item 1 2 4%') , match (description) against ('+item +1 +2 +a +4' in boolean mode); this query returns in 1.2 seconds. however, once add following proximity search query return time goes through roof: select id, description, date item date > date_sub(now(), interval 15 month) , description ('%item%') , match (description) against ('+item +1 +2 +a +4' in boolean mode) , match (description) against ('"1 2 4" @30' in boolean mode); this query returns in 54 seconds! proximity search m

date - Ruby on Rails: How to get the current week and loop through it to display its days? -

Image
the above picture mean. think code should like: <% @days_from_this_week.each |day| %> <%= day.name %> <!--e.g. monday--> <% day.sessions |session| %> <% @session_categories.each |category| %> <!--categories means sesion1/2/3/4 category day's sessionx empty, have determine wheather session matches cateogry, , display in table --> <% if session.category == category %> <%= session.content %> <% end %> <% end %> <% end %> <% end %> but how current week ? , how name of day ? , navigate through calendar, pre_week , next_week needed. i found prev_week , next_week method, seems return day after week, not need. a possible solution here , don't know how use it. update: found workable solution, still looking better c

java - Recursive flood-filling overflows stack -

i'm working on algorithm take images , separate black , white chunks of pixels, unfortunately, seems overflow stack. here's suspected class: package me.dylan.eat; import java.awt.point; import java.awt.rectangle; import java.awt.image.bufferedimage; import java.util.arraylist; public class cell { public point location = new point(0, 0); public cell(int x, int y) { location.x = x; location.y = y; } public void recurseneighbors(arraylist<cell> universe, bufferedimage img) { if (!universe.contains(this)) { universe.add(this); arraylist<cell> neighbors = cellutil.assimilateneighbors(location, img, new rectangle(0,0,0,0)); //get neighbors of same color (cell c : neighbors) { if (!universe.contains(c)) { c.recurseneighbors(universe, img); } } } } } edit: image 640x480, big? exception th

OpenCV - Does there exist a function to do BOW (Bag-of-Words) in python? -

i have use opencv 2.4.6 bow(bag of words), code c++. want in python. i have searched opencv-python reference ( http://opencv.willowgarage.com/documentation/python/ ). didn't answer. http://answers.opencv.org/question/10870/python-wrapper-for-bow/ , know maybe there not opencv-python bow. can find it? since have trained vocabulary using c++, when photo want bow vector compare vocabulary. c++ uses bowimgdescriptorextractor() function it. there exist python code bowimgdescriptorextractor() ? i have write sample code this, (1)first of all, use python c++ api train bow vocabulary , save file. (2) write c++ code image's bow vectorization representation code : vector<double> features;//store feature bool readvocabulary(const string& filename, mat& vocabulary) { filestorage fs(filename, filestorage::read); if (fs.isopened()) { fs["vocabulary"] >> vocabulary; return true; } return false; } //imgpath image

Javascript regex and replacing consecutive character sets -

i'm having problem replacing unnecessary character sets string. following regex replaces first occurrence of character set "&=&" doesn't take care of leftovers. how 1 replace first , consecutive occurences of character set regex? var test = "var1=data1&var2=data2&=&=&=&=&var3=data3&=&=&var4=data4&var5=&var6=data6"; var result = ""; result = test.replace(/(\&\=\&)+/g, '&'); // result returns "var1=data1&var2=data2&=&=&var3=data3&=&var4=data4&var5=&var6=data6" you can use positive look-ahead instead. basically, &= , followed & : var = "var1=data1&var2=data2&=&=&=&=&var3=data3&=&=&var4=data4&var5=&var6=data6"; var b = a.replace(/\&=(?=\&)/g,''); // b = var1=data1&var2=data2&var3=data3&var4=data4&var5=&var6=data6 (which thin

windows - Enforce using HTTP proxy globally -

we have task here - redirect http traffic applications running on computers running win7 , win8 proxy. thing comes mind use wfp callout driver inspect outgoing packets , modify them accordingly. question - way enforce using http proxy globally applications running on windows computer? thanks.

asp.net - how i can create a page that works like stackoverflow -

i want know how did these pages work! : https://stackoverflow.com/questions/ask there no extension in end of address! is way call webmethods directly?! wrote page , think not right! public partial class _default : system.web.ui.page { protected void page_load(object sender, eventargs e) { string name= request.querystring["name"]; if (request.pathinfo == "/sayhi")response.write( sayhi(name)); } [webmethod] public static string sayhi(string name) { return "hi " + name; } //[webmethod] //public static string sayhi() //{ // return "hi "; //} } for asp.net , can use asp.net routing , allow separately configure urls should like. you can use both regular webforms apps , newer asp.net mvc .

How to apply condition in django admin form? -

i have models in django: from django.db import models class navigation(models.model): name = models.charfield(max_length=200) def __unicode__(self): return self.name class question(models.model): question = models.textfield() publication_date = models.datefield() is_active = models.booleanfield(default=1) is_premium = models.booleanfield(default=0) def __unicode__(self): return self.question class questiontype(models.model): question = models.onetoonefield(question) question_types = ( (1, 'multiple choice'), (2, 'text answer') ) type = models.integerfield(choices=question_types, verbose_name="select question type") class category(models.model): question = models.onetoonefield(question) navigation = models.onetoonefield(navigation) choices_options = ( (1, 'begineer'), (2, 'intermediate&

version control - Can i put many subfolder of git repo in other repo -

i have parent folder in repo of git . but have many subfolders inside parent repo want have separate repo. can in git add subfolders in .gitignore of parent git repo, ignored. and git init create new git repository in each subfolder need separate one.

How to align linear layouts in relative layout by programatically in android -

|--------------------|--> relative layout |horizontal linear 1 | |horizontal linear 2 | |horizontal linear 3 | |--------------------| in way. i want create 1 lay out new contact in android phone.when press + symbol add text box , 1 remove button dynamically.please answer this. or other way format... thank u friends :) i tried this. ll = new linearlayout(this); ll.setlayoutparams(new layoutparams(linearlayout.layoutparams.match_parent, linearlayout.layoutparams.wrap_content)); textview tv = new textview(this); edittext ed = new edittext(this); button bob = new button(this); tv.settext("nextval"); ed.sethint("number"); ed.setid(++i); ed.setinputtype(inputtype.type_class_number); bob.settext("rem"); bob.setid(i); ll.setorientation(linearlayout.horizontal); allet.add(ed); ll.addview(tv); ll.addview(ed); ll.addview(bob);

ios - non-public classes: NSCalendarDate, NSTask -

when upload app store, have problems non-public classes: nscalendardate, nstask but use nstimer make own stopwatch this source code self.timer = [nstimer scheduledtimerwithtimeinterval:1 target:self selector:@selector(stopwatch) userinfo:nil repeats:yes] ; my "pause" method pausestart = [nsdate datewithtimeintervalsincenow:0]; previousfiredate = [self.timer firedate]; [self.timer setfiredate:[nsdate distantfuture]]; my "resume" method float pausetime = -1*[pausestart timeintervalsincenow]; [self.timer setfiredate:[nsdate datewithtimeinterval:pausetime sincedate:previousfiredate]]; i have nstimer in appdelegate appdelegate* appdelegate = (appdelegate*)[[uiapplication sharedapplication] delegate]; appdelegate.delaytimer = [nstimer scheduledtimerwithtimeinter

javascript - i18next is not working -

i'm using phonegap , need i18n support application ended choosing i18next. below sample code,but i18next failing,can me in this? output i'm getting list of links name "nav.home","nav.page1","nav.page2". sample html5 code working in chrome , not in mozilla. //html code <!doctype html> <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <script src="http://code.jquery.com/jquery-1.9.1.js"></script> <script type="text/javascript" src="i18next-1.6.3.js" ></script> <script type="text/javascript" src="translation.en.json" ></script> <script type="text/javascript" > $(document).ready(function(){ i18n.init(function(t) { $(".nav").i18n(); var appname = t("app.name"); }); }); </script> </head> <b

html - Transition Background-Image -

i'm bit of newbie world of web programming, i'm trying develop webpage transition black , white version of photo normal color version of photo when page loads. after trying lot of different things, best make colored version appear instantly. tried play around jquery bit, reason, couldn't page load correctly. stayed on black , white version, rather transition normal version. the html follows: <!doctype html> <html> <head> <meta charset="utf-8"> <link rel="stylesheet" type="text/css" href="index.css"> <link href='http://fonts.googleapis.com/css?family=bad+script' rel='stylesheet' type='text/css'> <title>ucla wushu - home</title> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"> </script> <script> $(document).ready(function(){ $("html").animate({'background' : 'url(image

java - selecting (highlighting) the text of jdatechooser when focus gained -

im looking line of code, select (highlight) date-text-string in jdatechooser when gets focused. i read might have .selectall(); . cant access textfield of jdatechooser. also jdatechooser.selectonfocus(true); wont compile. netbeans says: "cannot find symbol". eventhough have imported: import com.toedter.calendar.jdatechooser; import com.toedter.calendar.demo.datechooserpanel; any ideas ? jdatechooser datechooser = new jdatechooser(new date()); datechooser.getdateeditor().getuicomponent().addfocuslistener(new focusadapter() { @override public void focusgained(focusevent evt) { ((jtextfielddateeditor)evt.getsource()).selectall(); } });

exchangewebservices - Java EWS API - reading non default mailbox -

i read non default mailbox on exchange server java ews api, wrong code. here excerpt relevant part: exchangeservice service = new exchangeservice(exchangeversion.exchange2007_sp1); exchangecredentials credentials = new webcredentials("<user>", "<pass>"); service.setcredentials(credentials); service.seturl(new uri("https://<url>/ews/exchange.asmx")); itemview iview = new itemview(3); mailbox mb = new mailbox(); mb.setaddress("<mailbox_address>"); folderid folderid = new folderid(wellknownfoldername.root, mb); finditemsresults<item> findresults = service.finditems(folderid, iview); and error message is: exception in thread "main" microsoft.exchange.webservices.data.ewshttpexception: connection not established @ microsoft.exchange.webservices.data.httpclientwebrequest.throwifconnisnull(unknown source) @ microsoft.exchange.webservices.data.httpclientwebrequest.getresponseheaders(unknown source

Create Nested Drag and Drop divs with jquery-ui -

i want create nested div jquery-ui drag , drop plugin. create not work child1 , child2 . fiddle link my code this: $(function () { $('.parent,.child1,.child2').draggable({ revert: true }); $('.dest').droppable({ accept: '.parent', drop: function (event, ui) { $('<div class="parent box"></div>').appendto(this); } }); $('.dest .parent').droppable({ accept: '.child1', drop: function (event, ui) { $('<div class="child1 box"></div>').appendto(this); } }); $('.dest .parent .child1').droppable({ accept: '.child2', drop: function (event, ui) { $('<div class="child2 box"></div>').appendto(this); } }); }); it doesn't work because on document ready, $('.dest .parent') , $('

ruby on rails - ActionMailer::Base.default_url_options -

i have problem using actionmailer (rails 3.0.19) in rake tasks. whenever want send email using rake task error: rake aborted! can no longer call actionmailer::base.default_url_options directly. need set config.action_mailer.default_url_options. if using actionmailer standalone, need include routing url_helpers directly. i have config.action_mailer.default_url_options set in environments/*.rb , not use actionmailer::base.default_url_options call in app. using rake task mailing doesn't work, using console works fine. moreover, when mail view contains link_to, crashes. without link_to, ok. help needed, have absolutely no idea do. thanks.

web services - Custom WS-Policy with Spring-WS -

i using spring-ws provide services , generate wsdl. want mention in generated wsdl soap headers required. header should like: <soapenv:header> <my:system>abc</my:system> </soapenv:header> being said need provide ws-policy, headers provided. how can tell spring create such policy?

I'm using jplayer to play shoutcast streams, I encountered strange issue where 1 stream works and other doesn't -

i've weirdest problem can play 1 shoutcast station , cannot other using jplayer. strange information of shoutcast server hints on similar configuration: http://198.27.79.224:9770/ http://108.61.73.119:8128/ i must note flash version of jplayer plays both, html version plays first one. jplayer js looks this <script type="text/javascript"> //<![cdata[ $(document).ready(function(){ new jplayerplaylist({ jplayer: "#jquery_jplayer_1", cssselectorancestor: "#jp_container_1" }, [ { title:"#1 stream", mp3:"http://108.61.73.119:8128/;stream/1" }, { title:"#2 stream", mp3:"http://108.61.73.118:8128/;stream/1" }, { title:"#3 stream", mp3:"http://108.61.73.117:8128/;stream/1" }, { title:"#4 stream", mp3:"http://198.27.79.224:9770/;stream/1

version control - TFS- shall I create a branch or a separate team project? -

i know if have project, , want create separate test , release projects/branches. shall create 1 team project , create branches test, dev , release? or can go separate team project each? one of our clients have been using separate team projects each. elaborate under circumstances shall opt team project instead of branch? pros , cons of each approach? to best of knowledge, think branches should have been used in scenario. thanks help. a new branch provide merging , build options can't done 1 project another. if create branches can share work items (tasks, bugs, ...) between of them, if create projects, developers need go each project find tasks, etc. usually it's better crate branches each environment. if go team projects make sure there reason it. take article, may helpful: http://nakedalm.com/when-should-i-use-areas-in-tfs-instead-of-team-projects-in-team-foundation-server-2010/

java - YAJSW tray icon not connecting -

i'm finalising release of play application, wrapped windows service using yet java service wrapper. have wrapper working prefer tray functionality. when using runconsole.bat file have following log message. yajsw properties wrapper.tray = true , multicast set (same error if manually specify port). this log file yajsw. issue seems due yajsw play application running correctly. thanks info|2924/0|play.core.server.nettyserver|13-08-13 10:51:37|play server process id 2924 info|2924/0|play.core.server.nettyserver|13-08-13 10:51:38|[info] play - application started (prod) info|2924/0|play.core.server.nettyserver|13-08-13 10:51:39|[info] play - listening http on /0:0:0:0:0:0:0:0:8080 warning|wrapper|play.core.server.nettyserver|13-08-13 10:51:39|[id: 0x4de7d7d8, /10.1.0.27:57385 :> /10.1.0.27:57366] disconnected warning|wrapper|play.core.server.nettyserver|13-08-13 10:51:39|[id: 0x3727fe37, /10.1.0.27:57405 => /10.1.0.27:57366] connected warning|wrapper|play.core.server.net

osx - Trouble with node-mongoskin on OS X 10.8 -

i had install module mongoskin ( sudo npm install mongoskin -g ) - success install. when try start index.js ( supervisor index.js ), there's error: module.js:340 throw err; ^ error: cannot find module 'mongoskin' @ function.module._resolvefilename (module.js:338:15) @ function.module._load (module.js:280:25) @ module.require (module.js:364:17) @ require (module.js:380:17) @ object. (/users/smithua/documents/uezo.pro/dnode-node/im.js:5:13) @ module._compile (module.js:456:26) @ object.module._extensions..js (module.js:474:10) @ module.load (module.js:356:32) @ function.module._load (module.js:312:12) @ module.require (module.js:364:17) debug: program node index.js exited code 8 ls -la /usr/local/lib/node_modules/ : 0 drwxr-xr-x 14 smithua staff 476 jul 30 18:53 dnode 0 drwxr-xr-x 7 smithua staff 238 jul 31 11:40 jshint 0 drwxr-xr-x 10 smithua staff 340 jul 31 11:00 jslint 0 drwxr-xr-x 17 smithua staff 578 aug 12 16:48 mongoskin 0 drwxr-xr-x 15 smi

excel - VBA - provider cannot be found with accdb format -

with below code following error when ran provider cannot found, below code copied , edited net, used .mdb files tried change .accdb because thats format need in. i'm trying make macro when ran copies cells database, adding it. i error run-time error "3706" provider cannot found may not installed - const target_db = "testdb.accdb" sub alteronerecord() dim cnn adodb.connection dim rst adodb.recordset dim fld adodb.field dim myconn dim lngrow long dim lngid string dim j long dim ssql string 'determine id of current record , define sql statement lngrow = activecell.row lngid = cells(lngrow, 1).value ssql = "select * tblpopulation popid = " & lngid set cnn = new adodb.connection myconn = thisworkbook.path & application.pathseparator & target_db cnn .provider = "provider=microsoft.ace.oledb.12.0;" .open myconn end set rst = new adodb.recordset rst.cu

node.js - NPM: module installation for a command line node tool? -

i have command line tool written in node. i'd to: have app able load dependencies , work. currently, after npm install -g <somemodule> module still not available. things didn't used work way. not have run npm link on every folder, have read in npm 1.0 docs . above docs talks $path, seems unrelated topic care node modules, not binaries. how can/should node command line tool handle dependencies command line tool can run directory? you can add following in main file of node.js app, assuming file name node-binary.js . #! /usr/bin/env node // app code console.log('test node binary'); and, in package.json file need specify entry point of app ... "preferglobal": "true", "bin": { "node-binary": "node-binary.js" }, ... and run command npm link in app directory. should able use node-binary command directory. hope helps... :)

c# - XAML - extra space under menu items in app bar -

Image
whenever added menu items in app bar, line or space coming under menu items. don't know how remove it. disturbs lot. herewith have added menu image. kindly, me rid of space. my xaml code: <phone:phoneapplicationpage.applicationbar> <shell:applicationbar mode="default" opacity="1.0" ismenuenabled="true" isvisible="true"> <shell:applicationbariconbutton iconuri="/assets/folder.png" text="about" click="more1"/> <shell:applicationbariconbutton iconuri="/assets/next.png" text="goto" click="gotopage"/> <shell:applicationbar.menuitems> <shell:applicationbarmenuitem text="rate app" click="rateapp"/> <shell:applicationbarmenuitem text="like us" click="like"/> </shell:applicationbar.menuitems> </shell:

openerp - Cases where different types of Reports used? -

openerp 7 reports done following methods: postgresql rml xsl/ xml i need know @ scenario these different types of openerp reports used. can provide scenarios example better understanding. thanks & regards, atchuthan xsl/xml old reporting tool, used in openerp v5 , v6. used produce xslt reports, specially complex reporting structure. it's deprecated now.