Posts

Showing posts from September, 2012

java - Postgis and Oracle spatial queries with GeometryUserType parameters -

following configuration of postgis , oracle spatial different hibernate persistence units , have instances of myclass persisted either postgis or oracle database configured in persistence.xml , mapping file. i have geom attribute annotated : public abstract class myclass (...) @type(type = "org.hibernatespatial.geometryusertype") @column(name = "geom", columndefinition="geometry", nullable = true) protected geometry geom; (...) persistence.xml configured : <persistence-unit name="pers_unit_name" transaction-type="jta"> <provider>org.hibernate.ejb.hibernatepersistence</provider> <jta-data-source>jta_data_source_name</jta-data-source> <mapping-file>oracle.hbm.xml</mapping-file> and in oracle.hbm.xml : <hibernate-mapping> <typedef name="org.hibernatespatial.geometryusertype" class="org.hibernatespatial.geometryusertype" >

Netezza: While creating external table, column name is duped with same data type, need to know the reason -

i creating external table in netezza. after table creation when describing it, can see column duped 4 times. looks strange me happening. example: create external table test '/nzscratch/kapish/69314.082.000/tv_daily_audit_results.txt' using(delim '|' format 'text' ) select b.card_acceptor_id mid, a.div_no card_div_no, c.div_name acct_type, a.acct_id, a.tran_text, substr(a.tran_text, 24, 13) merchant_city, substr(a.tran_text, 37, 2) merchant_state, b.merchant_zip_cd, a.post_date, a.tran_cd, a.gl_origin_cd, a.tran_amt, a.merchant_cat_cd pstdtr_pstd_trans a, pstdrt_rtain_rtns b, divdef_div_def_v c a.acct_id = b.acct_id , a.reference_no = b.reference_no , a.tran_date = b.tran_date , a.div_no = c.div_no , a.div_no in (232, 234, 235, 237, 273, 275, 276, 278)

sql - MySQL - sort by certain last string character -

i'm trying sort character on string, example, before: +----+---------+ | id | name | +----+---------+ | 1 | red | | 2 | red-a | | 3 | red-xy | | 4 | blue | | 5 | blue-a | | 6 | blue-xy | +----+---------+ after: +----+---------+ | id | name | +----+---------+ | 4 | blue | | 1 | red | | 5 | blue-a | | 2 | red-a | | 6 | blue-xy | | 3 | red-xy | +----+---------+ are there ways categorize based on -a or -xy using order by thank in advance. select case when right(`name`,length(`name`)-instr(`name`,'-')) = `name` '' else right(`name`,length(`name`)-instr(`name`,'-')) end `suffix`, `name` `table1` order `suffix`, `name` if no suffix found, put record in first row set. caveat: first dash used separate word prefix.

compiler errors - Python 3: "Expected an indent Block" in a comment -

i new here , german (so english not good). i have written function in python , @ top want have comment. problem is, python says "expected indent block" error in comment. def makeonefeedscript(): z = 1 cfeedlist = [str("null")]*3 #liste mit länge der feeds erstellen #listen für 1. 2. 3. post, usw, ifeedlist = [] #liste für posttime des 1. posts pro feed iifeedlist = [] #liste für posttime des 2. posts pro feed iiifeedlist = [] #liste für posttime des 3. posts pro feed ivfeedlist = [] #liste für posttime des 4. posts pro feed vfeedlist = [] #liste für posttime des 5. posts pro feed vifeedlist = [] #liste für posttime des 6. posts pro feed in range(z): #alle daten aus dateien lesen s = "/usr/lib/advanced-feed/tmp/" + str(i) #speicherortspeichern f = open(s, "rb") #Öffnen all dependent lines must indented: def makeonefeedscript(): z = 1 cfeedlist = [str("null&quo

Polymer iron-list dynamically adding items? -

i'm trying migrate code polymer 0.5 1.x, means moving core-list iron-list. however, can not figure out iron equivalent how adding items core-list. <core-list height="85"> <template> <div class="{{ {selected: selected} | tokenlist }}" style="padding:5px;"><paper-fab mini icon="arrow-forward" title="arrow-forward"></paper-fab> <!--{{index}}-->{{model.name}}</div> </template> </core-list> which called updated via... document.queryselector('core-list').data = $.parsejson('[{"name":"one"},{"name":"two"}]'); anyone have suggestions? update : jul-23-2015 12:20pm pst @zikes following suggestion posted, have following. <dom-module id="my-element"> <template> <iron-list items="[[myitems]]" as="item"> <template> <div>[[item.name]]</di

Parse a HTML document and get a specific element in PHP and save its HTML -

all want save first div attribute role="main" string external url using php. so far have this: $doc = new domdocument(); @$doc->loadhtmlfile("http://example.com/"); $xpath = new domxpath($doc); $elements = $xpath->query('//div[@role="main"]'); $str = ""; if ($elements->length > 0) { $str = $elements->item(0)->textcontent; } echo htmlentities($str); but unfortunately $str not seem displaying html tags. text. you can html via savehtml() method. $str = $doc->savehtml($elements->item(0));

decompression - Decompress LZString in PHP -

Image
i used lzstring in javascript compress json data , post php program. ( http://pieroxy.net/blog/pages/lz-string/index.html ) i have binary code want decompress in php, use lzstring.php repository : https://github.com/nullpunkt/lz-string-php/blob/master/src/lzstring.php when use compress() method error, when use decompressfrombase64() method there no error funstion return empty string ! how can decompress lzstring in php ? my data same picture:

f# - MIX seqbuilder [CustomOperation] attribute method AND vanilla yield IN a single seq expression -

this code runs fine except if uncomment last line in custom seq expression : type t (i: int) = member x.i = override x.tostring() = sprintf "t %a " x.i type tbuilder() = member x.yield (()) = seq.empty [<customoperation("test")>] member x.test1 (source : seq<_>, i: int) : seq<t> = printfn "calling test1 i= %d" |> ignore seq { yield! source yield t(i) } let t = tbuilder() let mytest = t { test 42 test 43 // yield t(44) // if uncommented, not compile } if yield t(44) line uncommented, compiler error : error control construct may used if computation expression builder defines 'for' method. my question : there way mix my [customoperation] test (from method test1 ) yields t objects with a vanilla yield, example yield t(44) or other seq related syntax inside unique seq expression without defining 'for'

Sass failing to compile - Web Essentials 2013 Update 4 "Unable to find resource" -

does have idea, causes following error? 23.07.2015 17:48:14: scss: compiling widgetmain.scss 23.07.2015 17:48:14: looking resource @ http://localhost.:55559/ 23.07.2015 17:48:14: looking resource @ http://localhost.:55559/ 23.07.2015 17:48:15: looking resource @ http://localhost.:55559/ 23.07.2015 17:48:15: looking resource @ http://localhost.:55559/ 23.07.2015 17:48:15: looking resource @ http://localhost.:55559/ 23.07.2015 17:48:16: looking resource @ http://localhost.:55559/ 23.07.2015 17:48:16: unable find resource, aborting it occurs when save scss file. occurs when clear file completely. that's why did not post source code. port number changes every time. when open compiled view of file shows: /* compilation error occurred (see error list navigate error location): */ i reinstalled web essentials, had no luck. according https://github.com/madskristensen/webessentials2013/issues/1914 @efepuntomarcos's information, add "localhost." (that has

shared libraries - Tizen Docs give C headers but not Lib names? -

trying implement unity3d c# plugin code finding tizen docs rather lacking. i need know lib names used specific headers. such message box api: https://developer.tizen.org/dev-guide/2.3.0/org.tizen.native.mobile.apireference/group__capi__messaging__messages__module.html#ga32013c0d16b46a60be3f837c6474e4be it tells me header required not lib used in. blackberry, ms , apple list in there docs , part of normal doc gen. why tizen doesn't give beyond me. there easy quick way find info? thought might know. here location lib: c:\tizen-sdk\platforms\mobile-2.3\rootstraps\mobile-2.3-device.core nice know lib goes header. looks might be: libcapi-messaging-messages.so yes, seems think it's idea libraries opaque reader, not sure why. set of "open source" libraries, including efl ones, identified name, tizen-specific part not. try find out motivation. has caused me problems (yes know in stackoverflow parlance not "answer")

mysql - How do I get records where the data started at a particular day? -

i have following sql code show id , date records date started @ 23/xx/xx is correct? select id, date xxx date = yyyy/mm/23; see dayofmonth select id, date your_table dayofmonth(date) = 23

javascript - loop through the provided attributes -

i new angular, have requirement need add many custom attributes custom element directive, <radio-button> . currently, doing this: <radio-button one-attr="some value" two-attr="some string" three-attr="some other string"><radio-button> i have many radio buttons on page , writing custom attributes each custom directive on page looks messy. so, looking alternative can pass javascript array object loops on each radio-button custom directive. for example: ( in controller ) $scope.values = [{ 'one-attr': 'some value', 'two-attr': 'some other value', 'three-attr': 'another value', /* , on... */ }, { /* custom attribute set */ } /* on */ ] and custom directive, pass custom attribute directive shown below: <radio-button ng-repeat="(key, value) in values" loop-attributes="key, value"></radio-button> wh

Sort array by values in PHP mantaining relative positions -

i'm using usort() , uasort(). need sort array values using user-defined comparison function. php.net/manual/en/function.usort.php the doc says: note: if 2 members compare equal, relative order in sorted array undefined. the question is: there php function mantain relative position of equal elements? the short answer php not have built in function this, have write one. of time, not matter if sort moves element or down if considered equal adjoining element. example array of integers. if 2 same, cares order in long together. for cases need maintain order of lists, sreid has written function this. on usort page @ php.net. pasting here convenience. aware giving sreid full credit code, , have mentioned original code can found in public forum: function mergesort(&$array, $cmp_function = 'strcmp') { // arrays of size < 2 require no action. if (count($array) < 2) return; // split array in half $halfway = count($array) / 2; $array1 = array

c# - Add reference vs Add service reference -

i'm little bit confused "add reference" , "add service reference" in case of wcf service. checked on internet , msdn did not find suitable answer.the actual problem i'm facing due lack of understanding this, questioned here ( add service reference gives exception: unable connect remote server ). i tried find that, add service reference invoking svcutil.exe , add reference adding dll. however, did not give me clear idea.what internally happens in both case? if add reference working fine basic http connection, why add service reference not work? please me understand without down grading question.i'm tiring find out solution problem. use add service reference when adding web service reference solution , needs proxy call service functions. add reference in case when have project , want add library or add external library. from msdn: "a service reference enables project access 1 or more windows communication foundation (wcf) services&q

json - HttpResponse Date field is getting changed in MVC Client -

http response date getting changed on client side have received wcf service. below output getting service: i getting different date uid(175605) here client code: from above response date following changed (/date(1437657709773-0400). when tried convert new date(1437657709773-0400),i getting date "+new date(1437657709773-0400)-->thu jul 23 2015 18:51:49 gmt+0530 (india standard time) object, (date)" which different got wcf service response uid (175605) why date changing service(2015-07-23t06:45:34.973) client(2015-07-23 18:51). can please correct if missing conversion. i'd similar problem facing time zone difference, here link can find information how solve problem: coding best practices using datetime in .net framework hope helps.

angularjs - angular UI modal backdrop -

Image
i having issue angular ui modal. there white rectangle between modal , backdrop. ideas? var modalinstance = $modal.open({ templateurl:'src/app/shared/confirm-modal.html', controller:'confirmmodalctrl', controlleras:'vm', resolve:{ data:function(){ return { title:'delete?', message:'are sure', buttons:['ok','cancel'] } } }, size:'lg' }); modalinstance.result.then(function(result){ alert('ok') },function(){ alert('canceled') }); this known bug when using angular-ui-bootstrap 1.13.0 angular 1.4 due breaking changes made in $animate in angular 1.4. if set animate:false backdrop works lose modal animations you can

javascript - How to find or create a questionnaire with the function of the prohibition on the same answer? -

i need help. need find questionnaire in answer question (for example, telephone number) may not same 2 users. example: enter phone number: first user enters phone number: 123456789 , completes survey. the second user starts question , answers same phone number 123456789. receives error message or request enter different answer. or there easy implementation of problem using php or javascript. maybe possible implement surveymonkey api. i glad of or advice. google forms writes spreadsheet database, allows regular expression fields , attached scripts. set field mach required format, validate response script.

android - cant get file path from URI -

i trying open intent lets me choose file. im able select file when try creating file uri got in onactivityresult method file size of 0. dont think im getting right file path. file file = new file(environment.getexternalstoragedirectory().getpath()+"/testapp4"); intent intent = new intent(); intent.setaction(intent.action_get_content); uri data = uri.fromfile(file); string type = "*/*"; intent.setdataandtype(data, type); startactivityforresult(intent, 12); onactivityresult: uri u= data.getdata(); file file = new file( u.getpath); file.length() // give 0 public string getrealpathfromuri(context context, uri contenturi) { cursor cursor = null; try { string[] proj = { mediastore.images.media.data }; cursor = context.getcontentresolver().query(contenturi, proj, null, null, null); int column_index = cursor.getcolumnindexorthrow(mediastore.images.media.data);

linux - loop multiple file with only 1st file being read -

so have works going mulitple directories within these directories takes multiple fields files , store in .txt files. there 2 loop, first 1 loops through folder second 1 loops through files. problem encounter in second loops read first file in folder , moves on next folder , ignore other files in folder. archive=/imdata/archive inventory_archive=/imdata/a/shares/b/inventory/c ls $archive | while read p; echo "project: $p" mkdir -v $inventory_archive/$p dir=$inventory_archive/$p ls -1 $archive/$p/d001 | while read s; echo "searching session: $s ..." find $archive/$p/d001/$s -type f -iname "*.txt" | while read f; echo "file: $f" study=`/home/me/program/bin/script $f | grep -m1 "field1" | cut -d "[" -f2 | cut -d "]" -f1` echo "sid: $study" if [ ! -d "$dir/$study" ]; mkdir -v $dir/$study fi

android - How to put Sidebar and Tabbed Actionbar on the same Activity? -

i new android, don't know if make myself clear enough. i want make app sidebar http://i.stack.imgur.com/yctxa.png and when ukt selected open corresponding frame tabs http://i.stack.imgur.com/ipif9.png i can on separate activities, want still have sidebar when ukt clicked. is there without actionbarsherlock suggested here? action bar tabs using viewpager navigation drawer

git - How to hide files from getting pushed to Github but still have them push to Heroku -

sorry if stupid question. i'm using oauth2 in heroku app has public github repo. if exclude file has oauth2 credentials via .gitignore, file still pushed heroku app? if not, what's ebst way keep credentials getting published on github, still have access them in heroku app? use heroku app settings store credentials. heroku config:set key=value and app has environment variable key specified value. or if prefer can update them through heroku dashboard on 'settings' tab press 'reveal config vars' button , can edit config variables through web.

loop through columns of data frame in r -

i have following problem: levelsvar <- c("arrears", "expenses", "warmhome", "telephone", "colortv", "washer", "car", "meatfish", "holiday") variables <- null (i in 1:length(levelsvar)) { variables <- sapply(levelstest, function(x) (length(test$levelsvar[i][test$country==x & test$levelsvar[i]=="1"]) + length(test$levelsvar[i][test$country==x & test$levelsvar[i]=="2"])) / length(test$levelsvar[i][test$country==x])) } i want use loop perform function can see above 9 times levels of "levelsvar". tried various times failed. think problem r reads test$"arrears" instead of test$arrears i tried use noquote() didn't help. do have solution problem? thank in advance! edit: with example levelstest <- c("at", "be") levelsvar <- c("arrears", "expenses", "warmhome",

mysql - Join statement for multiple values in the same column separated by comma -

i have 2 tables follows:- products product_name | category_id nutella | 1,2 milk | 3,4 categories cat_id | name 1 | dessert 2 | chocolate 3 | dairy 4 | milk i using datatable server side processing using ssp library display products table. i need make join statement me categories each product since category column contains comma separated multiple values! is there anyway can using mysql? edit expected output product_name | category_id nutella | dessert,chocolate milk | diary,milk assuming sql server, first, can use cte rows comma separated categories ids rows, using inner join on cat_id, can desired result. see demo sql server ;with cteproduct (product_name,category_id) ( select a.product_name, split.a.value('.', 'varchar(100)') category_id ( select product_name, cast ('<m>' +

jboss - JVM Crash due to `EXCEPTION_ACCESS_VIOLATION` in org.infinispan.util.concurrent.jdk8backported.LongAdder -

this happening on jboss eap 6.1, single user works fine, 2 or 3 concurrent user start interacting application, jvm gets crashed. the jvm crashing exception_access_violation; full trace below: # # fatal error has been detected java runtime environment: # # exception_access_violation (0xc0000005) @ pc=0x024c8266, pid=5136, tid=8736 # # jre version: 6.0_45-b06 # java vm: java hotspot(tm) client vm (20.45-b01 mixed mode windows-x86 ) # problematic frame: # j org.infinispan.util.concurrent.jdk8backported.longadder.add(j)v # # if submit bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # --------------- t h r e d --------------- current thread (0x6602dc00): javathread "http-ds-7071bc90200f..corp.in/10.112.70.75:8080-6" daemon [_thread_in_java, id=8736, stack(0x663a0000,0x663f0000)] siginfo: exceptioncode=0xc0000005, reading address 0x8ddb6987 registers: eax=0x00000002, ebx=0xffffffff, ecx=0x00000001, edx=0x0ddb6988 esp=0x663ee3c0, ebp=0x

javascript - Identity selectors in jQuery returning arrays -

suppose have div tag this: <div id="group-dialog" class="modal-dialog"> now want grab jquery object (in case can run .dialog()). when try this: var gdialog = $('#group-dialog'); i array (!!). why getting array? isn't point of having id attribute there's one? can see getting multiple p's or .my-css-thing ... next question: i have array 1 object in want access jquery object. when this: $(gdialog[0]) and pull in f12, still have array!! thought de-referenced array picking first element. this doesn't seem either: var gdialog = $('#group-dialog:first'); this basic, run problem lot. seems used lot simpler! what best way access dom element jquery object? answer 1 jquery selectors return arrays. selection id attribute particular use case , ideally result should unique. however, there nothing preventing having duplicated ids in html document (although bad practice). answer 2 following code

Gradle on build copy generated binaries to some location -

how copy on build - generated binaries location? i imagine: jar { dolast { copy./..??? } } the following code snippet should job: jar { dolast { copy { jar.outputs 'destination_dir' } } }

java - Does any of javafx extra libs have a such component? -

Image
i need split panel minimaze feature. maybe, javafx libs implement component or better create myself? for example want eclipse've had: ->

c# - Programmatically login 10 users to remote desktop session -

i trying create application programmatically login 10 users using rdp. purpose autologin these users not have manually it. first server tested against (server 2012) worked fine. however, tried server 2008 r2 , continues prompt me password. here code. static void main(string[] args) { var password = configurationmanager.appsettings["password"]; var machine = configurationmanager.appsettings["machinename"]; var usernamelist = new list<string>(configurationmanager.appsettings["username"].split(new char[] { ';' })); foreach(string name in usernamelist) { process rdpprocess = new process(); rdpprocess.startinfo.filename = environment.expandenvironmentvariables(@"%systemroot%\system32\cmdkey.exe"); rdpprocess.startinfo.arguments = "/generic:termsrv/" + machine + "/user:" + name + " /pass:" + password; r

How can I import JSON from a text file into MongoDB -

i have text file following json , text file size around 60 mb. { "houseno":"12345678", "location":"india" -- -- } { "houseno":"1245678", "location":"uk" -- -- } i want import json data in same collection.i m not getting idea how import text file json data mongodb any 1 have idea or suggestion how ..? as experience, should try mongoimport. then, can import json follows // --jsonarray output json array rather 1 object per line mongoimport -d dbname -c collectionnameyoulike --file your.json --jsonarray besides, mongoimport seems have format requirements json. it should (one json object in 1 line) {"houseno":"12345678","location":"india"} {"houseno":"1245678","location":"uk"} instead of { "houseno":"12345678", "location":"india" } { "houseno":&

javascript - how to simplify this statement using indexOf? -

this question has answer here: determine whether array contains value [duplicate] 18 answers how can simplfy following text inside if statement in javascript using "indexof"? if (a === 1 || === 2 || === 3) { return "correct"; }; i guessing array needs made 1,2, , 3, unsure of how instanceof after that *edited indexof instead of instanceof the instanceof operator tests whether object has in prototype chain prototype property of constructor. in case, instanceof wont you. can use indexof() array follow. var arr = [1, 2, 3]; // check if present in arr array if (arr.indexof(a) > -1) { return "correct"; }

arrays - how to get Category values from json in android? -

this question has answer here: how parse json in java 27 answers { "response": { "category": [ "restaurant", "salon", "spa", "dry cleaners", "car spa", "hospitals" ] } } you can this- try { string json = <your json string>; jsonobject response = new jsonobject(json); jsonarray category = response.getjsonarray("category"); (int = 0; < category.length(); i++) { log.d("categories are", category.getstring(i)); } } catch (jsonexception e) { e.printstacktrace(); }

intellij idea - Git: Received HTTP code 503 from proxy after CONNECT -

i checked lot of post related issue, nothing seems fix problem. hope guys can give me magic answer. i'm using intellij (but tried sourcetree) pull/push/clone repository fisheye. i'm receiving error: git -c diff.mnemonicprefix=false -c core.quotepath=false fetch origin fatal: unable access 'https://myuser@myurl/fisheye/git/myrepo.git/': received http code 503 proxy after connect hints 503 means temporary downtime due maintenance don't work me, since issue last week now. hints wrong/missing proxy settings don't seem work either. setup http , https proxy system git , ide (intellij). it worked before, able clone repository. created new branch, made changes , wanted push master. i looking forward clever tips. thanks far update i added: export git_trace_packet=1 export git_trace=1 export git_curl_verbose=1 and received following log : $ git fetch trace: built-in: git 'fetch' trace: run_command: 'git-remote-https' 'ori

PHP/LDAP: Bad Search Filter (OU with Ampersand) -

i have written ldap-authentication-class (working active directory) while ago , created new web-application department, uses authentication class. basically user enters credentials, script binds ad , checks if user member of group. password authentication works every time, checking group memberships work, if user not in or below ou ampersand in it's name. the problem seems be, department name contains ampersand , therefore organizational unit too. allthough have permissions in ad change name, other applications access ou name, therefore can not change (also don't know if there other ous ampersands in names, same problem might occur later). funny thing: if use ldp.exe under windows can use exact same search filter without problems, guess problem correct transmission of symbol (my app uses utf-8 , ampersand-character displayed correctly when pulled ad , printed, don't think it's encoding problem) the line use create filter is: $filter = "(&(objectc

vb.net - SQL string format with quotes -

if u have text ( sql query ) , want put prefix on each line like sq &= " , @ end of line " something this. select name,age users id<>0 i want sq &=" select " sq &=" name,age " sq &=" from" sq &=" users " sq &=" " sq &=" id<>0" if possible keep formated if not cares. i need because use vb.net , work queries. i recommend nimbletext. add external tools vs , ssms. a pattern of sql &=" $0 " gives results want. tools, options... turns trim off

c++ - Why is the output of this regex different across g++ and vc++? -

below simple c++ regex program #include<string> #include<iostream> #include<regex> using namespace std; int main() { regex re( "^([^\\.]+\\.?)+$" , regex::icase); smatch match; if (regex_search(string("abcd.com") , match, re) ) cout<<"match found"; else cout<<"not found"; return 0; } vc++ 2010 says "not found" g++ says "match found" why?

java - Spring security and spring email pom configuration conflict -

<spring.version>4.0.1.release</spring.version> <spring.security.core.version>3.1.1.release</spring.security.core.version> <spring.security.version>3.1.1.release</spring.security.version> <dependency> <groupid>org.springframework</groupid> <artifactid>spring-webmvc</artifactid> <version>${spring.version}</version> <exclusions> <exclusion> <artifactid>commons-logging</artifactid> <groupid>commons-logging</groupid> </exclusion> </exclusions> </dependency> <dependency> <groupid>org.springframework</groupid> <artifactid>spring-jdbc</artifactid> <version>${spring.version}</version> </dependency> <dependency> <groupid>org.springframework</groupid> <artifactid>spring

ruby - Rails connect modal with a create action -

it's first post. i'm new in rails , need help. try make online shop. have create button "buy" (with bootstrap) under each of products, activate modal. inside modal button "add cart", , cant make work. want through create action in line_items_controller add line_item cart. modal works fine button "add cart" no. think problem path give button. my code: cart.rb class cart < activerecord::base has_many :line_items, dependent: :destroy line_item.rb class lineitem < activerecord::base belongs_to :product belongs_to :cart product.rb class product < activerecord::base has_many :line_items line_items_controller.rb class lineitemscontroller < applicationcontroller include currentcart before_action :set_cart, only: [:create] before_action :set_line_item, only: [:show, :edit, :update, :destroy] def create @product = product.find(params[:product_id]) @line_item = create_line_ite

jquery.smartbanner.js + prototype.js not working -

i'm trying use smart-banner described here i'm using jquery , prototype in app jquery.noconflict(); , worked fine other jquery-plugins, jcarousellite or bootstrap . i added following refs , code page: <meta name="google-play-app" content="app-id=com.myapppackage"> <link rel="stylesheet" href="jquery.smartbanner.css" type="text/css" media="screen"> <script src="jquery.smartbanner.js"></script> <script type="text/javascript"> $().smartbanner(); </script> when load page, see in firebug following: typeerror: $(...) undefined $().smartbanner(); what missing?

css - Safari on Mac not updating / redrawing after hover effect -

i've got safari-specific problem hover effect: when user moves on circle, circle should appear on (offset). this works, when user moves cursor off circles, parts of hover-circle still remain until browser redraws site (not sure if "redraw" right term) . can cmd+a select text, example. hover--leftovers disappear then. i think example shows best: http://jsfiddle.net/l81h9hjr/3/ <div class="wrap"> <h1><a href="#"><span>reply<span>our services</span></span></a></h1> </div> the example works flawlessly in other browser tested, need mac safari (i tried 8.0.6). this repaint/redraw issue safari / webkit (not sure why it's on safari , not chrome). i worked around issue attaching jquery event hover element forced it's surrounding/parent elements redraw (in case, hide() , show(0)). $('.hover-element').on('mouseleave',function(){ $(this).parent

windows - batch file to create subfolder structure within existing folders -

i want create following folder structure @ work. have add 'archived emails' directory, sorted year, month within 50(ish) folders individual towns. folder in bold exists: town archived emails yyyy 01janyyyy 02febyyyy 03maryyyy etc etc the preceding 01,02,03 in months folder months sorted in explorer properly. me out writing batch file please? i'm not syntax. thanks for creating folder use md "c:\[path-to-town]\archived emails" for example here have nice resource batch scripting. can find there neat description of how make loop in batch scripts.

C# Linq - Join 2 Lists, add in extra properties to existing List -

suppose have following 2 classes set in c# program: public class class1 { public string var1; public string var2; public string var3; public string var4; public string var5; } public class class2 { public string var1; public string var2; public string var3; public string var6; public string var7; } and have following code in method: public void mymethod() { list<class1> class1data = getclass1data(); list<class2> class2data = getclass2data(); var joineddata = (from c1 in class1data join c2 in class2data on new { c1.var1, c1.var2, c1.var3 } equals new { c2.var1, c2.var2, c2.var3