Posts

Showing posts from March, 2011

ios - How to get access to beta device logs using Apple's TestFlight -

in old testflightapp, there sdk allowed developers log info on device , access logs testflight website. after apple takeover of testflight, i'm not seeing option through itunes connect. does know of way using apple's new version of testflight? or have recommendations simple approach viewing device logs during beta testing? if can beta testers send log files manually, have few options. used able use iphone configuration utility view device log files, no longer works of ios8. os x tool view device logs other xcode i've been able find ios console lemon jar labs ( http://lemonjar.com/iosconsole/ ). it's nice tool , prefer xcode console log - love filtering ability. i've seen reference itools ( http://www.itools.cn/ ) works under windows being able access device log files, have no personal experience it.

c# - Modify image programmatically using Caliburn.Micro -

i want apply effect/filter image displayed in view, in memory (without saving image file). i using caliburn.micro mvvm framework. i have view: <usercontrol x:class="testapplication.views.mainview" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" mc:ignorable="d" d:designheight="300" d:designwidth="300"> <grid> <grid.columndefinitions> <columndefinition width="*" /> <columndefinition width="0.3*" /> </grid.columndefinitions> <image grid.column="0" stretch="unif

ajax - Conflict Bootstrap, Prototype Js and Jquery -

after 7 days of search , after have tried different solutions , did not work ask: have page prototype js, protaplasm, , scriptaculous , jquery , jquery-ui , working jquery no conflict until downloaded design bootstrap , here comes trouble. prototype js fonctionalities no more working. ajax update of prototype js , inplaceeditor scriptaculous no more working. have tried work around did not result. have working solution ? i have found answer. avoid conflict between jquery, prototype js, protoplasm, twitter bootstrap fist added jquery noconlict after jquery <script type="text/javascript"> $.noconflict(); </script> and put every jquery code between jquery( document ).ready(function( $ ) { // code uses jquery's $ can follow here. /////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////// }); and importantly opened every other js

Support of HAVING for Sphinx running in Heroku -

i have following query: search(params[:query], with: { tag_id: params[:filter].values.flatten }, group_by: :technology_id, having: "count(*)=#{params[:filter].size}" ) this working locally, when deploy heroku throws: actionview::template::error (sphinxql: syntax error, unexpected ident, expecting $end near 'having count(*)=1 limit 0, 20; show meta' - select *, groupby() sphinx_internal_group, id sphinx_document_id, count(distinct sphinx_document_id) sphinx_internal_count `technology_core` match('cancer') , `tag_id` in (1) , `sphinx_deleted` = 0 group `technology_id` having count(*)=1 limit 0, 20; show meta): the sphinx version specified follows: # config/thinking_sphinx.yml test: mysql41: 9307 production: version: '2.2.6' anyone knows else be? at point in time, latest sphinx version available on flying sphinx servers 2.2.3 - can change version in thinking_sphinx.yml , deploy , run rebuild/regenerate, , s

c++ - Reusing variables declared on Try-Catch -

i using try-catch block one: try { texture heightmaptexture = texture("snow0101_7_m.jpg"); } catch (textureloadexception exc) { std::cout << exc.what() << std::endl; } the thing need reuse variable heightmaptexture further in program. realized can't because of scope. should put rest of program inside scope? me doesn't make sense. i can't declare variable outside of scope because have initialize it. has constructor receives string input. what best solution? i realize use pointer, trying avoid (i not @ preventing memory leaks). edit: sorry, declaring variable class heightmap, wrong!, texture object. problem same. you'd want logic inside 1 try/catch context. presumably if loading of texture fails, after fail also? in case might able express logic more neatly as: try { heightmap heightmaptexture = texture("snow0101_7_m.jpg"); // work here // if fails fatally, throw // need store height

python - Where does app get assigned? I keep getting BadArgumentError: app must not be empty -

i'm attempting build simple google app engine app using tdd. $ python functional_tests.py warning:root:initial generator _run_to_list(query.py:952) raised badargumenterror(app must not empty.) warning:root:suspended generator _get_async(query.py:1231) raised badargumenterror(app must not empty.) traceback (most recent call last): file "functional_tests.py", line 23, in <module> main import customer file "/users/bryan/work/googleappengine/dermalfillersecrets/main.py", line 39, in <module> if not ( client.query( client.name == "bryan wheelock").get()): file "/usr/local/google_appengine/google/appengine/ext/ndb/query.py", line 1218, in return self.get_async(**q_options).get_result() file "/usr/local/google_appengine/google/appengine/ext/ndb/tasklets.py", line 325, in get_result self.check_success() file "/usr/local/google_appengine/google/appengine/ext/ndb/taskle

syntax highlighting - Vim: customize tex equation highlight -

Image
how force vim highlight following environment: \begin{dmath*} 2 + 2 \end{dmath*} the same way \begin{equation*} 2 + 2 \end{equation*} ? i.e want dmath environments (in plain , starred versions) highlighted same ways equation (plain , starred) environment. i pasted question vim, :setf tex , , used syntaxattr.vim - show syntax highlighting attributes of character under cursor plugin find out corresponding syntax group name texmathzonees . then opened $vimruntime/syntax/tex.vim , searched it. didn't find directly, this: call texnewmathzone("e","equation",1) then looked :help ft-tex-syntax (completed command-line via <c-d> ), , found under :help tex-math nice documentation. that, created following solution: call texnewmathzone("m","dmath",1) you can put ~/.vim/after/syntax/tex.vim , suggested, make permanent. easy, isn't it?!

c# - Change image of a button that is on an element of a LongListSelector -

i have longlistselector: <phone:longlistselector x:name="listamensajestablon" itemssource="{binding mensajes}" itemtemplate="{staticresource mensajestablondatatemplate}" selectionchanged="mensajetablonselected"/> with itemtemplate: <datatemplate x:key="mensajestablondatatemplate"> <grid> <button maxheight="85" maxwidth="95" minheight="85" minwidth="95" grid.column="1" horizontalalignment="right" verticalalignment="center" click="button_click" borderbrush="transparent"> <button.content> <image x:name="imagenfav" maxheight="75" maxwidth="75" minheight="75" minwidth="75"

linked list - In C why does my clearList function not work -

i'm trying clear list. keep getting error says free() called on unallocated pointer current. i'm not sure problem have seen multiple sites use code. this whole program upon request: suppose fill in these 3 functions. #include "orderedlist.h" node *orderedinsert(node *p, int newval) /* allocates new node data value newval , inserts ordered list first node pointer p in such way data values in modified list in nondecreasing order list traversed. */ { node * q = null; q = (node*)malloc(sizeof(node)); q->data = newval; q->next = null; if (q == null) { return q; } if (p == null || newval <= p->data ) { q->next = p->next; return q; } node *tmp, *last; tmp = (node*)malloc(sizeof(node)); tmp = p; while (tmp->next != null && tmp->data <= newval) { last = tmp; tmp = tmp->next; } q->next = tmp; last->next = q; return p; } void printlist(file *outfile, node *p) /* prints data values in lis

settimeout - JavaScript function and UI updates -

i have following function slides relatively positioned element 1000px off of now. for (var = 0; < 1000; i++) { $('.my-element').css( 'left', parseint($('.my-element').css('left'), 10) + 1 ); } this not produces sliding effect. rather, end of execution, element moves abruptly 1000px right. now, if wrap ui updates in settimeout below: for (var = 0; < 1000; i++) { settimeout(function () { $('.my-element').css( 'left', parseint($('.my-element').css('left'), 10) + 1 ); }, 0); } this produces visual effect of element sliding 1000px right. now, according understaning , thread, why settimeout(fn, 0) useful? , ui updates queued in browser event queue in same way async callbacks queued settimeout callback. so, in case first, basically, queue of 1000 ui updates made when loop executed. and in case second, first, queue of 1000 settimeout

python - Urls in Django 1.7 when the Url Contains spaces -

i have app user can create events. once event created there link event supposed go event details page. the href looks this: <a href="/events/view/{{event.event_name}}">event details </a> so sample url looks this: http://www.example.com/events/view/food%20drive%20la the %20 giving me problem, can't render urls spaces. think regular expression incorrect in events urls.py: url(r'^view/(?p<event_name>[\w%20+])$', views.event_details, name='event_details'), here views.py: def event_details(request, event_name): event_name = event_name #... return render_to_response('events/event_details.html') what issue here? don't worry space percent-encoding in url, on django url configuration level continue thinking usual space: ^view/(?p<event_name>[\w\s]+)$ also see: django url pattern %20

Rails 4 chaining scope -

i reuse scope defined, returns array. scope :currents, -> { (where('started_at < now()') | where('started_at' => nil)) & where('ended_at > now()') & where('published_at < now()') } def self.findnextauctions() currents.order(ended_at: :asc).limit(3) end when call function findnextauctions error: 1) error: auctiontest#test_should_fint_next_auctions: nomethoderror: undefined method `order' #<array:0x007fae5d6e3878> app/models/auction.rb:13:in `findnextauctions' test/models/auction_test.rb:14:in `block in <class:auctiontest>' rails doesn't have or statement. can write sql directly though like where("(started_at < now() or started_at = null) , ended_at > now() , published_at < now()")

linux - Execute sudo using expect inside ssh from bash -

i want create script automates installation on multiple linux hosts. login hosts using ssh keys , inside login want sudo, trying use expect, have on stations i don't have on server runs script. how do this, try, no luck it: #!/bin/bash ssh user@station04 <<eof expect -d -c " send \"sudo ls\" expect { \"password:\" { send '1234'; exp_continue } \"$user@\"{ send "exit\r" } default {exit 1} }" eof exit the result: send: sending "sudo ls" { exp0 } expect: "" (spawn_id exp0) match glob pattern "password:"? no expect: read eof expect: set expect_out(spawn_id) "exp0" expect: set expect_out(buffer) "" argv[0] = expect argv[1] = -d argv[2] = -c argv[3] = send "sudo ls\r" expect { "password:" { send '1234'; exp_continue } "@"{ send exitr } default {ex

html - Adding an image to header adds overlaying text -

Image
i added single drop down menu basic css. header looked perfect prior adding code, once add alignment thrown off completely. before: after: here's before code (without drop down menu) written slim ruby on rails: #header .wrapper .login_sec .col href="" =image_tag "login_icon1.png" span 'welcome, = logged_in_user.username =image_tag "profile_link_img.png", class: 'img' .col.col2 href="/conversations" =image_tag "login_icon2.png" span messages / =image_tag "login_icon4.png", class: 'img4' span class="messbg_icon" =unread_messages(current_user) / =unread_messages(current_user) .col.col3 href="/logout" =image_tag "login_icon3.png", class: 'img3'

sql - Average difference between two datetime columns -

i want find average time each customer spent on form. the table looks this: customerid | intime | outtime gives average duration in seconds - group id , use aggregate avg function create table #test ( customerid int, intime datetime, outtime datetime ) insert #test values (1,'20140101 10:00','20140101 12:00'), (1,'20140102 10:00','20140102 12:00'), (2,'20140101 10:00','20140101 20:00'), (3,'20140103 10:00','20140103 11:00') select customerid, avg(datediff(ss,intime,outtime)) #test group customerid drop table #test

wpf - How to write half-space in c# -

how can write half-space character in c# in textbox (not console.writleline statement) ? there specific char code it? unicode thinspace u+2009 ordinary character, try: textbox.text += '\u2009';

Buffered Reader is not reading my whole file java -

bufferedreader reader = new bufferedreader(new filereader("c:\\users\\normenyu\\desktop\\programming\\java\\eclipse\\book\\"+thebook+".txt")); string line = reader.readline();system.out.println(line); my file: (tab)you on hiking trip friend(also lives in rented apartment). find walking jungle. walk, find lonely. “help!”, heard. (enter)(tab)“what that,” ask friend. there no reply. wait... friend? start find way back, , find friend stuck in quicksand. do you: walk towards friend , try save him or stay away because might stuck in quicksand the program prints: on hiking trip friend(also lives in rented apartment). find walking jungle. walk, find lonely. “help!”, heard. help!! way, things in parentheses not written in notepad. using loop can read each line in file. bufferedreader reader = new bufferedreader(new filereader("c:\\users\\normenyu\\desktop\\programming\\java\\eclipse\\book\\"+thebook+".txt")); string lin

ruby, rails gem install error - ERROR: While executing gem ... (Encoding::UndefinedConversionError) -

i tried last version ruby, when run gem install rails, got error error: while executing gem ... (encoding::undefinedconversionerror) u+041d ibm437 in conversion utf-16le utf-8 ibm437 i using windows 8. but gem list ---local working.. on install, locale set english. what kind problem it? use link: https://bugs.ruby-lang.org/issues/10300 they said need chance enconding @ registry.rb file: folder: ruby2.1.0\lib\ruby\2.1.0\win32 file: registry.rb line: 70 - locale = encoding.find(encoding.locale_charmap) + locale = encoding::utf_8 + #locale = encoding.find(encoding.locale_charmap)

java - What is "Type mismatch" and how do I fix it? -

how fix error? type mismatch: cannot convert element type object block i see @ line: for (block b : blockstoskip){ here full code. @eventhandler(priority=eventpriority.normal, ignorecancelled=true) public void onentityexplode(entityexplodeevent ev){ arraylist blockstoskip = new arraylist(); location rootloc = ev.getlocation(); if (!skymagic.isinislandworld(rootloc)) return; (block b : ev.blocklist()){ location loc = b.getlocation(); islanddata data = skymagic.getislandat(loc); if ((data != null) && (data.owner != null)){ blockstoskip.add(b); } } (block b : blockstoskip){ ev.blocklist().remove(b); } } this raw type : arraylist blockstoskip java expects everything, not block type. therefore, need type cast . arraylist blockstoskip = new arraylist(); // rest of code (object b : blockstoskip){ ev.blocklist().remove( (block)b ); } note discouraged use raw types.

search - JBehave Eclipse Plugin do not react on Ctrl+F -

i'm using jbehave , companion plugin eclipse, fine, there makes me mad, not react when hit ctrl+f, expect open search dialog box. i crawled bit on internet except messages on mail archive ( https://www.mail-archive.com/user@jbehave.codehaus.org/msg02382.html ) stating same problem, did not found answer until then. i found way circumvent problem, , feel may of use other people here : i opened preferences > keys , copied "find , replace text". on copy, chose set "when" "jbehave story editor", , "binding" "ctrl+f"... , surprise ! showed me conflicted "format table" command in particular "when" context. curiously, mapping not shown when enter "ctrl+f" in filter text area... actually, whole "jbehave story editor" when context seems totally invisible in keys list. anyway, somehow fixed problem setting "ctrl+shift+f" duplicated "find , replace" when set

Add Virtual Directory to an Azure Website using Powershell -

is there way add virtual directory azure website using powershell? background: have single solution asp.net mvc application , web.api projects. publishing application root of azure website, , web.api virtual directory under it. this works long add virtual directory manually in azure portal. (project settings not propagate website settings reason). as looking automate deployment process add missing virtual directory using powershell script. looks valid (if complex) answer here: the short of is: gotta use azureresourcemanager , work microsoft.web/sites/config object , set virtual directories. https://social.msdn.microsoft.com/forums/azure/en-us/990f41fd-f8b6-43a0-b942-cef0308120b2/add-virtual-application-and-directory-to-an-azure-website-using-powershell?forum=windowsazurewebsitespreview

tags - How to conditionally run tests in cucumber -

having done bit of research on question, see it's been asked before. answer seems along lines of "if need conditionally skip test, you're doing wrong." i'm new cucumber , programming in general, i'm hoping has suggestion how around current dilemma. all new features developed our team put behind feature flag , turned on per environment when ready, ie, on in dev, on in test, on in integration, , on in staging , prod when think ready ship. i aware of tagging feature , think solution me except couple of things. one, there lots of features , flipped on , off in various environments often. unless i'm totally on top of things, i'm going miss whether or not need change specific feature tag. other issue i'm working in shared test codebase , our tagging system not setup per environment. although start lobbying change, not happen in short term and, given reason, i'm not sure i'd happy solution. what i'd ideally use feature flag , code al

php - Error with passing parameters -

this question has answer here: php: “notice: undefined variable”, “notice: undefined index”, , “notice: undefined offset” 22 answers when passing parameters login function in authenticate class these errors: notice: undefined index: user in c:\users\adam\phpstormprojects\website\login.php on line 11 notice: undefined index: pass in c:\users\adam\phpstormprojects\website\login.php on line 12 this function in authenticate class public function login($user,$pass){} and login.php params getting passed from. $authenticateuser = new authenticate(); $queryresult = $authenticateuser->login(($email),($password)); does understand why getting these errors? check html form has input fields make sure having correct tags names. <input type="text" name= "user" value=""/> <input type="text" name= "pas

ftp - PHP mkdir creates bad / corrupt directories? -

i have image uploader, directory should dynamic based on variable. works on it's own except creating directory. directory appears in winscp , php code echo's image has been uploaded there when trying directory error: error changing directory to'foobar'. can't change directory foobar: no such file or directory. below relevant code issue (i think). $target_dir = "../images/ " . $model_name . "/"; if (!file_exists("$target_dir")) { mkdir("$target_dir", 0777, true); } i should able log onto linux , rmdir -rf terminal rid of directory know causing , if there fix. thanks nick

angularjs - How can I watch a directive variables from a parent controller? -

i have controller called main has 2 nested directives called formdirective , datadirective. i have following form in formdirective view. <form name="menuform"> <h4>what name</h4> <input name="name" ng-value="" ng-model="name"> </form> i trying use $scope.watch update data in datadirective when form value changed in formdirective. when put following code inside formdirective controller works fine. $scope.$watch('[menuform.name.$viewvalue]', function () { console.log('name changed'); //update data directive here }, true); however won't work solution because need code inside parent controller directives need communicate each other , doing way cause encapsulation issues. when put following watcher inside main controller doesn't work - expect too. (i can browse fine web inspector). $scope.$watch('[$scope.menuform.name.$viewvalue]', function () { console

C++ error Expected primary expression before "'" token (using getline on an ifstream?) -

i getting many errors along lines of "error: expected primary-expression before ',' token" wherever using getline function in code. looked @ examples of people using getline on ifstreams, , thought maybe had put "std::" before calling function (not sure though?) didn't work either. here's first bit of code; i'm assuming whatever error i'm making same throughout. #include <stdio.h> #include <iostream> #include <fstream> #include <string> using namespace std; struct listnode{ string user; string salt; string encrypted; string password; listnode* next; }; int main(){ /* initializes singly linked list hold user data */ listnode *root; listnode *conductor; root = new listnode; conductor = root; string temp; //creates , opens filestream password file ifstream psswdfile ("example.txt"); if(psswdfile.is_op

android - Reading from text file, empty lines is skipped -

im writing app read text file located in assets folder. lets text file this. 1.hello 2. 3.world 4.again and using bufferedreader read line line (i want 3 first). bufferedreader reader = new bufferedreader( new inputstreamreader(result.getcontext().getassets().open("file.txt"))); string text; (int x=0;x<3; x++) { text += reader.readline(); } output becomes "helloworld". how like: hello world i though bufferedreader included empty lines textfile :s. i tried manually create line break wanted if statement inside loop, (int x=0;x<4; x++) { string s = reader.readline(); if(s.equals("")){ text+="\n"; }else { text += s; } from java documentation bufferedreader#readline() returns: a string containing contents of line, not including line-termination characters, or

Meteor - Conditionally return a group of event Handlers -

in meteor best way conditionally add set of event handlers? for example i'm trying code below (this code not work, idea of i'm trying achieve.) template.page_article.events( function(){ if (something){ return { some_event_name1, some_event_name2, } } else { return { some_event_name3, some_event_name4, } } }) what best way this? tried set variable outside events() not solution because variable gets shared amongst other templates. what you're trying achieve sounds bad solution me, here's way it: template.page_article.events((function(){ if (something){ return { '<event>': function(){ console.log("a1") }, '<event>': function(){ console.log("a2") } } } else { return { '<event>': function(){ console.log("b1") }, '<event>': function(){ console.log("b2") } } } })()) edi

Python, comparing identical strings return False -

i'm aware many questions of kind posted here, couldn't find 1 matches case. i have list made of dictionaries, each dictionary contains single key, , list value. example: keylist = [{'key1': [1,2,3]}, {'key2': [3, 4, 5]}, ...] now, want create simple function receives 2 arguments: aforementioned list, , key, , returns matching dictionary given list. the function is: def foo(somekey, somelist): in somelist: if str(i.keys()).lower() == str(somekey).lower(): return when called: foo('key1', keylist) , function returned none object (instead of {'key1': [1,2,3]} . the 2 compared values have the same length , of same type ( <type 'str'> ), yet comparison yields false value. thanks advance assistance or/and suggestions nature of problem. dict.keys() returns list in python 2 , view object in python 3, you're comparing string representation string passed here. instead of can use in opera

java - Array Class Returns Address -

i using java , trying getvehiclelist method print out contents vehicle[] vehiclelist. however, when call getvehiclelist, returns lvehicle;@61443d8f instead. i think memory address if correct. not sure if relevant, here example of should print out. thank you. jones, jo: car 2014 honda accord (alternative fuel) value: $22,000.00 use tax: $110.00 tax rate: 0.005 jones, sam: car 2014 honda accord value: $22,000.00 use tax: $220.00 tax rate: 0.01 here code returns memory address instead. public vehicle[] getvehiclelist() { vehicle[] result = new vehicle[vehiclelist.length]; (int = 0; < vehiclelist.length; i++) { result[i] = vehiclelist[i]; } return result; } this prints instead. lvehicle;@61443d8f here tostring() public string tostring() { string result = ""; (int = 0; < vehiclelist.length; i++) { result += vehiclelist[i] + "\n\n"; } return result; }

What does this symbol ** mean in the C language -

hi i'm new c language, can explains ** symbol mean. typedef struct _treenode { struct _treenode *left, *right; tchar key[key_size]; lptstr pdata; } treenode, *lptnode, **lpptnode; if x pointer, *x dereferences it. **x same *(*x) , **x dereferences pointer pointer. (eg, thing pointed thing x opints to).

django - Normal Buttons for ChoiceField -

software versions: using django 1.7 , python 3.4 i using django form handle user input validation , processing. in form, have choicefield want display using normal buttons instead of radio buttons or select input element. writing html myself template, rather using form passed context of template render html. here html field: <form method="get" action="."> <div id="div_id_session_type"> <div class="controls btn-group" role='group'> <input type="button" class='btn' name="session_type" id="id_session_type_1" value="individual"> <input type="button" class='btn' name="session_type" id="id_session_type_2" value="small group"> <input type="button" class='btn' name="session_type" id="id_session_type_3" value="class"

for loop - C program to print numbers between 100 and 1000 which sum of digit is 20 -

i writing c program should display me numbers between 100 , 1000 sum of digit 20. tried code down here, displays 0 ouput when compile it, can me? tried moving if(ivsota==20) outside of while loop. using orwell dev c++ ide. #include <stdio.h> int main (void) { int ivnos=0; int iostanek=0; int ivsota=1; int istevec1=100; for(istevec1=100; istevec1<1000; istevec1++) { while(istevec1>0) { iostanek=istevec1%100; istevec1=istevec1/10; ivsota=iostanek+ivsota; if(ivsota==20) { printf("%i\n", istevec1); } } } return(0); i hope better. this should work you: (changed variable names it's more readable) #include <stdio.h> int add_digits(int n) { static int sum = 0; if (n == 0) return 0; sum = n%10 + add_digits(n/10); return sum; } int main() { int start, end; start =

How to convert canvas to bitmap in android? -

i creating app in android user draw on canvas , save user directory i.e. sdcard. but problem bitmap save shows black image , mean image never saves drawn on canvas black image saves. here code import java.io.file; import java.io.filenotfoundexception; import java.io.fileoutputstream; import android.content.context; import android.graphics.bitmap; import android.graphics.bitmap.compressformat; import android.graphics.bitmap.config; import android.graphics.canvas; import android.graphics.color; import android.graphics.paint; import android.graphics.path; import android.os.environment; import android.view.motionevent; import android.view.view; import android.widget.toast; public class drawwrite extends view { float touchxd = 0, touchyd = 0, touchxu = 0, touchyu = 0, touchxm = 0, touchym = 0; // define touch co-ordinates float x1 = 0, y1 = 0, x2 = 0, y2 = 0; // define drawing path co-ordinates float stroke = 2; // define message structure width int i

ruby on rails - Move one controller's path under root namespace -

i copied following pages in welcome controller views/welcome/about.haml views/welcome/brand.haml views/welcome/brand_detail.haml views/welcome/contact.haml views/welcome/download.haml views/welcome/faq.haml views/welcome/news.haml views/welcome/news_detail.haml views/welcome/product.haml views/welcome/product_detail.haml now write route in way 'welcome/index' 'welcome/about' it seems repeat welcome many times , namespace not under root. if understand correctly, want following in config/routes.rb : get 'about', to: 'welcome#about' 'brand', to: 'welcome#brand' ... , on ... root 'welcome#index'

Android Studio: How to add line break in git commit message? -

Image
when inserting git commit message, how can add line break? writing message on new line doesn't have effect , 2 messages shown in 1 line on site (bitbucket). i know can achieve command line, here? we know markdown isn't supported in commit message on github , bitbucket , issue doesn't come git hosting services. maybe issue comes how android studio interpret commit message, markdown source: try , add 2 spaces @ end of first line, see if message end intermediate newline or not.

Populate existing excel template containing columns from a table in SQL Server using C# -

my c# project requires excel report generation. have existing excel template contains columns values populated sql server table , fields(e.g testcasepassed, testcasefailed etc.)in excel template populated values code. i.e. excel template format testcasepassed: testcasefailed: date: name designation salary teststatus i require c# code process. in advance. i new c# , don't have idea how proceed yes have using microsoft.interop. there has 100s of way of doing and, without being more specific, question may more opinion based anythign else. if had task (and assuming there reasonably small number of records) existing db i'd entity framework db first existing sql database get entries db write spreadsheet using epplus i therefore might end code this: list<entry> fromdb() { list<entry> res; using (var dbcontext = new myentities() { res = dbcontext.where(e=>meetsmyfiltercriteria(e)).tolist() }

java - Where is parallel gc is used? -

can answer me,please, parallel gc used? i reading article: http://blog.takipi.com/garbage-collectors-serial-vs-parallel-vs-cms-vs-the-g1-and-whats-new-in-java-8/ and there "the parallel collector best suited apps can tolerate application pauses , trying optimize lower cpu overhead caused collector". but exact examples can in case? thanks. almost applications can cope short pauses. rather asking applications can cope pause, should asking applications cannot cope pause. applications can't cope pause ones have directly interact real world , have in real time. machines , robots best example of this. instance, don't want abs on car paused garbage collection when slam on brakes in emergency. having said that, typical example of application can cope pause desktop application. fraction of second takes display menu or respond button click go unnoticed user.

php - Kohana 3.3 Auth module using not default ORM -

i'm using kohana 3.3 framework doctrine 2 orm, , have started working on authorisation. i read auth module, seems auth uses default kohana orm it's work. could'n find in source of auth code manipulating database using orm. me find it? if doesn't use orm, maybe can keep on using doctrine? the auth module not in use orm. it's orm module overrides auth class. makes sense because have auth enabled without orm module. ideally want in situation. should have kohana orm module disabled, doesn't interfere doctrine orm. use module integrate doctrine kohana. can build 1 or there available. e.g: https://github.com/ingenerator/kohana-doctrine2 https://github.com/stegeman/kohana-doctrine if reason want keep kohana orm enabled here's how can leverage auth functions. in orm module, it's kohana_auth_orm class extends auth module's auth class. if override auth_orm class in application or module folder, enable replace auth functions doctrine equ

objective c - how to change the textfield value when the button is clicked in uitableviewcell iOS -

Image
i'm developing shopping app, in i'm implementing shopping cart. in app, need increase product quantity when plus button clicked , reduce product quantity when minus button clicked. here problem is, when click plus button, text field value changing in tableviewcell. me,below plus button action method -(ibaction)plusbtn:(uibutton*)plus { [self.tbleview beginupdates]; uitableviewcell *clickedcell = (uitableviewcell *)[[plus superview] superview]; nsindexpath *clickedbuttonindexpath = [self.tbleview indexpathforcell:clickedcell]; plus.tag = clickedbuttonindexpath.row; quantity.tag = clickedbuttonindexpath.row; _curr =_curr+1; quantity.text = [nsstring stringwithformat:@"%d",_curr]; [self.tbleview endupdates]; [self.tbleview reloaddata]; } like getting.. can u check functionality. useful you. hope it. - (void)viewdidload { [super viewdidload]; quantity =[nsmutablearray new]; occu_list = [[nsar

c++ - No member named '' in ''. Why did it happen and how do I fix it? -

i have error when print printsount() in main. compiler said: no member named 'printsound' in 'animal') why happening , how can fix it? main #include <iostream> #include "animal.h" #include "pat.h" #include "not_pat.h" int main() { std::string lastname; std::string sound; std::string name; std::string type; double speed = 0; animal* animals[2]; (int = 0; < 2; i++) { std::string ani; std::cout << "enter animal: (dog,fish,lion,monkey ... ): " << std::endl; std::cin >> ani; if (ani == "dog" || ani == "cat" || ani == "fish") { animals[i] = new pat("test", "test", "test","test"); } else { animals[i] = new not_pat(speed, lastname, "test2", "test2"); } } (int = 0; &l

node.js - How do I delete a defined schema from Mongoose? -

i using node.js , mongoose interface mongodb. current implementation dynamically creates mongoose schemas during runtime. these schemas used create objects stored in respective collections in mongodb. @ point, delete function (express endpoint) might called deletes 1 or more of these collections , it's schema reference code (sets undefined). however, when go re-creating 1 of these schemas, mongoose complains old 1 exists! any ideas? try below make me understand if there same problam: mongoose.connection.collections['yourcollectionname'].drop( function(err) { console.log('collection dropped'); });

algorithm - Naive Bayesian for rating -

Image
suppose have training set has following data: type | size | price | rating | suggestion --------------------------------------------------- shirt m budget 0 bad trouser l budget 4.2 shirt m expensive 2.3 ....etc.... here taking suggestion class need suggest when input sample provided. means, when input sample(different training dataset) given, need figure out whether good or bad . am able understand probability calculation based on example found internet: dataset: calculation input sample: the doubt in dataset that, have column called rating . so, column also, probability calculation other columns(like in screenshot above)? or need consider other way 1 particular column's values? mean , standard deviation? thank you columns "size" , "price" represent categorical data (well, actually, ordinal, that's point). while can model "rating" categorical

Php : How to get the id from the name -

i have table name manager , have 2 fields manager_id,manager_name. i'am trying manager_id manager_name. not showing result , error. this code. <?php $jdata = $_get['js']; $result = json_decode($jdata,true); $name=$result['mname']; $conn=mysqli_connect('localhost','root','root','projmanagement'); $mid = mysqli_query($conn, "select manager_id manager manager_name=".$name); echo $mid; ?> i'am getting value if print $name. can't value $mid. mysqli_query returns boolean ( true or false ) normal php behavior. php > = false php > print php > you should update query. single quotes should used string values. $mid = mysqli_query($conn, "select manager_id manager manager_name='".$name."'");

python - ctypes: passing and reading an enum pointer -

this page says: enumeration types not implemented. can yourself, using c_int base class. if easy, why isn't implemented yet? how get current color temperature of monitor , instance? bool getmonitorcolortemperature( _in_ handle hmonitor, _out_ lpmc_color_temperature pctcurrentcolortemperature ); parameters hmonitor [in] handle physical monitor. monitor handle, call getphysicalmonitorsfromhmonitor or getphysicalmonitorsfromidirect3ddevice9. pctcurrentcolortemperature [out] receives monitor's current color temperature, specified member of mc_color_temperature enumeration. return value if function succeeds, return value true. if function fails, return value false. extended error information, call getlasterror. this closest able get: from ctypes import * import win32api # http://sourceforge.net/projects/pywin32/files/pywin32/ idx, (hmon, hdc, (left, top, right, bottom)) in enumerate(win32api.enumdisplaymonitors(none, none)): print(hmo

clojure - Midje print stacktrace when test fails -

i learning clojure, , trying use tdd *. i use midje testing library. love far, expected versus actual results display helpfull. but there way use clojure.tools.trace or similar print trace of first test fails ? *: specifically, remember seeing talk robert c. martin transformation priority premise, , i'm implementing factorial function way. there isn't yet code show though. one possibility writing own emitter might overkill specific goal. alternatively, can monkey-patch function responsible formatting expected values: (require '[midje.util.exceptions :as e] '[midje.emission.plugins.util :as u]) (defn- format-captured-throwable [ex] (if (e/captured-throwable? ex) ;; ... adjust needs ... (pr-str 'this-is-your-exception (e/throwable ex)))) (alter-var-root #'u/attractively-stringified-value (fn [f] #(or (format-captured-throwable %) (f %)))) format-captured-throwable has produce string, though, meaning direct

javascript - Why does my for loop come once? -

i've got code loop in function.. look bit code please: <!doctype html> <html> <head> <title>test</title> </head> <body> kies een tafel: <select id="tafels"> <option value="1">tafel 1</option> <option value="2">tafel 2</option> <option value="3">tafel 3</option> <option value="4">tafel 4</option> <option value="5">tafel 5</option> <option value="6">tafel 6</option> <option value="7">tafel 7</option> <option value="8">tafel 8</option> <option value="9">tafel 9</option> <option value="10">tafel 10</option> </select> <input type="submit" id="submit" value="bereken" onclick="tafel23();"> <