Posts

Showing posts from June, 2012

ios - How to prevent an animation from completing when user leaves and returns to app -

i making app have button moving 1 side of screen other. have created pause button pauses animation once button selected. button , function works fine. added function determines if user has exited application. in function, added pause button function. however, when user returns app after exiting, shows pause screen, animation completed. here code: @ibaction func pausebutton(sender: uibutton) { let button = self.view.viewwithtag(1) as? uibutton! let layer = button!.layer pauselayer(layer) // pausing animation view2.hidden = false // showing pause screen } func pauselayer(layer: calayer) { let pausedtime: cftimeinterval = layer.converttime(cacurrentmediatime(), fromlayer: nil) layer.speed = 0.0 layer.timeoffset = pausedtime } @ibaction func startbutton(sender: uibutton) { let button = uibutton() button.tag = 1 // can retrieve in pause function // code make button nice button.translatesautoresizingmaskintoconstraints = false // allow c

django - How do I display the number of object returned from a query -

i want display number of objects returned query search. have tried {{ p.count }} , {{ post.count }} here post_list.html. have read other posts use methods , not work me. know missing something. {% extends 'posts/base.html' %} {% block content %} <div class="col-sm-6 col-sm-offset-3"> <h1>{{ title }}</h1> <form method="get" action=" "> <input type="text" name="q" placeholder="search" value="{{ request.get.q }}"/> <input type="submit" value=" search"/> </form> <a href="{% url 'posts:create' %}">create</a> {% p in queryset %} <div class="row"> <div class="col-sm-12 "> <!-- col-sm-6 --> <div class="thumbnail"> {%

java - How to make Hibernate to use SequenceHiLoGenerator for JPA GenerationType.AUTO on Oracle? -

i have table id below, hibernate uses org.hibernate.id.sequencegenerator instead of sequencehilogenerator generationtype.auto, how can tell hibernate use sequencehilogenerator? @id @sequencegenerator(name="admin_seq", sequencename="unique_id") @generatedvalue(strategy=generationtype.auto, generator="admin_seq") private long id if use generationtype.sequence, hibernate use sequencehilogenerator, need use generationtype.auto compatibility mysql. i have tried using @genericgenerator, works oracle complained mysql: org.hibernate.dialect.mysqldialect not support sequences. @genericgenerator(name = "admin_seq", strategy = "org.hibernate.id.sequencehilogenerator", parameters = { @parameter(name = "sequence", value = "unique_id"), @parameter(name = "max_lo", value = "50") }) @generatedvalue(strategy=generationtype.auto, generator="admin_seq") p

node.js - How to pass options to dependent package installs for npm? -

my node.js project has dependency on node-sqlite , unfortunately default libsqlite binary embedded there not built options need. now can invoke npm install on package alone build correctly: cflags=-dsqlite_enable_stat4 npm install sqlite3 --build-from-source essentially, sets environment variable , passes option tool. however, npm install should install all project dependencies, including sqlite. how encode package.json or elsewhere npm install install sqlite dependency above command line? you use preinstall or postinstall script this. #!/bin/bash cflags=-dsqlite_enable_stat4 npm install sqlite3 --build-from-source; put in scripts/install_sqlite3_from_source.sh , , set scripts.preinstall or scripts.postinstall in package.json it.

html - How to put Carousel in center -

screenshot of carousel hi guys, im working html , right added carousel item html project, question how can display carousel in middle of page since appears @ left side. edit: heres carrousel code <div class="box-body"> <div id="carousel-example-generic" class="carousel slide" data-ride="carousel"> <ol class="carousel-indicators"> <li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li> <li data-target="#carousel-example-generic" data-slide-to="1" class=""></li> <li data-target="#carousel-example-generic" data-slide-to="2" class=""></li> </ol> <div class="carousel-inner"> <div class="item"> <img src=&quo

scala - Why does this Slick test inconsistently fail? -

i coding simple getting started ( http://slick.typesafe.com/doc/3.1.1/gettingstarted.html ) examples slick 3.1.1 documentation. i wrote following test assert on count of coffees: @test def countcoffees() = { // read coffees , print them console val rf = db.run(coffees.result) // equivalent sql code: // select cof_name, sup_id, price, sales, total coffees val r = await.result(rf, duration.inf) assert(r.size == 5) } some times test pass , other times result following: [info] - countcoffees *** failed *** [info] org.scalatest.junit.junittestfailederror: vector() had size 0 instead of expected size 5 (test.scala:40) the testsuite defined follows: class slickscalaejemplo extends funsuite schemaejemplo being schemaejemplo follows trait schemaejemplo extends funsuite slickbase beforeandafter { val setup = dbio.seq( // create tables, including primary , foreign keys (suppliers.schema ++ coffees.schema).create, // insert suppli

css3 - What are some examples of image effects (css) -

i wondering image effects can done via css, such glint minecraft. there way this, or similar, effects? try script in css: http://una.im/cssgram/ you can replicate instagram's filter class!

javascript - Insert Data using ajax on codeigniter -

i trying insert data using ajax in codeigniter app every time click submit button whole page reloads , nothing happens. form submit button not working in case. when have tried same code without ajax can submit data database using action on form. my view : <script type="text/javascript"> /*submit form via ajax*/ $("#creategrade").on('click', function (e) { e.preventdefault(); $.ajax({ url: '<?php echo base_url();?>index.php?admin/exam_grade/create', data: { grade_title: $("#grade_title").val(), grade_point: $("#grade_point").val(), mark_from: $("#mark_from").val(), mark_upto: $("#mark_upto").val(), comment: $("#comment").val() }, async: 'true', cache: 'false', type: 'post', success: function (data) { //jquery("#attendence_report_holder").html(response);

php - How to get the key value from an array if given string value as a variable in Codeigniter -

i not sure if make sense in asking have model: function update_profile_image($id, $image, $data){ $data1=array('profile_thumb'=> $data['images_urls'][$index]); $this->db->where('property_ref_id',$id); $this->db->update('vbc_property_images',$data1); } here $data array: array ( [images_urls] => array ( [0] => property_image_11.png [1] => property_image_13.png [2] => property_image_14.png ) ) and $image in model name of image in array, e.g. 'property_image_13.png'. i trying can key value $index([0], [1]..) $image in query automatically detect image selected. please help. you can loop on array key of image foreach($data['images_urls'] $key => $value) { if($value == $image) { $index = $key; break; } } alternative solution use array_search() $index = array_search($image, $data['images_urls']);

Asynchronously load Image in Enyo -

i have enyo.list 2 items: enyo.image , text component. setsrc on image during onsetupitem. this loads image , since have on 10 rows don't appear till images load. there anyway load these images asynchronously (additionally display image "fade-in" animation ?). thanks. edit: totally wrote next paragraph backwards. list -is- flyweight version. correct set number of rows. what may want replace list repeater . because of flyweight pattern in repeater might not requesting many images @ once. another approach might derive new kind based on scroller detects when images scroll view , load them @ time. pretty involved approach , might need create kind based of image works hand-in-hand other kind. you google lazy-loading strategies , see if can apply those.

Calling Haskell from C, getting "multiple definition of main" linker error -

i trying learn how interface haskell , c. start out, wrote inc.hs , simplest thing can conceive: {-# language foreignfunctioninterface #-} module inc import foreign import foreign.c.types inc :: int -> int inc = (+1) foreign export ccall cinc :: cint -> cint cinc :: cint -> cint cinc = fromintegral . inc . fromintegral and compiled produce inc_stub.h : ghc -c inc.hs worked fine. wrote c file, trying simple humanly possible: #include <stdio.h> #include "inc_stub.h" int main(int argc, char *argv[]) { int = 1; hs_init(&argc, &argv); = cinc(a); hs_exit(); if (a == 2) { puts("worked!"); } return 0; } tried compile it, got linker error: ghc -no-hs-main inc.c inc -o simplest linking simplest.exe ... inc.o:inc.c:(.text+0x0): multiple definition of `main' inc.o:inc.c:(.text+0x0): first defined here inc.o:inc.c:(.text+0x31): undefined reference `cinc' c:/program files/haskell platform

ruby - How do I precompile assets for a PhoneGap app deployed to Heroku using Guard and Rake? -

i deploy www/ of (phonegap) app heroku. prefer haml/sass/coffeescript created guardfile automatically generate html/css/js , copy src/ www/ . added www/ .gitignore . deploy heroku , have rake assets:precompile generate 'slug'/ www/ directory. added rakefile according guard example require 'guard' namespace :assets desc "precompile assets - build whole app" task :precompile guard.run_all end end however when try run locally, run_all fails. c:\users\chloe\workspace\typefunctions>bundle exec rake assets:precompile rake aborted! nomethoderror: undefined method `run_all' guard:module c:/users/chloe/workspace/typefunctions/rakefile:6:in `block (2 levels) in <top (required)>' tasks: top => assets:precompile (see full trace running task --trace) how can fix this? (or there better way?) i had add require 'guard/commander' ( wiki source ) and guard.setup despite the wiki explicitly saying #

javascript - jquery function not catching dynamically generated id -

i have table rows generated ajax query response like: var inp = '<input id="new_po_qty" style="text-align:center" type="text" value="1">'; $('<tr id="new_po_item_row">').html('<td style="text-align:center">' + sku_id + '</td><td style="text-align:center">' + inp + '</td><td id="new_po_cp" style="text-align:center">' + cost_price + '</td><td id="new_po_total_cp" style="text-align:center">' + cost_price + '</td>').appendto('#new_po_body'); now wrote jquery function catch changes on inp variable in table row. jquery function not catching changes in input box. jquery function: $('#new_po_qty').on('change paste', function(){ alert('changes made.'); $.niftynoty({ type:"primary",icon:"",t

STI with Ploymorphic association in rails -

i have model named slider class slider < activerecord::base end and homebannerslider has single table inheritance relation slider class homebannerslider < slider has_many :images, as: :imageable accepts_nested_attributes_for :images, reject_if: :all_blank, allow_destroy: true end and image model given class image < activerecord::base belongs_to :imageable, polymorphic: true has_attached_file :image end my problem whenever save homebannerslider following command @admin_home_banner_slider = homebannerslider.new(admin_home_banner_slider_params) @admin_home_banner_slider.save it saves imageable_type in image model slider @admin_home_banner_slider.images <image:0x007f5e6ef7af20 id: nil, imageable_id: nil, imageable_type: "slider", title: "2", description: "2", link_button: nil, link_button_title: nil, owner: nil, publish: nil, priority: nil, created_at: nil, updated_at:

regex - Pattern matching dates -

i'm having troubles trying match pattern of dates. of following dates legal: - 121212 - 4 9 12 - 5-3-2000 - 62502 - 3/3/11 - 09-08-2001 - 8 6 07 - 12 10 2004 - 4-16-08 - 3/7/2005 what makes date matching challenging year doesn't have 4 digits (a 2 digit year assumed in 21st century i.e. 02 = 2002), month/date can either written beginning 0 if 1 digit month, , dates may or may not separated spaces, dashes, or slashes. this have: /((((0[13578])|([13578])|(1[02]))[\/-]?\s*(([1-9])|(0[1-9])|([12][0-9])|(3[01])))|(((0[469])|([469])|(11))[\/-]?\s*(([1-9])|(0[1-9])|([12][0-9])|(30)))|((2|02)[\/](([1-9])|(0[1-9])|([12][0-9])))[\/-]?\s*(20[0-9]{2})|([0-9]{2}))/g this works, except right i'm not sure if i'm assuming length of dates , months. example, in case 121212 , might assuming month 1 instead of 12 . also, reason when i'm printing out $1 , $2 , same value. in case of 121212 , $1 1212 , $2 1212 , $3 12 . however, want $1 121212 . y

Android Studio, Capture FrameLayout View, While Camera is StopPreview() -

this cameraview.java (i got http://blog.rhesoft.com/ ) public class cameraview extends surfaceview implements surfaceholder.callback{ private surfaceholder mholder; private camera mcamera; public cameraview(context context, camera camera){ super(context); mcamera = camera; mcamera.setdisplayorientation(90); mholder = getholder(); mholder.addcallback(this); mholder.settype(surfaceholder.surface_type_normal); } @override public void surfacecreated(surfaceholder surfaceholder) { try{ mcamera.setpreviewdisplay(surfaceholder); mcamera.startpreview(); } catch (ioexception e) { log.d("error", "camera error on surfacecreated " + e.getmessage()); } } @override public void surfacechanged(surfaceholder surfaceholder, int i, int i2, int i3) { if(mholder.getsurface() == null) return; try{ mcamera.stoppreview(); } catch (exception e){ } try{ mcamera.setpreviewdisp

php - How to replace json with the one from the master branch -

i'm not programmer , don't know coding. i use opencart 2.1.0.1. cannot access "customer/customer", "customer/customer groups", "customer/custom fields" page said "you not have permission access page, please refer system administrator". i'm administrator. all access permission has been selected settings didn't see customer/customer, customer/customer groups , customer/custom fields permission listings. so daniel kerr suggest me replace json 1 master branch. i replace system/helper/json.php code link [branch master json.php][1] i edited json.php using putty. but still cannot access customer page. please guide me how replace json master branch. to code branch have 2 options. 1 check out 1 file. got checkout master -- /path/to/file.json the other use git show git show master:path/to/file.json > path/to/file.json the first option preferred 1

php - Auth::guest() returns true for both logged in and logged out users -

i new laravel , trying create small project learning purpose. have used inbuilt auth login , register. these automatically generated pages work well, in created route resource posts using controller called postcontroller. now in postcontroller check if user authorized return view: posts else login page. check following if (!auth::guest()) return view('posts'); else return "......"; now here auth::guest() returns true both logged in , logged out users. are sure logged in? try dump auth::user() data with dd(auth::user()); and way, if returning in if statement not need use else.

html - How do I replace one character with another but ONLY in href? -

i have hundreds of links in below format: a href="../lorem_ipsum__" title="dolor_sit amet" target="__blank" i need change _ (underscore) character - (hyphen), in href ( title , target need remain unchanged). i tried dreamweaver's 'find , replace', didn't succeed. tick "use regular expression" in find , replace, search for: (href="[^_"]*)_+([^"]*) and replace with: $1-$2 the first parenthesis group searches starts href=" , characters except _ or " . then have _ 1 or more times. the second parenthesis group searches , stops before closing " you can use groups $1 , $2 in replace. here's interactive tutorial if want learn regular expressions (regex): http://regexone.com/

javascript - Implementing function overloading -

since javascript not support function overloading typescript not support it. valid interface declaration: // function overloading in interface interface ifoo{ test(x:string); test(x:number); } var x:ifoo; x.test(1); x.test("asdf"); but how can implement interface. typescript not allow code: // function overloading in interface interface ifoo{ test(x:string); test(x:number); } class foo implements ifoo{ test(x:string){ } test(x:number){ } } try it function overloading in typescript done this: class foo implements ifoo { test(x: string); test(x: number); test(x: any) { if (typeof x === "string") { //string code } else { //number code } } }

python - Difficulty in creating program for admission in schools -

i had made project program functions easy way apply admission in school. far, went kinda okay not getting proper output. what should getting when student name entered admission class(i.e, t2/t1) should checked if there available seats , suitably either enter student or not. when search student student name id number must displayed. when delete student, must class list well. please material posted below , me. def search(t2): t2=(('xxx',1),('yyy',2),('zzz',3)) s=input('enter student id=') in range(len(t2)): ch in t2: if ch==s: print'student =>',t2[i],'of id number',t2[i+1] break else: print'invalid entry, try again' def details(t1): n=raw_input('enter applicant name=') t2=(('xxx',1),('yyy',2),('zzz',3)) in range(len(t1)): if len(t1)<5: t2=t2+(n,i) break

recursion - CakePhp join models together -

cakephp 2.7 mssql database i have 2 main tables in database , relation belongs-to. recursion index action set 1, on both tables. table2 belongs table1 . i need load table1 belongs-to relation , need table2 belongs-to relation on index of table1 , recursion value 1. if set recursion 2, goes deep. i tried has-one, belongs-to, recursion012. resolved.. added find method in index. , set/send var index.ctp. tnx you can use containable behavior instead of recursive option data desired table. more info see http://book.cakephp.org/2.0/en/core-libraries/behaviors/containable.html

Android NDK: Including boost c++ library -

i trying use boost library inside android application, using ndk. have found couple of success stories here , here , can't same me. trying use library in this link , boost thread library. in code below, trying include thread library, not math library. process used build boost libraries pretty same first link attached. so far, seems have built boost libraries, when run ndk-build , following error: prebuilt : libboost_thread.a <= <ndk>/sources/ cp: omitting directory `path/to/ndk/sources/boost' make: *** [obj/local/armeabi/libboost_thread.a] error 1 obviously cp: omitting directory... not error. thing i'm getting other next line, doesn't mean anything. error 1 here's android.mk file: local_path := $(call my-dir) include $(clear_vars) local_static_libraries := boost_thread local_ldlibs := lboost_system-gcc-md lboost_thread-gcc-md -lgnustl_static local_ldlibs += lboost_system-gcc-md lboost_thread-gcc-md \ -l$(ndk_root)/sources/cxx

graphite - Howto handle Whisper's pre-allocation in a cloud environment? -

i'm setting metrics infrastructure , powerful graphite api. however, whisper, storage backend, not work due it's disk pre-allocation feature. run cloud-based architecture our apps change host/ip lot, , since want host part of each metric whisper db grows quickly. how should setup graphite/whisper handle situation? i've tried find alternatives whisper, nothing stands out. there lot of discussions , half-done solutions other storage engines, nothing seems mature , provides solid graphite integration. turns can't done whisper. ended using cyanite replacement carbon/whisper, while still keeping graphite (graphite-api actually..).

android - Opening activity in landscape mode without locking the orientation -

i want open activity in landscape orientation don't want lock orientation.that means user can switch orientation on rotating.i tried adding below code activity.it opens activity in landscape mode locked. setrequestedorientation(activityinfo.screen_orientation_landscape); setrequestedorientation(activityinfo.screen_orientation_sensor); by adding android:configchanges="orientation|keyboardhidden" on activity , can handle when orientation change . @override public void onconfigurationchanged(configuration newconfig) { super.onconfigurationchanged(newconfig); if (newconfig.orientation == configuration.orientation_portrait) { //change orientation here } else if (newconfig.orientation ==configuration.orientation_landscape{ //change orientation here } }

Which technology to use to set the alarm at Swift for iOS -

Image
i alarm clock app. view: what working: i make single tap on "6:00", call function addalarm ("6:00", "unstable") . button "6:00" highlighted in green. time stored in data model of application, button time highlight after closing , reopening application. button "8:00" red, because make double tap on it, call function addalarm ("6:00", "stable") . information recorded in data model. what want: the green color of button "6:00" means alarm should triggered once @ 6 am, , has deactivated: button again become blue. have function removealarm(time) red button "8:00" means alarm should triggered each day @ 8 am, after button should red. under «alarm should triggered», mean following. on screen of device should notice text «wake up», , begins play tune. file tune has 20 seconds duration, want play tune 3 minutes, repeating 20 second file tune. alarm should triggered when application

android - Kivy gesture is registered on button -

i try make android app using kivy. swiping left , right use screenmanager , gestures instead of carousel. approach derives here , tried make swiping possible in both directions. while swiping works, however, when pressing button registered gesture shouldn't. means, of time when pressing butten event behind 1 of gestures triggered. i can somehow reduce probability happens increasing minscore value, not reliable , makes gestures less sensitive. is there way avoid happening? e.g. limiting gesture recognition screenmanager only? i have attached example of app. many thanks! main.py from kivy.app import app kivy.uix.boxlayout import boxlayout kivy.utils import platform kivy.uix.screenmanager import notransition import gesture_box gesture import time import datetime class storage: memory = 0 class demo(gesture.gesturebox): def init(self): today = time.localtime().tm_wday # 0 monday l = ['one', 'two', 'three', 'fou

c# - How to insert data into SQL Server? -

i have code this: con.open(); cmd = new sqlcommand("insert penawaran (id_paket,jenis_paket,harga_paket) values (@id_paket,@jenis_paket,@harga_paket", con); cmd.parameters.addwithvalue("@id_paket", txtidpaket.text); cmd.parameters.addwithvalue("@jenis_paket", txtjenispaket.text); cmd.parameters.addwithvalue("@harga_paket", txthargapaket.value); // int sir how insert it, still error write cmd.executenonquery(); con.close(); please me inside int table paket . there missing parenthesis @ end of insert query insert penawaran (id_paket,jenis_paket,harga_paket) values (@id_paket,@jenis_paket,@harga_paket) --here

Android ACTION_IMAGE_CAPTURE auto focus on take picture -

we using camera api our custom camera application. however, turned out hard problem. many devices required testing seemed perform unexpected behaviors. so, have decided migrate android's camera intent. however, dealing image retrieval tasks so, don't want our users send blurry pictures. previously, using autofocus user taps on take picture button. android camera intent performs worse ours because not try autofocus before taking picture. android's camera have such option don't want leave decision our users because, not select option. is possible launch camera intent option auto focusses before taking picture? thank you! is possible launch camera intent option auto focusses before taking picture? no. decision of whether or not use auto-focus, or flash, or other camera feature, between user , developers of camera app. not vote.

java - Getting single NonNull value usgin Spring Data -

i'd have method in repository returns single value. this: trainingmode findbytrainingnameandnameeng( string trainingname, string nameeng ); http://docs.spring.io/spring-data/data-jpa/docs/current/reference/html/ spring data docs describe in case method can return null if no entity found. i'd throw exception generic message no trainingmode found %trainingname% , %nameeng% or smth that. i can use optional<trainingmode> return value , use orelsethrow optional<trainingmode> findbytrainingnameandnameeng( string trainingname, string nameeng ); repository.findbytrainingnameandnameeng(name, nameeng).orelsethrow(() -> new runtimeexception(...)); but should call method each time when method called. it's not clear - dry priciple broken. how nonnull single value orelsethrow using spring data? the dry principle violated if duplicate null handling throughout application logic being invoked. if dry principle thing worried can think of: you ca

angularjs - Passing data to angular function on changing html slider input -

i want pass value on changing html slider input in angularjs. <input type="range" value="30" min="0" max="0" id="set-value" /> angular function: $scope.passvaluehere = function(value) { //todo here } i don't want use plugins or whatever. simple answer. thanks. :) 1st thing need use ng-model directive value, available in controller $scope & place ng-change event on input element. markup <input type="range" value="30" min="0" max="0" id="set-value" ng-model="slidermodel" ng-change="passvaluehere(slidermodel)"/>

javascript - CSV node.js, from file to array -

i've been trying ages no avail (some returning 'null'). i'm trying csv (which contain on 2.2 million elements): rough,lukk,black,semnas,mickayrex to read javascript array. currently, have fixed array var usernames = ['mickayrex', 'black']; and goal able put names text file array format above use rest of program. here function book "javascript functional programming" parse csv array (i have modified avoid use underscore): function parsecsv(str) { var rows = str.split('\n'); return rows.reduce(function(table, row) { var cols = row.split(','); table.push(cols.map(function(c) { return c.trim(); })); return table; }, []); } var frameworks = 'framework, language, age\n ' + 'rails, ruby, 10\n' + 'node.js, javascript, 5\n' + 'phoenix, elixir, 1'; var array = parsecsv(fram

ios - APDU response read Binary to Objective-C String -

unsigned char get_cplc_command2[] = {0x00, 0xa4, 0x00, 0x00, 0x02, 0x02, 0x03}; receive_length = sizeof(receive_buffer); ret = scardtransmit(card, &sendpci, get_cplc_command2, sizeof(get_cplc_command2), null, receive_buffer, &receive_length); log(@"scardtransmit 0x%08x", ret); if (ret == scard_w_removed_card) { goto retry; } else if (ret != scard_s_success) { [err_text setstring:@"scardtransmit failed on cplc (w/ le > 0)"]; goto cleanup; } // response unsigned char get_cplc_command3[] = {0x00, 0xc0, 0x00, 0x00, 0x12}; receive_length = sizeof(receive_buffer); ret = scardtransmit(card, &sendpci, get_cplc_command3, sizeof(get_cplc_command3), null, receive_buffer, &receive_length); log(@"

java - How to determine color shades on the basis of double value? -

i have arraylist double values, these values write out table. color (one color - e.g. green or red) each row on basis of double value, higher value have darker shades , vice versa. maybe can change lightness - correct method? you can make function creates color based on double value. this: color getcolor(double val, double min, double max) { int red = 100; int green = 100; int blue = val/(max-min) * 256; return new color (red, green, blue); } you can change base color moving blue computation other color. or make different equation altogether. idea remains same.

AngularJS not working in Cloud9 Rails app per tutorial -

Image
i'm doing tutorial called "zero deployment in less 10,000 words" learn incorporating angularjs ror app. tutorial: http://angular-rails.com/index.html here: http://angular-rails.com/bootstrap.html the tutorial designed mac os x, i'm using cloud9 having trouble bridging gap. after going through steps setup "tiniest angular app ever", rails app works, angular not. what i've done far: created new rails app in cloud9 setup gemfile +gem 'sass', '3.4.19' +gem 'bower-rails' +group :test, :development + gem 'rspec-rails', '~> 2.0' + gem 'factory_girl_rails', '~> 4.0' + gem 'capybara' + gem 'database_cleaner' + gem 'selenium-webdriver' +end -gem 'turbolinks' bundle install vim config/database.yml rake db:create npm install bower -g /home/ubuntu/.nvm/versions/node/v4.1.1/bin/bower -> /home/ubuntu/.nvm/versions/node/v4.1.1

sublimetext2 - how to make snippets and syntax hightlighting work with preprocessors? like .js.haml or .js.erb -

if have .js or .haml or .erb file, snippets work great. but if create .js.haml or that. don't javascript syntax highlighting or snippets. any way fix this? you can go view > syntax > open current extension as... > javascript > javascript .

Webpack: Using Component specific css render different in html? -

Image
by following tutorial, https://github.com/christianalfoni/react-webpack-cookbook/wiki/loading-css#component-specific i tried implementing logic, how implemented. this how rendered on web, as can see problem, css not applied navbar class, because classname rendered ".app-components-navbar-navbar-navbar-wrapper". classname should "navbar-wrapper" how resolve this? is how supposed work? how can achieve component specific css? inside loader css , try changing value localidentname [path][name]-[local] [local] . ident name means create css class name in following format. " .app-components-navbar-navbar-navbar-wrapper " means app/component/navbar place defined , navbar name of file. local signifies name of class in css . hope helps

javascript - Passing table as hidden value in html form - weird single/double quote issue -

i have php function outputs form button (with post) download pdf of table on previous page. reason, weird results if try use double quotes, single quotes in string declaration work ok (except when try feed butter js innerhtml). this works: $form = '<form action="../php/pdf_and_die.php" method="post" target="_blank">'; $form .= '<input type="hidden" name="table" value="'.$table.'">'; // more lines here $form .= '<input type="hidden" name="page" value="portrait">'; $form .= '<input type="submit" value=" '.$button_name.' " class="button"></form>'; but doesn't: $form = "<form action='../php/pdf_and_die.php' method='post' target='_blank'>"; $form .= "<input type='hidden' name='table' value='{$table}'&g

java - Android - Service does not start -

i making app me , class mates, checks new homeworks , exams. has service may not killed beacuse of checking school server (like every 5 minutes) changed size of file list of exams , stuff this. tried following code: mayinactivity.java package com.test.simpleservice; import android.app.activitymanager; import android.support.v7.app.appcompatactivity; import android.os.bundle; import android.view.view; import android.widget.button; import java.util.list; public class mainactivity extends appcompatactivity { @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); //checking runings services - remove later activitymanager = (activitymanager)this.getsystemservice(activity_service); list<activitymanager.runningserviceinfo> rs = am.getrunningservices(50); string message = null; (int i=0; i<rs.size(); i++) { activitymanager.runningserviceinfo