Posts

Showing posts from April, 2015

c# - Invalid attempt to read - Is possible using Action? -

public void executeaction(mysqlcommand query, action<mysqldatareader> action) { _connection.open(); query.connection = _connection; using(var reader = query.executereader()) { while (reader.read()) { action(reader); } reader.close(); } _connection.close(); } is possible this? getting error "invalid attempt read when reader closed". this piece of code i'm using: private void updaterecords() { var query = string.format("select * {0}", _table); var cmd = new mysqlcommand(query); _db.executeaction(cmd, reader => { var rows = new list<object>(); (var = 0; < reader.fieldcount; i++) { if (reader.isdbnull(

java - Type mismatch error in method with generic return (Why do I have to do a cast to the generic type in this method, but not in similar ones?) -

i getting following error method in need generic return type: description resource path location type type mismatch: cannot convert pagetypeone p securedpage.java i can rid of error casting object generic type parameter, don't understand why required in particular method, not in other similar methods have written elsewhere in other classes. the basic structure of project this: a base class page unsecured web pages base class securedpage secured web pages i had similar question earlier today solved stack overflow community: bound mismatch error , java generic method . i having problem similar method. the base page class w/ helper method builds pages this: public abstract class page<t extends page<t>> extends slowloadablecomponent<t> { protected static final <t extends page<t>> t constructpage(webdriver driver, int timeoutinseconds, java.lang.class<t> pageclass) { page<t> p = null;

html - Swig template and Node.js -

i have problem swig template , node.js. my code: path nodejs_swig.js file: /node nodejs_swig.js: // __dirname /node var http = require('http'), swig = require(__dirname + '/node_modules/swig'); swig.init({ root: '/web/public/', allowerrors: true }); console.log(swig); http.createserver(function (req, res) { var tmpl = swig.compilefile('page.html'), renderedhtml = tmpl.render({ people: [ { name: 'paul', age: 28 }, { name: 'jane', age: 26 }, { name: 'jimmy', age: 45 } ], title: 'basic example' }); res.writehead(200, { 'content-type': 'text/html' }); res.end(renderedhtml); }).listen(1337); console.log('application started on http://localhost:1337/'); html file here: /web/public page.html file: <!doctype html> <html> <head> <meta charset=&q

ruby - string in ddmmyyyy format to to date -

i have folder contains bunch of folders naming convention of mmddyyyy (for example 04102013 , 04092013 , etc.). have text file contains these paths , have programed in ruby array strips out path left date (however believe stored sting). what need take dates in array , add amount of days them. amount of days static , same value needs applied across board in array. on 8th line getting invalid date ( argumenterror ). end result needs array +7 days every item in array. right can't values date format. require 'date' myarray = io.readlines "/path/to/myfile.txt" myarray.each |s| s.gsub!('/path/to/my/dated/folders/', '') end print myarray myarray.map! {date.strptime("%m%d%y")} # myarray.map! {+(7)} print myarray try: myarray.map!{|s| date.strptime(s, '%m%d%y') + 7}

Highcharts - How to prevent long title with line break from overflowing subtitle -

i have highchart in 3 languages data filled database. of translated titles break , fill 2 lines. without precaution overflow subtitles: title: { text: 'the quick brown fox jumps on lazy dog , more', style: { width: '320px' } }, subtitle: { text: 'lorem ipsum dolor sit amet, consetetur sadipscing elitr' }, see sample:  http://jsfiddle.net/puhtu/ is there way dynamically move subtitles if main title breaks in 2 lines? it looks bug i've reported our devs https://github.com/highslide-software/highcharts.com/issues/1704

sql - As create json file with data in JavaScript, and send that file for JSONP other domain -

i need big doubt. question: can create json file (with data) js code? the reason need use jsonp, , wanna take data other domain (i.e. http://www.example.com/data/clients.json?callback=? ), data storage in db (websql) , need data written in json file (i.e. clients.json) please need because 3 days ago try this, don't find yet answer. p.s.: sorry english, not native language. edit sorry question confused. try again steps. i need write json file data or records db (websql). functions working (add record, update record, delete), need put data in json file because, i'll use next code data other domain. (function($) { var url = 'http://www.example.com/scripts/clients.json?callback=?'; $.ajax({ type: 'get', url: url, async: false, jsonpcallback: 'jsoncallback', contenttype: "application/json", datatype: 'jsonp', success: function(json) { console.dir(json.sites); }, error: f

media player - IOS MPMoviePlayerViewController Loading endlessly -

Image
i'm working on ios app (with storyoard). have viewcontroller: //movieviewcontroller.h #import <uikit/uikit.h> #import <mediaplayer/mediaplayer.h> @interface movieviewcontroller : uiviewcontroller { mpmovieplayerviewcontroller *movieplayer; } @property (strong, nonatomic) mpmovieplayerviewcontroller *movieplayer; -(void) playmovie; @end //movieviewcontroller.m - (void)viewdidload { [super viewdidload]; // additional setup after loading view. [self playmovie]; } -(void)playmovie { nsstring *videopath = [[nsbundle mainbundle] pathforresource:@"movie" oftype:@"mov"]; movieplayer = [[mpmovieplayerviewcontroller alloc] initwithcontenturl:[nsurl fileurlwithpath:videopath]]; [self presentmovieplayerviewcontrolleranimated:movieplayer]; } when run see viewcontroller "loading..." takes forever. you s

Boost multiarray vs OpenCV Mat -

what big difference between boost multidimensional array , opencv multidimensional array? i'm implementing clustering algorithm in c++, , need data stuctures store data points. should able handle different dimension data, such 1d data( gray scale image), 3d data(color images), , n-d data(after feature selection). which 1 should choose? seems opencv mat, need know dimension of data before hand. as perfanoff said, choose library confident in , going use more in code. aside, , given handling image data, opencv seems better choice. opencv mat containers can return type , functions can check if matrices have 1 channel, 3 channel or n-d data. can use element size functions find number of channels. as disclaimer, don't have experience boost multidimensional arrays.

entity framework - Breeze JS Adding a static Lookup dictionary to Metadata -

one of domain models has enum property create dropdown box for, efcontextprovide metadata function doesn't automatically import enum entity type me access it, created static dictionay of add metadata mapping, acting lookup table. how can add enum entity type, can call: breeze.entitymanager.createentity(myenum,...) right now, following error: error: unable locate 'type' name: myenum any suggestion? update: (i added enumtype info of metadata function call) "enumtype":{"name":"plugins","isflags":"false","underlyingtype":"int32","member":["name":"custom","value":"0"},{"name":"pluginoftypea","value":"1"},{"name":"pluginoftypeb","value":"2"}]} thanks @jay response, set in right direction. here can dealing enum: i created lookup list on server can separat

python - How do i call different classes within in a class? -

so made 2 classes, 1 making rectangle , 1 makes star, both being rectangle() , star() there class taking in specific amount of parameters. problem have class called flag() takes in textfile contain specific parameters each class, rectangle has 5 parameters, , star has 4. need flag class read through textfile , read through each line of file, understand each line either rectangle or star, draw it. class flag(object): def __init__(self, f_obj): self.f_obj = f_obj line in self.f_obj: line.strip() if 5 == len(line): r = rectangle(line) print(r) elif 4 == len(line): s = star(line) print(s) def draw(self,turtle): r.draw(turtle) s.draw(turtle) are asking file reading? try this: parts = line.strip().split() if len(parts) == 4: # star if len(parts) == 5: # rectangle

c# - Converting LINQ Extension method to work with L2E -

i working on search page users able use wildcards * in search criteria. wildcard can placed @ beginning, or end of string. since there several fields need applied to, figured extension method best way. code came works, not iqueryable . public static class helper { public static ienumerable<string> myextmethod(this ienumerable<string> items, string searchstring) { var searchtype = -1; if(searchstring.indexof("*") == -1) //no wildcard { searchtype = 0; } else if(searchstring.indexof("*") == 0 && searchstring.lastindexof("*") == searchstring.length - 1)//start , end { searchtype = 1; } else if(searchstring.indexof("*") == 0)//ends { searchtype = 2; } else if(searchstring.lastindexof("*") == searchstring.length - 1) //starts { searchtype = 3; }

ios - Saving an EKCalendar -

once create ekcalendar, it's said should hold onto calendaridentifier retrieve calendar later. however, documentation notes identifier change if/when full calendar sync performed , "you should have plan" deal that. what preferred or "standard" method of handling problem? from documentation a full sync calendar lose identifier. should have plan dealing calendar identifier no longer fetch-able caching other properties. not sure if there "standard" way of handling it. keeping identifier of source 1 way of handling it. sourceidentifier not change once calendar created , calendar cannot moved different source.

c# - Azure UpdateDomain configurability -

basically question is: control have on azure update domains? can discover how many update domains role has? can define how many update domains role has? can define update domain of given instance? (assuming there more 1 instance) msdn says can setup number of update domains setting upgradedomaincount in service definition file, default value 5 , that's used if don't specify count. roleenvironment.currentroleinstance.updatedomain returns update domain index of current role. management portal shows update domain number each instance. can use getdeployments management api call return list of instances , upgrade domain number of each. you cannot explicitly assign instance domain - assignment done in round-robin fashion starting instance 0 , upwards.

javascript - What are the basics for creating animations in web apps? -

i looking how create simple animation in html5 app. want start off-page canvas (with top set 100% of window height), , animate middle of screen, above other canvases. i have tried google, search results mix of animating divs , animation within canvas, , nothing have attempted seem work. example, jquery animate() function, discussed here . i have tried dynamically create canvas , animate on screen, did not work. current code follows: html <div id="view-adduser" > <canvas id="view-canvas"></canvas> </div> css #view-adduser { left: 25%; top: 100%; width: 75%; height: 75%; } javascript (this called when button pressed) $("#view-adduser").animate({ top: 100 }, 3000, function() { alert("animation complete"); }); how can correctly animate? final result should up-direction of this moonbase animation . i'd recommend library tween.js . the kind of animation you'

java - How to remove leading zeros from numeric text? -

i using remove leading zeros input string. return a.replaceall("^0+",""); but above string removes string alphanumeric well. not want that. requirement is: only leading zeros of numeric numbers should removed e.g. 00002827393 -> 2827393 if have alpha numeric number leading zeros must not removed e.g. 000zz12340 -> 000zz12340 you can check if string composed of digits first : pattern p = pattern.compile("^\\d+$"); matcher m = p.matcher(a); if(m.matches()){ return a.replaceall("^0+", ""); } else { return a; } also : consider making pattern static, way created once you may want isolate part matcher in smaller function, "isonlydigit" example

knockout.js - SignalR & Knockout parent - child callback issue -

i have following javascript view models (need refactoring, i'm looking functioning first), , setup messagesviewmodel holds collection of messageviewmodels , messageviewmodel holds collection of feedbackviewmodels . when posting new message, works fine , hub calls , ui updated. issue when add feedback comment, feedback persists database, callback isn't invoked - see code: public bool addmessagefeedback(string txtfeedbackcomments, string hdnmessageid, int userid) { bool result = false; try { var message = new message { sduid = userid, messagetext = txtfeedbackcomments, messagedate = datetime.now.date, messagetime = convert.todatetime(datetime.now.timeofday.tostring()), poster = usermanager.getitem(userid), messagedateasstring = datetime.now.date.tostring(), messagetimeasstring

java - Error: Could not find or load main class -

i'm new java programming , doing project school. here's code i've written public static void main(string args[]) import javax.swing.*; import java.awt.event.*; public class sleepcounter extends jframe { private jpanel panel; private jlabel messagelabel; private jtextfield sleeptextfield; private jtextfield sleepanswerfield; private final int window_width = 310; private final int window_height = 100; public sleepcounter() { settitle("sleep counter"); setsize(window_width, window_height); setdefaultcloseoperation(jframe.exit_on_close); buildpanel(); add(panel); setvisible(true); } private void buildpanel() { dailylabel = new jlabel("enter sleep " + "in hours"); hourtextfield = new jtextfield(10); calcbutton = new jbutton("calculate"); calcbutton.addactionlistener(new calcbuttonlistener()); panel = new jpanel(); panel.add(dailylabel); panel.add(sleeptextfield);

python - Algorithm for knight's tour on a 6x6 array only works on index [0, 0] -

i must mention first time posting on site, forgive me if don't follow site's guidelines tee. my problem simple can't understand it. knight's tour algorithm recursively finds path knight. works on index [0,0], iterates through spaces of array perfectly... however, on index [0,0], program hangs seems eternity. here code: # knightstour.py # # created by: m. peele # section: 01 # # program implements brute-force solution knight's tour problem # using recursive backtracking algorithm. knight's tour chessboard # puzzle in objective find sequence of moves knight in # visits every square on board one. uses 6x6 array # chessboard each square identified row , column index, # range of both start @ 0. let upper-left square of board # row 0 , column 0 square. # # imports necessary modules. arrays import * # initializes chessboard 6x6 array. chessboard = array2d(6, 6) # gets input start position knight user. row = int(input("enter row: ")) col = in

javascript - JS/jQuery how to lock mouse pointer -

making webgl first person shooter, need pointer inside game's block. is there way set mouse pointer position or lock in other way? pure js or jquery or other framework? there lot of contradictory information this. saw solutions dated 2009-2011, none worked me in both ff/chrome. is there reliable solution yet?

Python - Inheritance -

i'm not understanding online documentation how make inheritance work. i have here: import maya.cmds cmds class riglegs(): def __init__(self, *args): self.riglegs() def riglegs(self): self.items["side"] = "left" self.lik = cmds.duplicate(self.ljoints["hip"], n = self.getname("hip_ik")) in self.lik: newname = i[0].replace("_jnt", "_ik") cmds.rename(i, newname) but it's complaining there no self.items - have inherit class far large post here. can me figure out how that? i've researched online , nothing makes sense. the other class in different file altogether. to inherit class do: class riglegs(base_class_name): an example: class base_class(): items = [1,2,3] class pie(base_class): def __init__(self): print (self.items) instance = pie() you can read more in python documentation with imports: file (ap

c# - XAML - Simple animation for simple custom control -

Image
i'm working on windows store app c# , ran can't imagine it's difficult, can't find out how it. on mainpage.xaml created user control: stackpanel horizontal orientation, image , textblock inside. this: <!-- language: lang-xml --> <stackpanel width="300" height="100" orientation="horizontal" margin="0,0,0,20" tapped="loremipsum_tapped"> <image source="/assets/pic.jpg" margin="20"/> <textblock fontfamily="segoe ui" fontsize="30" verticalalignment="center"> lorem ipsum </textblock> </stackpanel> which looks this: i use custom kind of button sub-page. thing is, there no animations . wanted have typical animations listitem s have in splitview: shrink when pressed, grow normal when either released or when pointer exits virtual borders of control. couldn't find animation declaration/definition associate

c# - Returning Empty Json Object -

i trying return json object in c#. new mvc controller , using json first time, return object, , empty. public class { private string name; public void set(string data) { name = data; } public string get() { return name; } } public jsonresult hello() { obj = new a(); obj.set("abc"); javascriptserializer js = new javascriptserializer(); string jsonvar = js.serialize(obj); return json(jsonvar, jsonrequestbehavior.allowget); } you assuming framework can deduce get , set set private variable name 's value.. doesn't. instead, make name public property, , should work: public class { public string name { get; set; } } obj = new a() { name = "abc" }; /* ...etc... */ think framework's point of view. how can determine get or set doing? accessing same variable? knows.. runtime after all. why methods can't serialized way you're assuming.

wordpress - Listing search results with tax_query and meta_query -

i can't understand why filter wrote doesn't working when use next or previous page!! example make choice minprice= 200 click on search , filter find post price > 200 when try see rest of post page show me same page. code!! foreach($_post $key => $value){ if($value != ''){ $item['taxonomy'] = htmlspecialchars($key); $item['terms'] = htmlspecialchars($value); $item['field'] = 'slug'; $list[] = $item; if ($key == "minprice") { $minprice = $key; if($value > 0) { $valminprice = $value; } } if ($key == "maxprice") { $maxprice = $key; if($value > 0) { $valmaxprice = $value; } } if ($key == "minmq") { $minmq = $key; if($value > 0) { $va

ruby - XML Namespace issue with Nokogiri -

i have following xml: <body> <hello xmlns='http://...'> <world>yes</world> </hello> </body> when load nokogiri xml document, , call document.at_css "world" , receive nil back. when remove namespace hello , works perfectly. know can call document.remove_namespaces! , why it not work namespace? because nokogiri requires register xml namespaces querying within (read more xml namespaces ). should still able query element if specify namespace when calling at_css . see exact usage, check out css method documentation . should end looking this: document.at_css "world", 'namespace_name' => 'namespace uri'

osx - Initialising custom control both programmatically and from NIB -

i writing custom ui control, , curious standard practices around initialisation (particularly dependance on control's delegate). controls, control relies on delegate provide important information how render itself. when control used within nib, initwithcoder: , awakefromnib methods correctly called , delegate nicely set through iboutlet . awakefromnib calls secondary method called setupcontrol interacts delegate set control. life's good! however, when create control manually using initwithframe: , awakefromnib never called. curious how other developers deal supporting both ib , programmatic control creation. can see couple of techniques supporting programmatic case: force developer call initwithframe: , followed setdelegate: , followed setupcontrol . not onerous, expose internal workings of control (ie. have know setupcontrol ) modify initwithframe: method take delegate well. encapsulate inner workings bit more, however, not sure particularly commonly u

ruby on rails - heroku mailer with google apps telling me to sign in via web browser -

i setup google apps , heroku send mail. sent first mail within app , great. then, changed email on google apps account (from matt@website.com team@website.com)...made sure change in heroku config settings...restarted...but gives me error: net::smtpauthenticationerror (535-5.7.1 please log in web browser , try again. learn more @ i tried logging in via web browser , fine. keep getting same error when try send mail now. this should help: http://www.rocketideas.com/2012/05/gmail-error-password-not-accepted-from-server-solved/ i've tested , works me.

ios - Facebook graph API post multiple Photos to album and feed -

i have ios app posting multiple photos facebook feed using graph api. i have accomplished posting graph path "me/photos". puts photos in default app album , shows on user feed. want. the problem if create second (or multiple) posts, merges second post , subsequent posts first post , shows @ top of feed. if make x posts, there 1 entry in feed , images posts posted album. whereas want able make multiple posts , have them show separate posts on feed. here's high level code 1 post: while (key = [k nextobject]) { item = [self.selecteditemsdict objectforkey:key]; url = [item objectforkey:kpicurlkey]; nsmutabledictionary *params = [nsmutabledictionary dictionarywithobjectsandkeys: url, @"url", nil]; [fbrequestconnection startforpostwithgraphpath:@"me/photos" graphobject:(fbgraphobject*)params completionhandler:^(fbrequestconnection *connection, id result, nserror *error) { if (!error)

Query MySQL using JSP and Servlet POST method -

i'm not sure if i'm trying "print" result correctly. i'm trying use jsp take in variable , pass servlet query database , display result. tested querying database in different java file , had no trouble that. advice appreciated! jsp file: <form method="post" action="helloservlet"/> enter name:<input name = "exname"/><br> <input type = "submit" /> </form> java file (servlet): protected void dopost(httpservletrequest request, httpservletresponse response) throws servletexception, ioexception { //response.setcontenttype("text/html; charset=iso-8859-1"); printwriter out = response.getwriter(); java.sql.connection con = null; java.sql.preparedstatement pst = null; resultset rs = null; string url = "jdbc:mysql://localhost:3306/masters"; string user = "christine"; string password = "p

android - Activity Start slowly -

recently met strange problem,i start activity service,but if follow steps : enter app press home key go launcher then trigger service start activity after above steps,the activity starts more normal way.because add log in activity's oncreate method. normal way same above,except pressing home key. please me solve it.thanks. you can run service , activity in different processes. moving logging service doesn't bind ui. use process attribute service in androidmanifest.xml here's snippit docs : the name of process service run. normally, components of application run in default process created application. has same name application package. element's process attribute can set different default components. component can override default own process attribute, allowing spread application across multiple processes.

c# - two page layouts into one view -

i advice on matter. have view page display number of users. 1 view display users in grid (gallery like) of images. second view display same users name in list layout. have toggle button on page switch between two. best way go it? having 2 separate view pages or have partial view of sort? update code after suggestion below <div data-bind="template: {name:'grid-template'}"></div> <div data-bind="template: {name:'list-template'}"></div> <script style="float:left" type="text/html" id ="grid-template"> <section " style="width:100%; float:left"> <section id="users" data-bind="foreach: users"> <div id="nameimage"> <figure id="content"> <img width="158" height="158" alt="gravatar" data-bind="attr:{src: gravatarurl}"/>

c++ - Access denied when repeatedly create and remove the same directory -

i had little test, , how did it: repeatedly create , remove 1 directory, d:\test, example. did 1000 times, , error acccessing denied time. my code wrote this: tchar szerror[max_path] = {0}; tchar lpszpath[max_path] = _t("d:\\test"); for(int = 0; != 1000; i++) { if (!createdirectory(lpszpath, null)) { formatmessage(format_message_from_system, null, getlasterror(), null, szerror, max_path, null); messagebox(null, szerror, _t("create directory error"), mb_ok); cout << << endl; return 0; } setfileattributes(lpszpath, file_attribute_normal); if (!removedirectory(lpszpath)) { formatmessage(format_message_from_system, null, getlasterror(), null, szerror, max_path, null); messagebox(null, szerror, _t("remove directory error"), mb_ok); cout << << endl; return 0; } } can please tell me why error happened , how can avoid error? if

visual c++ - greta compile error in VES2008 -

i compiled greta against ves2008, reports error c2332: 'class' : missing tag name error c3306: 'regex::detail::<unnamed-tag>': unnamed class template not allowed error c2143: syntax error : missing ';' before '__builtin_alignof' error c2059: syntax error : '__builtin_alignof' error c2143: syntax error : missing ';' before '{' error c2447: '{' : missing function header (old-style formal list?) relevant source code snippet: template< typename t > class alignof { struct helper { helper(); char m_c; t m_t; }; public: enum { value = sizeof(helper)-sizeof(t) < sizeof(t) ? sizeof(helper)-sizeof(t) : sizeof(t) }; }; after precompiled, it template< typename t > class __alignof { struct helper {

ruby on rails - Carrierwave/fog are uploading files to S3, but the app is still trying to use the local path to access images -

i know broad question, , i'm biting off little more can chew first stab @ rails app, here am. i tried add image upload/crop basic status app. working fine uploading images , cropping them carrierwave, started using fog upload s3, ran issues. the image, , it's different sizes, appear ending on s3 fine, app still trying access image "/assets/uploads/entry/image/65/large_img_0035.jpg" locally, shows broken image, on heroku breaks whole thing because actionview::template::error (uploads/entry/image/1/large_img_0035.jpg isn't precompiled the heroku error makes sense me because shouldn't there. i've combed through app don't know what's forcing this. i'll post code thinks work? in advance! clarification: just clarify, images uploading s3 fine, problem how app trying display image_url the app using local path in asset pipeline, not s3 path it's uploading to. i having same issue. in carrierwave initializer setting host

Use java classes available package in JSP? -

Image
i new in jsp development. have run simple .jsp files. noe have problem of using classes available in package. have app dir in webapp dir in app dir have .jsp files , package named mypack. mypack contains classes want use in .jsp file in app dir. error of 500 while want run .jsp file contains class of mypack package. example: example1.jsp <%@page contenttype="text/html"%> <%@page pageencoding="utf-8"%> <%@ page import="mypack.display" %> <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <% display cnt=new display(); string outpt=cnt.echovar("hi da"); out.println(outpt); %> counter.java package mypack; public class display { public string echovar(string var){ return var; } } is there way accomplish task? java files goes under src , packages. jsp files goes under webapp or w

datetime - MySQL display statistics grouped by time slot -

i have 1 table called reservation such fields: `id` int(11) not null auto_increment, `username` varchar(150) not null, `begin_time` datetime not null, `end_time` datetime not null, `node_id` int(11) not null, primary key (`id`) i wish show statistics reservations during given time period (say $from - $until, values coming php). user books 1 node each reservation. there many nodes can booked , use following query show reservation statistics date. select date(begin_time) `date`, count(id) reservations reservation begin_time > '" . $from . "' , end_time < '" . $until . "' group date" now want give statistics on time period during day more active. 24 hours of day divided in 48 thirty-minute slots. in table, begin_date , end_date values round numbers 2011-04-11 20:00:00 or 2011-04-11 14:30:00. reservations can have duration of 30 minutes, 60 minutes, etc until 4 hours maximum. i statistics in following format (more or less)

css - How to override setting in Zurb Foundation Framework. ie $topbar-bg .Sass -

i trying set different color default black top bar, , found there variable set make change way doing apparently not make difference. using visual studio, nuget package , installed compass deal sass. site.sass, imagine perfect place right after @imports, attempt set variable doing following $topbar-bg: rgb(94, 136, 203); but when run website, see nothing different. correct way of doing this? have suggestions? should go ahead , change on source (that not seem right)? thanks suggestions welcome. compass documentation suggests set configuration variables prior importing extensions: http://compass-style.org/help/tutorials/configurable-variables/

64bit - TWAIN/WIA implementation for JAVA -

i working on application(java applet) interacts scanner. understand need twain library or wia library make work in windows. not sure differences of two? trying use library: http://thorntonzone.com/manuals/compression/fax,%20ibm%20mmr/mmsc/mmsc/uk/co/mmscomputing/device/twain/index.html jar file link broken got here. http://rsbweb.nih.gov/ij/plugins/twain-scan.html and dlls here: http://sourceforge.net/projects/twain-dsm/?source=dlp but, not detect source. here error log: http://pastebin.com/cb9gl0ip i on 64bit machine. had success? twain specification long follow , haven't found resources on wia implementation. any help/pointers/resources appreciated. use same bit mode for twain device control in java, all components need in same mode. i.e. jre, twain dsm (source manager), , twain driver (scanner driver) all need 32-bit or 64-bit. no mixing. the default installation of 64-bit windows contains 32-bit mode of twain dsm. , you've downloaded 64-bi

Best way to save the large number of records in hibernate -

i have 5000 records saved. best way in database point of view, whether save individual records(save(record) 5000 times) or saveall(list of 5000 records) in hibernate ...? kind of scenarios come regularly suggest me best one.. use feature batch insertion in hibernate. batch insertion powerful feature of hibernate particularly useful when importing data other systems in batch. if not use batch feature of hibernate, application's performance may decrease dramatically @ time of insertion of many records. here simple comparison on normal save , batch insert. and official docs.

php - Notice: Undefined index: label -

i have annoying error: err (3): notice: undefined index: label in /var/www/html/www.mysite.com/prod/app/code/core/mage/core/model/layout.php on line 367 any idea? your array not contain item index 'label', php spits out error. for example: // works fine. $i = array(); $i['label'] = "my value"; echo $i['label']; but however, code doing, not work. $i = array(); $i['somerandomlabel'] = "my value"; echo $i['label'); // fail, 'label' in $i never set examine code , make sure set 'label' @ point in time.

showing or hiding div with id generated using php and javascript -

i trying hide or show div based on div id php function. not able make work, please me. javascript: <script> showorhide(id) { var elem=getelementbyid(id); if(elem.style.visibility="hidden") elem.style.visibility="visible"; else elem.style.visibility="hidden"; } </script> php script: <?php function display_link($link_id,$upvote_array,$downvote_array,$divid) { ?> <a href="javascript:showorhide(<?php echo $divid; ?>)">more links</a> <div id="<?php echo $divid ?>" style="visibility:hidden;"> </div> <?php } ?> here's cleaned-up version of function. function showorhide(id) { var elem = document.getelementbyid(id); elem.style.visibility = (elem.style.visibility === 'hidden')? 'visible' : 'hidden'; }

mysql - Trigger to delete blank rows after INSERT -

i have inserted set of data database, want delete rows blank values. how can this? can done using triggers? example: table books contains author_name , title , price . after inserting data, want delete rows empty values in author_name column. here's i've written far: create trigger trigger1 after insert on books each row begin delete books author_name = '' end; this not working :( the issue you've got begin…end around statement not delimited ; . if put missing ; , however, need introduce meta delimiter entire definition, because, if don't that, inner ; break it. so, put ; @ end of delete statement , introduce delimiter before trigger definition: delimiter $$ create trigger trigger1 after insert on books each row begin delete books author_name = ''; end $$ alternatively, since body contains 1 statement, can remove begin…end : create trigger trigger1 after insert on books each row delete

Entity Framework Code First: Table Per Hierarchy, doesn't popluate custom discrimiator field -

i using table per hierarchy (tph) architecture work existing database schema. when attempt use custom discriminator field name dbentityvalidationexception : property: coursetype error: coursetype field required. models public abstract class course { public int id { get; set; } public string name { get; set; } public string coursetype { get; set; } } public class onlinecourse : course { public string url { get; set; } } public class onsitecourse : course { public string location { get; set; } } entity type configurations public class coursemap : entitytypeconfiguration<course> { public coursemap() { this.haskey(x => x.id); this.property(x => x.name).hasmaxlength(100).isrequired(); this.property(x => x.coursetype).hasmaxlength(128).isrequired(); } } public class onlinecoursemap : entitytypeconfiguration<onlinecourse> { public onlinecoursemap() { this.property(x => x.url).hasmaxlengt

javascript - Fetch data using $http for use with a custom service -

i'm trying create custom service pulls list of defined statuses server use in forms, far have: simpletaskapp.factory('storystatus', function($http) { var data = null; var promise = $http({ url: '/story-status/', method: 'get' }).success(function (resp) { data = resp; }); return {list: data }}; }); i understand won't work since $http asynchronous, have no desire run request more once. i'd treat static variable in effect, if ever storystatus.list called, should check whether empty , attempt populate itself. you should work with promises instead of against them. you don't need store data because can store promise . point of promises don't know when they'll done. don't know when data available. so service must return promise. that's okay: simpletaskapp.factory('storystatus', function($http) { var promise; function getdata() { if (