Posts

Showing posts from April, 2012

html - How to prevent navbar from being covered by content during scrolling? -

i building website html , css, , have created navbar, being overlapped content. how fix this? here css code navbar i've created. it's pretty simple , not sure how resolve problem! #navbar { display:block; position:fixed; border:2px solid #ff0e9e; background-color:#ff0e9e; height:35px; width:1300px; margin-top:-20px; margin-left:-5px; } .nav { float:right; font-size:20px; padding-top:5px; text-decoration:none; } try use: #navbar{ z-index:99999; }

Namespace local variables in clojure -

i have 1 loop, looping on multiple functions different namespaces. lets have (syntax not perfect im sure): namespace a: (defn evaluate [time] ...do calculations involve running variables pertain current namespace... ) core.clj : (loop (a.evaluate [(gettimeincrement)]) ) lets need keep running total value, running max , running min in evaluate. dont want return of these each time , pass them each loop iteration. feel better keep these "namespace local variables" , have separate core file. "clojure" way of going this? a.evaluate not valid clojure syntax. suspect [(gettimeincrement)] erroneous (this passes vector containing result of (gettimeincrement) time arg of a/evaluate . further, usage of loop won't compile because not have valid binding form, , not looping because lacks invocation of recur . on design level, idea namespace should keep local state misguided in clojure. namespaces each singleton class, function tracks state mix

Java instance abstract class, which implements interface -

i have interface 2 methods , abstract class, implement interface , override 1 method it. can instance abstract class, without overriding other method of interface? or can replace method method have signature? upd: answers, make mistakes in question. can use anonymus class extend abstract class, without overriding methods implements inrerface? how understand answer dragonk, no, , need create class, extends abstract class , override others methods? can instance abstract class you can never instantiate abstract class. you implement methods of interface still won't able instantiate abstract class.

ember.js - How can I load associated records the first time they are accessed in Ember? -

i have computed property, fetches associated record , tries print it. first time fetch record, it's null. subsequent accesses work correctly . set 'async: true', setting false doesn't change behavior. myapp.thingscontroller = ember.arraycontroller.extend({ myproperty: function() { var content = this.get('content'); return content.filter(function(thing) { console.log(thing.get('title')); // since direct attribute on model, prints fine. var associatedthing = thing.get('associatedthing'), otherthings = []; console.log(associatedthing.get('content')); // hasmany attribute on model, , null *first* time, fine on subsequent accesses. otherthings = associatedthing.get('content'); // doesn't work first time either. return thing.get('title') + otherthings[0].get('name'); // or similar. }); }.property('content.@each

objective c - iOS - How to get form data for an HTTP post -

when submitting http post using objective-c server, required form data entries include __viewstate , __eventvalidation , username, , password. user's username , password programmatically through ios application, hard-code __viewstate , __eventvalidation parameters looking @ entries through google chrome developer tools. problem once __viewstate , __eventvalidation parameters change, app defunct. is possible __viewstate , __eventvalidation parameters programmatically, possibly storing them in cookie, or can send post request without them? need integrate javascript function xcode project? it's related server-side logic because it's deal of client , server applications how use parameters, in in cases viewstate paramater given @ previous request. should not send first request. example: request1, authorization — sending username, password. (may) return viewstate. request2 — sending viewstate request1 , other parameters. (may) return new viewstate. re

c# - Webpage expires on clicking on back button -

i working on website on asp.net using c#. of pages displaying data in grid view , in crystal reports. every time click button crystal report page or other page going previous page displaying data in gridview webpage displays message "webpage has expired" in browsers. there way solve issue? useful. thanks, ekta could double check code's clearing cache & setting expiraton policy. 1. webconfig. 2. master page. 3. associated pages.

C Struct Order of Members -

i'm taking on piece of code..c programming in linux. did small change struct typedef struct { unsigned int a1; .. .. .. float f1; unsigned int a2; unsigned int a3; unsigned int offending; // shifted } test; i shifted unsigned int offending before float f1, this: typedef struct { unsigned int a1; .. .. .. unsigned int offending; float f1; unsigned int a2; unsigned int a3; } test; and code crashes... problem? is order of members of c struct important? what problem? depend on rest of code, , else did. no, order of members of struct not intrinsically important. made when other code depends on it. possible causes (not exhaustive): you didn't recompile , there external linkage on struct or aspect of it. by moving member changed alignment of other members and/or sizeof() struct, , didn't compensate that. there literal constant or macro somewhere size or offset depends on struct. there faulty code never failed bef

ruby - How to monitor garbage collection when running Cucumber? -

i trying verbose gc information ruby cucumber can jvm. not sure how proceed. have seen gc.collections , gc.dump not sure how use them. if 1 has faced same issue please inform me how gc dump or gc statistics or verbose gc cucumber tests. the easiest way watch ruby's gc work use gc::profiler . can use cucumber putting in features/support/gc.rb: before gc::profiler.enable gc.start end after puts gc::profiler.report end if want more detailed information, assuming you're using mri (c ruby), can garbage collection statistics gc.stat . can print information gc.stat after every cucumber scenario putting in features/support/gc.rb: after puts "gc: total #{gc.stat[:count]}, major #{gc.stat[:minor_gc_count]}, minor #{gc.stat[:minor_gc_count]}" end different versions of ruby have different garbage collection, gc.stat returns different information. the gc.stat rdoc doesn't document each hash key means. a blog post sam saffron documents gc.st

dependency injection - Spring 4 @Autowired Morphia -

how autowire instance of morphia can have injected instead of recreating every time across controllers? @controller public class teamcontroller { @autowired private mongotemplate mongotemplate; @autowired morphia morphia; … } i found this article getting error using code there. seems odd me inject such simple object controllers have extend abstractentityinterceptor in of them. spring version 4.0. you don't need special make work. following code configuration (i assuming using java config, if not corresponding xml if easy write): @bean public morphia morphia() { final morphia morphia = new morphia(); //add mappings //add converters //whatever else return mophia; } you able use @autowired morphia morphia inside spring beans, including of course teamcontroller . the tutorial following different because shows how inject morphia entity not spring bean.

c# - How to Use Reflection to Access Non-Public List and Its Non-Public Elements -

i need access list elements within array "message" strings, so: string msg0 = sender.synchelper.uploadsyncprogresslist[0].results.exception.message; string msg1 = sender.synchelper.uploadsyncprogresslist[1].results.exception.message; ... i given "sender" object (which of type "object"). rest (synchelper, uploadsyncprogresslist, results, exception , message) non-public. these, class types of non-public types (except "exception"). this image shows visual representation of problem. i have managed use reflection list variable "uploadsyncprogresslist" following code, stuck on how loop through list elements "messages" string: propertyinfo synchelperinfo = sender.gettype().getproperty("synchelper", system.reflection.bindingflags.public | system.reflection.bindingflags.nonpublic | system.reflection.bindingflags.instance); object synchelper = synchelperinfo.getvalue(sender, null); propertyinfo uploadprogresssy

knockout.js - Knockout js taking more RAM memory -

i using knockout js in 1 of projects. new knockout , struggling fix memory leaks in project. page taking 100mb ram on initial load , keep on increasing 17mb on every action user performs on screen. the main case feel memory leaks happening dom rendering case. in page elements added dom looping through observable array. each time new set data comes making array empty , reloading new data, cause dom elements removed , added again new data. can 1 tell how these old dom elements can disposed before removed wont take ram memory. knockout foreach binding: <tbody data-bind="foreach: supplies"> <tr> <td> <span data-bind="text:supplyname"></span> </td> <td> <select data-bind="options:supplydetails,optionstext:'itemcapacity',value:selectedsupply"></select> </td> </tr> </tbody> you can find

How can I (simulate?) do asynchronous HTTP requests in plain Ruby, no Rails? -

as learning exercise, making simple ruby command-line application logs handful of websites have public api (reddit, twitter, etc), checks if have new messages, , reads them out me. it works well... incredibly slowly, because waits each login-getcookies-requestmessages-getmessages cycle complete beyond moving onto next one. love have work asynchronously, can fire off multiple requests simultaneously, deal whichever data comes first, whichever data comes second, etc. i've googled problem , looked @ other stackoverflow threads, i'm confused different options available, , solutions seem assuming program part of larger rails app, isn't. thought i'd ask: simplest, smartest, efficient way i'm talking about? don't need guided through it, i'd input on situation people know better do, , suggestions should research solve problem. i'd willing write in javascript run on node if that'd more appropriate. you should try looking eventmachine . dece

javascript - IE8 and lower versions those do not support HTML5. How can we implement canvas? -

as per requirement implemented canvas in html5 , work , not working in ie8 , lower version . any solution . i not expert of field can start searching solution html5 canvas polyfill. found polyfill html5 after few searching: https://github.com/eligrey/canvas-toblob.js

php - Codeigniter - autoloading models with aliases -

when manually load models in codeigniter can specify alias so: $this->load->model("user_model","user"); //user alias user_model $this->user->getprofile(); //use alias refer actual model some of these models being extensively used in application , decided autoload them using autoload.php . know can load them so: $autoload['model'] = array("user_model","another_model"); however referenced on aliases. want load them existing alias name current code not disturbed. i guess can have code in autoloaded helper maybe: $ci= &get_instance(); $ci->user = $ci->user_model; but wanted check is, can load model alias name while autoloading? yes can create same alias in in autoload pass array try not possiable alias can create same alias auto loading time. $autoload['model'] = array(array('users_model', 'users'), array('an_model', 'an'), 'other_model'); or

dart - Improve application performance with isolate -

i have application generate hashed password , generate takes time. think improve performance, let hashed password generator work in seperate core. computer support 3 core processors , think idea use dart:isolate calculate hashed password in other processor core. i have tried following: import 'dart:isolate'; import 'package:dbcrypt/dbcrypt.dart'; main() { receiveport receiveport = new receiveport(); var receiveportpw = new receiveport(); receiveportpw.listen((msg) { print(msg); }); isolate.spawn(returnhashedpassword, receiveportpw.sendport); print('print1 -> ' + new dbcrypt().hashpw('password', new dbcrypt().gensalt())); print('print2 -> ' + new dbcrypt().hashpw('password', new dbcrypt().gensalt())); } void returnhashedpassword(sendport sendport) { receiveport receiveport = new receiveport(); sendport.send('isolate -> ' + new dbcrypt().hashpw('password', new dbcrypt

java - JavaFx Tableview speed and sorting in Sql application -

i working on small, toy application expand knowledge java javafx , sql . have mysql server in local network, able communicate , simple tableview can populated, sorted ... etc. data has shown user, no editing. nice , clean. the problems: there around 170 000 rows 10 col., chars , display, seems rather hard in reasonable time. query done during startup , take around 1 1/2 min before can see table. also memory footprint enormous, application without populated tableview around 70 mb, data has 600-700 mb (the xml file used populate mysql 70 mb in size ... ) ! sorting slow, using stringproperty should give boost according to: javafx tableview sort slow how improve sort speed in java swing (if understood correctly) custom sort, did not try far. my thoughts: similar application design mobile, think adapter-pattern can fix these problems. hence, create oberservablelist correct size of elements, populate limit of rows in beginning. when scrolling done (scroll wheel) list has

extracting the values from cell array in matlab -

related work, divided image number of overlapping blocks , each blocks dct coefficients calculated. dct coefficients of each block stored in cell-array. next want retrieve values form 1 cell. how can retrieve values cell? as answer. assume following question: " and stored each dct coefficient blocks cell ". have e.g. 20 blocks each containing dct of 100*100 pixel(double). data stored in 20x1 cell array each cell has 100x100 (double) entries. adress block (1 cell argument) use: block_data=cell_data{k,l}; to adress 1 element of elements inside block_data use "normal" adressing: element_data=block_data(m,n); k,l,m,n indices of respective data. assume dct-block-data numeric (e.g. double)

ios - Linker command failed with exit code 1 When add an unwind function to view controller -

i developing 1 ipad application using storyboard. in application have popup , view controller. if add function like: -(ibaction)unwindcouponpaymenttoorderdetailsview:(uistoryboardsegue *)unwindsegue{ } my application fails compile , shows error: linker command failed exit code 1 (use -v see invocation). i don't know error. check 2 or 3 times after code add view controller compilation become failed. remove above mentioned code again try compile application time same error coming. check out latest code svn work stage working fine if add function view controller again application become failed. don't know problem.

windows - Running for loop with user input -

i wish create batch file take user input of, set of ip's. these ip's have automatically open individual putty session , execute commands. start c:\users\dell\desktop\putty.exe -ssh userid@hostip -pw password -m command.txt this command using. @ moment using same command "n" no of times in batch file depending upon number of hostip have. now wish prompt enter set of ip's in 1 shot, , these induvidual ip's should substituted in hostip part of command. once enter set of ip's user input.. should count them, , create above script individual hostips execution. is possible. kindly full batch script :) thanks in advance.

java - Getting Null values of current visible windows titles -

i have created program current visible window names. gives names of windows opened on system. import java.io.bufferedreader; import java.io.inputstreamreader; import java.util.arraylist; import java.util.arrays; import java.util.collections; import java.util.comparator; import java.util.list; public class windownames { string s3; static int arraysize = 10; static int arraygrowth = 2; static string[] m = new string[arraysize]; static int count = 0; public static void main(string[] args) { final list<windowinfo> infllist = new arraylist<windowinfo>(); final list<integer> order = new arraylist<integer>(); int top = user32.instance.gettopwindow(0); while (top != 0) { order.add(top); top = user32.instance.getwindow(top, user32.gw_hwndnext); } user32.instance.enumwindows(new wndenumproc() { @override public boolean callback(int hwnd, int lpa

javascript - Check existence of values in array on multi select dropdown focusout in jQuery -

i have default array have fixed values showing multiselect dropdown user.so on focusout of drop down want check whether values selected have values in default array.if values missing want alert them user html <form action="#" method="post"> <fieldset> <label for="selecteditemlists">select values:</label> <select id="selecteditemlists" name="selecteditemlists" multiple> <option val="value1" selected >value1</option> <option val="value2">value2</option> <option val="value3" selected>value3</option> <option val="value4">value4</option> <option val="value5">value5</option> </select> </fieldset> <fieldset> <input type="submit" value="submit" /> &l

xaml - WPF binding - DataGrid.Items.Count -

in view, there datagrid , textbox, bound datagrid's items.count property: <datagrid x:name="datagrid" itemssource="{binding datatable}"/> <textbox text="{binding items.count,elementname=datagrid,mode=oneway,stringformat={}{0:#}}"/> the viewmodel has property (e.g. itemscount) i'd bound items.count property of datagrid, have no idea, how achieve this. class viewmodel : inotifypropertychanged { public datatable datatable {get;set;} public int itemscount {get;set;} } maybe use rows.count property of datatable datagrid bound to, how bind or link 2 properties in viewmodel? so want itemscount property synchronized datatable.rows.count property. a common way achieve requirements declare properties data bind ui controls: <datagrid x:name="datagrid" itemssource="{binding items}" /> <textbox text="{binding itemscount}" /> ... // need implement inotifypropertychanged in

jquery - Masonry add a loader at the bottom to show more images are still loading -

i using masonry load in lot's of images, have setup images gradually load in (append) rather having lots of white space on page. can see working l ive version here show mean. however images loading in not clear if there still more images loaded in. possible append loader.gif @ bottom indicate more images still come? once of images loaded loader.gif disappears. here jquery: $( function() { var $container = $('#artistdetwrap').masonry({ columnwidth: 1, gutter: 0, itemselector: '.artpost' }); // reveal initial images $container.masonryimagesreveal( $('#images').find('.artpost') ); }); $.fn.masonryimagesreveal = function( $items ) { var msnry = this.data('masonry'); var itemselector = msnry.options.itemselector; // hide default $items.hide(); // append container this.append( $items ); $items.imagesloade

c# - How to Create a file from database and uploading it to the server in asp.net -

i have scenario create file database table data , uploading server. written code it's working fine locally after hosted application in iis it's giving error . access path 'c:\windows\system32\config\systemprofile' denied.' description: unhandled exception occurred during execution of current web request. please review stack trace more information error , originated in code. exception details: system.unauthorizedaccessexception: access path 'c:\windows\system32\config\systemprofile' denied. asp.net not authorized access requested resource. consider granting access rights resource asp.net request identity. asp.net has base process identity (typically {machine}\aspnet on iis 5 or network service on iis 6 , iis 7, , configured application pool identity on iis 7.5) used if application not impersonating. if application impersonating via , identity anonymous user (typically iusr_machinename) or authenticated request user. grant

php - Trouble matching login password with stored hashed password in database -

i new php , mysql , working on registration/login form project build knowledge bit stuck, hope can help. i have database on phpmyadmin , registration form searches see if email address exists if not insert information database. works fine. have login form searched email address , password see if matched in database, if log in. worked fine. my issue came when started learn password salts/hashing. can still register okay when try login details in database doesn't seem match passwords allow me log in. register.php <?php error_reporting(e_all); require 'db_connect.php'; // stores information submitted form via $_post variable // if request method in form post execute following code (read submitted information - send email , redirect header location // if not post skip code block , show blank contact form if ($_server["request_method"] == "post") { $fname = trim($_post["fname"]); $lname = trim($_post["

java - Import javax.ejb.Schedule cannot be resolved -

i have problem, eclipse cannot found javax.ejb.schedule (or schedules) no problem other class javax.ejb.messagedriven. work on big application don't know. question how resolve this? or way for? jboos 4 jee5 compliant server, hence jee6 features not available.

Draw using graph coordinates in android -

in android app, want draw circles , have find intersection points. , need draw lines between intersection points got. know how implement logic dont know draw graph. i tried draw on mapview using geopoints, considered lattitude "x" axis , longitude "y"axis. not enough expected.(sometimes lines disappear when zooming). which feature of android facilitate this? guide me implement this. thanks in advance... you want custom view. custom views allow draw canvas. canvas has functions drawline , drawcircle. takes x,y coordinates, 0,0 being upper left corner , x , y growing bigger go right , down. if don't want 0,0 upper left, can use basic algebra translate wherever want.

User lookup on Twitter API from R results in error (403) -

using twitter api , twitter -package, trying retrieve user objects long list of names (between 50.000 , 100.000). i keep getting following error: error in twinterfaceobj$doapicall(paste("users", "lookup", sep = "/"), : client error: (403) forbidden the error code supposedly hints @ "update limits" . rate limit on user lookups 180 , lookups performed in batches of 100 user names. therefore 18.000 users shouldn't problem. reducing number 6000 (to respect limit on requests via application-only auth) per 15 minute time window results in same error. here mwe (for do, however, need your own api-keys ): library(plyr) # install latest versions github: # devtools::install_github("twitter", username="geoffjentry") # devtools::install_github("hadley/httr") library(twitter) library(httr) source("twitterkeys.r") # own api-keys setup_twitter_oauth(consumerkey, consumersecret, accesstoken, a

How would I flatten a nested dictionary in Python 3? -

this question has answer here: flatten nested python dictionaries, compressing keys 15 answers is there native function flatten nested dictionary output dictionary keys , values in format: _dict2 = { 'this.is.an.example': 2, 'this.is.another.value': 4, 'this.example.too': 3, 'example': 'fish' } assuming dictionary have several different value types, how should go iterating dictionary? you want traverse dictionary, building current key , accumulating flat dictionary. example: def flatten(current, key, result): if isinstance(current, dict): k in current: new_key = "{0}.{1}".format(key, k) if len(key) > 0 else k flatten(current[k], new_key, result) else: result[key] = current return result result = flatten(my_dict, '', {}) using it:

c++ - Template parameters simplification -

i new c++ (using c++ 2011) , find solution following problem. have class represents fonction: class curve { private: ... public: std::array<double, 3> value(double s); } i using object pass function algorithm represented class: template <int n, typename functor> class algorithm { private: functor f; std::array<double, n> a; public: ... } then create object algorithm<3, curve> solver; but 3 3 coming size of array returned method value of objet of type curve. simplify code can use : algorithm<curve> solver; but have no idea on how that. mind giving me hint ? best regards, francois add member array_length or similar curve classes: class curve { public: static constexpr const std::size_t length = 3; private: std::array<double,length> a; }; template<typename algorithm , std::size_t n = algorithm::length> class algorithm { ... }; if need allow classic function entities algorithms,

android - Why do I receive the "ParseObject has no data for this key" error when pinning to localDatastore? -

using following query want list of parseusers containing subset of columns, defined querycolumns list. receive results, when try pin them local datastore receive exception: com.parse.parseexception: java.lang.illegalstateexception: parseobject has no data key. call fetchifneeded() data. i can't understand why... should message appear when "complex" columns parseobjects involved? data i'm querying is, instead, composed strings , booleans only. final list<string> querycolumns = arrays.aslist( "username", // string "email", // string "avatarcountry", // string "avatarid", // string "showcountry" // boolean "facebookid" // string ); parsequery<parseuser> query = parseuser.getquery(); query.selectkeys(querycolumns); query.wherecontainedin("facebookid", fids); query.findinbackground(new findcallback<parseuser>

python - Django + nginx redirect loop for home / -

i've strange problem. it's not first page i've published in way first behavior. my site configured redirect: http://marclab.de http://marclab.de/ but it redirects http://marclab.de/ http://marclab.de/ ? the browser seems compensate misconfiguration, google not. i've 2 curl calls: ~ $ curl -v http://marclab.de * rebuilt url to: http://marclab.de/ * hostname not found in dns cache * trying 78.138.113.215... * adding handle: conn: 0x7fe1cb80a200 * adding handle: send: 0 * adding handle: recv: 0 * curl_addhandletopipeline: length: 1 * - conn 0 (0x7fe1cb80a200) send_pipe: 1, recv_pipe: 0 * connected marclab.de (78.138.113.215) port 80 (#0) > / http/1.1 > user-agent: curl/7.34.0 > host: marclab.de > accept: */* > < http/1.1 302 found < date: fri, 27 jun 2014 09:29:44 gmt < content-type: text/html; charset=utf-8 < transfer-encoding: chunked < connection: keep-alive * server wsgiserver/0.1 python/2.7.4 not blacklisted < serv

python - How to retrieve a specific field whith a special character in a list -

i have list contains fields: msg = ['you', 'must', 'pay', 'before', '$id2{8},', 'your', 'balance', 'is', '$id1{5}'] i want retrieve fields contain character $ , put them in variable i've tried this, don't know how can specify fields contain $ : for iter in msg: if iter == "...": print iter for item in msg: if '$' in item: starting=item.index('{') ending=item.index('}') print item[3:starting],item[starting+1:ending] you can search if '$' in item u can try lis=[(item[3],item[5]) item in msg if item .startwith('$') ] note: please not use iter variable built in function in python

database design - SQL one to one relationship vs. single table -

consider data structure such below user has small number of fixed settings. user [id] int identity not null, [name] nvarchar(max) not null, [email] vnarchar(2034) not null usersettings [settinga], [settingb], [settingc] is considered correct move user's settings separate table, thereby creating one-to-one relationship users table? offer real advantage on storing in same row user (the obvious disadvantage being performance). you split tables 2 or more 1:1 related tables when table gets wide (i.e. has many columns). hard programmers have deal tables many columns. big companies such tables can have more 100 columns. so imagine product table. there selling price , maybe price used calculation , estimation only. wouldn't have 2 tables, 1 real values , 1 planning phase? programmer never confuse 2 prices. or take logistic settings product. want insert products table, these logistic attributes in it, need set of these? if 2 tables, insert product table, , progr

javascript - Error: Permission denied to access property 'document' - while accessing content from iframe -

<!doctype html> <html> <head> <meta charset="utf-8"> <title>untitled document</title> <script src="http://code.jquery.com/jquery-1.11.0.min.js"></script> </head> <body> <iframe width="640px" height="590px" id="pagefrm" src="http://support.domain.com/controller/method"></iframe> <script> $(window).load(function() { $("#pagefrm").contents().find("body").append("hi"); }); </script> </body> </html> in above code, trying append text or scripts parent page. when ever use .append(), .html(), .prepend() etc. using jquery, returning error - error: permission denied access property 'document'.

winforms - where should I save the license file of windows Application -

i have developed windows application in using activatar generate licence file , activate product. dont know best place save licence file. can let me know?? genrally should placed in application folder. but, file should encrypted user cannot read directly. if file not exist in location application should started in evolution mode or should expired. make sure algorithm of encryption must build otherwise hacker can decrypt , crack product. license file should contains information computer application installed. so, when application getting started check file not copied machine. if application using database sql server or other database. can store file in database directly in binary format.

c# - Unable to Add Controller -

Image
i new mvc web application development. trying add controller after adding model , dbcontext class. but when trying controller using entity framework gives me error of unable cast object of type 'system.data.entity.core.objects.objectcontext' 'system.data.objects.objectcontext' i using ef-6.1.1 (latest update) following model , context class.. public class empdetails { [key] public int id { get; set; } public string empid { get; set; } public string employeename { get; set; } } public class modelcontext : dbcontext { public dbset<empdetails> employee { get; set; } } when trying add controller following error. please suggest solution problem. going wrong it.. here process through adding controller entity framework brought breaking changes between versions 5 , 6. in order go open source, moved of libraries out of band , within entityframework assembly in nuget. side ef

c++ - Handling blank lines in email headers -

came across few mails aren't rfc compliant authentication-results: spf=none (sender ip ) smtp.mailfrom=**@********.**; content-type: multipart/related; boundary="_004_2039b206f2a54788ba6a101978bd3f82dbxpr07mb013eurprd07pro_"; type="multipart/alternative" mime-version: 1.0 for example, mail above has blank line in header (before content-type). libraries strictly abide rfc (for example https://github.com/mikel/mail ), won;t able parse them. apple mail, thunderbird manage handle such mails. have tried browse through thunderbird's codebase, being unfamiliar c++, managed find https://github.com/mozilla/releases-comm-central/blob/1f2a40ec2adb448043de0ae96d93b44a9bfefcd1/mailnews/mime/src/mimemsg.cpp can point me part of thunderbird's codebase mail parsing happens, or opensource libraries/apps handle such non complaint mails. edit: hexdump of blank line. contains space. 00013e0: 2a2a 2a2a 2a2a 2e2a 2a3b 0d0a 200d 0a43 ******.**;.. ..

jquery - how use parent Selecltor css3 crossbrowser -

this question has answer here: is there css parent selector? 25 answers i select element parent ......................... i have aclass , cclass.. aclass parent , cclass child class.. <div class="a"> <div class="c">mgmg</div> </div> <div class="a"> <div class="c">mgmg</div> </div> <div class="a"> </div> <div class="a"> <div class="c">mgmg</div> </div> //how use parent select csscode .a < .c{ border:1px solid red; color:red; background-color:green; } this not possible in css alone. css can traverse down dom. an alternative use javascript find .c elements , find parent .a , if exists.

java - recursive method to draw a dendrogram -

Image
i have draw dendrogram : but bigger. there option representation of data clustering. stuck recursive method draw dendrogram. i principle draw method should like draw(cluster){ if(clusters.haschildren()){ draw(cluster.child1) draw(cluster.child2) } //draw actual cluster here } but quite stuck @ implementing it. my method @ moment looks this drawcluster(cluster, startx, starty){ if(cluster.haschildren()){ drawcluster, cluster.child1(), cluster.child1().getdepth * 30, height - cluster.child2.getwidth * 20) drawcluster, cluster.child2(), cluster.child2().getdepth * 30, height - 20) } if cluster.getdepth() == 0 ) drawline(500 - 30), height, 500) else drawline(500 - (width * 30), height, 500); } so space have drawing 500 px in width , height total_number_of_leafs * 20 draw line each cluster distances correct. every time start line @ 500px minus depth of cluster times 20.and draw line 500th pixel

html - How to make a footer fixed -

how make footer fixed without giving position property like position:fixed i have tried lot, footer doesn't stand @ bottom every time. suggestion ? maybe you're talking sticky footer... in order work, footer can’t in wrapper class. code have structured example: <div id="page"></div> <footer id="colophon"></footer> also, required set margin , padding body 0. these requirements far know of have css. body { margin: 0; padding: 0; } the idea behind jquery pretty simple. check height of element, check height of viewport. if viewport height greater #page’s height, need set css on footer. css absolutely position @ bottom of frame. it’s idea make sure footer’s width 100% looks right. brought in jquery , inserted code. <script type="text/javascript" src="http://code.jquery.com/jquery.js"></script> <script type="text/javascript"> $(document).ready(function()

Python: read all files from directory -

i trying write code read text files directory , find if file has text like: 'this color=green' 'its color=orange' then has print specific color. code isn't printing output: import os path = r'c:\python27' data = {} dir_entry in os.listdir(path): dir_entry_path = os.path.join(path, dir_entry) if os.path.isfile(dir_entry_path): open(dir_entry_path, 'r') my_file: data[dir_entry] = my_file.read() line in my_file: part in line.split(): if "color=" in part: print part my output has like: color=green color=orange i individual files when comes directory, don't output. as mentioned in other answers, you're reading file twice , hence pointer @ end of file. if want data propagated contents of files printing relevant color lines, read data: data = {} dir_item in os.listdir(path): dir_item_path = os.path.join(pa

jquery - JQueryUI - Dialog over dialog not working in Chrome/IE -

i relatively new jquery , struggling following scenario in chrome/ie. it works in ff . have import dialog import number of records. while import in progress want show progress bar trying render modal dialog progress bar. chrome/ie won't render waitdialog. here source code: $("#itemimportviewdlg").dialog({ width: 600, height: 650, modal: true, dialogclass: "no-close", resizable: false, draggable: false, title: "import data", closeonescape: false, //dont allow esc close dlg buttons: { "import": function() { $("#waitdialog").dialog({ width: 350, height: 150, modal: true, dialogclass: "no-close", resizable: false, draggable: false, title: "progress...", stack: true, closeonescape: false, //dont allo

How to refactor long if/return statements in Ruby? -

i encounter complex pile of if statements, ruby way clean up? (in service object example, foo has many bars. transferring bar different foo.) class barmanager include fancyerrorlogger def self.transfer(bar, new_foo) # move needed? line superfluous , premature optimisation? return true if bar.foo_id == new_foo.id # checks bar can moved new_foo. many more elsifs in practice, needs refactoring. these examples demonstrate potential complexity of each step, preventing use of overly simplistic solutions such seen here http://codereview.stackexchange.com/questions/14080/avoiding-a-lot-of-ifs-in-ruby if bar.dependency == :do_not_move_me or bar.some_condition == false bar.errors.add( :transfer, "this bar can't moved, on street corners moping , singing") return false elsif new_foo.want_more_bars == false bar.errors.add( :transfer, "\"we don't take kindly type, bar\" - #{new_foo.name}") return false

Add border around png image using imagick PHP -

Image
how can add border around png image? whenever try add border using borderimage function available in imagick loses transparency if png image. <?php $image = new imagick(); $image->readimage('tux.png'); $image->borderimage(new imagickpixel("red") , 5,5); // send result browser header("content-type: image/" . $image->getimageformat()); echo $image; this original image: and after adding border: border color applied onto background. want using imagick how can apply border transparent image without losing transparency? if want achieve result this: then it. can give padding between border , image if want! /** set source image location. can use url here **/ $imagelocation = 'tux.png'; /** set border format **/ $borderwidth = 10; // can use color name, hex code, rgb() or rgba() $bordercolor = 'rgba(255, 0, 0, 1)'; // padding between image , border. set 0 give none $borderpadding = 0; /** core prog