Posts

Showing posts from September, 2011

Check if mysql row exisits within foreach loop of php array -

Check if mysql row exisits within foreach loop of php array - i have array of items looping on , checking if value exists in database, if update it, if not create new entry. first item in array seen , returns true, after first 1 returns 0 if know fact in database right item_name , ticket_id. i have tried researching before asking, stumped @ point. help in advance. if($func == 'edit') { foreach ($additem $key => $value) { if (empty($key) || $key=='amount_paid') { continue; } $ticket_items = mysql_query("select * ticket_items ticket_id = '$ticket_id' , item_name = '$key'"); if (mysql_num_rows($ticket_items)) { print 'updated '. $key ."\n"; mysql_query("update ticket_items set item_name='$key', item_price='$value' ticket_id='$ticket_id'"); } else { print 'created '

jquery - Bootstrap 3 Dropdown Slidedown Strange Behavior when Navbar Collapsed -

jquery - Bootstrap 3 Dropdown Slidedown Strange Behavior when Navbar Collapsed - so adding animations navbar dropdowns, reason accepted reply (adding slide effect bootstrap dropdown) seems break or become "regular" sized when sliding on little window sizes. so weird thing seems happen slideup animation article posted: // add together slidedown animation dropdown // $('.dropdown').on('show.bs.dropdown', function(e){ $(this).find('.dropdown-menu').first().stop(true, true).slidedown(5000); }); // add together slideup animation dropdown // $('.dropdown').on('hide.bs.dropdown', function(e){ $(this).find('.dropdown-menu').first().stop(true, true).slideup(5000); }); i can re-create , paste lines google chrome's console on http://bootswatch.com/default/, alter resolution 1 navbars collapse, , break. (i extended animation times seek , troubleshoot.) normal: broken slideup: but reason, if run $('

linux kernel - access GPIO from user space -

linux kernel - access GPIO from user space - i trying access intel (cavecreek) gpio controller user space. getting: "no such device " error when trying echo /sys/class/gpio/export. here's error message: echo 32 > /sys/class/gpio/export bash: echo: write error: no such device the error message seems suggest need have device connected gpio. documentation doesn't seem mention that. nil beingness reserved far can tell dumping out /sys/kernel/debug/gpio. have i2c mux connected gpio pins. give thanks nadvance below more info on kernel , configuration the kernel is 3.14 here's relevant config setting: config_arch_want_optional_gpiolib=y config_gpiolib=y config_gpio_devres=y config_gpio_acpi=y config_debug_gpio=y config_gpio_sysfs=y in case, problem kernel source 3.14. scheme uses intel rangely. in source lpc_ich.c, .gpio_version field missing lpc_dh89xxcc. added field, recompiled , kernel able enumerate gpiopin, although display d

http - Why digest are used in Rails 4 for static content instead of ETag -

http - Why digest are used in Rails 4 for static content instead of ETag - i think http's etag mechanism invalidating stale cached content. , digests used same sake. why improve , why etags not enough? because etags still require client nail server see if client's cached re-create still fresh. rails puts far future expires header on assets means client never nail server 1 time again asset, has cached. digests become means server create client new version of asset. think rails used utilize timestamps instead of digests, digests have added, little benefit if revert asset previous state, digest same, , client may still have cached. ruby-on-rails http asset-pipeline etag

asp.net - form authentication - how to clear session with formsauthenication.signout -

asp.net - form authentication - how to clear session with formsauthenication.signout - i have <system.webserver> <modules> <add name="formsauthenticationmodule" type="system.web.security.formsauthenticationmodule" /> <remove name="urlauthorization" /> <add name="urlauthorization" type="system.web.security.urlauthorizationmodule" /> <remove name="defaultauthentication" /> <add name="defaultauthentication" type="system.web.security.defaultauthenticationmodule" /> </modules> </system.webserver> <authentication mode="forms"> <forms loginurl="login.aspx" name=".test" timeout="15"> </forms> </authentication> <authorization> <deny users="?"/> </authorization> <location path="images"> <system.web> <authorization&g

actionscript 3 - Get video encoding type or mime type before playing -

actionscript 3 - Get video encoding type or mime type before playing - i'm developing video player in as3. need switch between mp4 , flv files. easy if do: netstream.play(encoding + ":" + videosrc); the problem getting value encoding . don't want rely on extension observe this, since there might not one. thought create head request on file , read content-type header, can't seem urlrequest , urlrequestheader since back upwards post , get. how can observe encoding without kind of prior knowledge? actionscript-3 flash

How can I enable and collect trace for DB2 through WebSphere? -

How can I enable and collect trace for DB2 through WebSphere? - i enable trace db2 i'm accessing via datasource in websphere application server version 8. in server's bootstrap.properties file after variable com.ibm.ws.logging.trace.specification= add together next code: for version 6 or later: *=info:was.j2c=all:rra=all:was.database=all:transaction=all for version 5: rra=all=enabled:was.database=all=enabled:j2c=all=enabled more info can found on ibm website: https://www-304.ibm.com/support/docview.wss?rs=71&uid=swg21196160#wasconnection in datasource need specify tracelevel property well. example: <datasource id="db2" jndiname="jdbc/db2" jdbcdriverref="db2driver" > <properties.db2.jcc databasename="mydb" tracelevel="-1"/> </datasource> db2 websphere ibm trace websphere-8

sqlite - When should I restart Rails Server while in the development environment -

sqlite - When should I restart Rails Server while in the development environment - this answer 5 years old , wasn't specific. i lost couple of hours in development. code worked after server restart. can't sure, think because of alter made scoped validation in model: validates :name, presence: true , uniqueness: {scope: :institution_id} this year old answer doesn't seem apply situation. in particular, rule not seem have held me: "the general rule of thumb here making changes outside of app/ or config/routes.rb require restart." is there other rule consider? while developing, i'd avoid restarting server much possible. i suppose 1 valid reply this answer still correct. if gets upvoted enough, i'll assume remains accurate , adventure debugging-that-was-fixed-with-a-server-restart other-yet-to-be-defined issue. addendum: using: mac os 10.9.5 rails 4.1.5 spring 1.1.3 server startup: [2014-10-12 09:29:29] info

How to distinguish if a function pointer in C points to function 1 or function 2 -

How to distinguish if a function pointer in C points to function 1 or function 2 - this question has reply here: is safe pass function pointers around , compare them normal object's pointers? 6 answers i have 2 functions void foo1(int); void foo2(int); i.e. both have same signature. have function pointer typedef void (*func_pt)(int) that can point either foo1 or foo2 e.g. if (match_condition) { func_pt = foo1; } else { func_pt = foo2; } later in code, need find out if func_pt pointing foo1 or foo2. this code if (func_pt == foo1) seems work. is recommended , safe? if not, there alternative findng out function function pointer point to? i don't understand how c compiler can figure out equality. when compiler sees foo1, finds address of code function instructions stored? thanks answers yes, safe. [6.5.9] of c99 standard (emph

Rails: find elements that don't exist in the whole group -

Rails: find elements that don't exist in the whole group - Еhis code: message.where(sending_user_id: session[:user_id]) .order("created_at desc") .group(:thread_id) .where.not(isresponse: 1) i homecoming messages not have column isresponse = 1 whole grouping of same thread_ids . possible? if illustration there column thread_id: 1, isresponse: nil , thread_id: 1, isresponse: 1 i don't want returned. thanks. you can seek group by , having clauses: message.where(sending_user_id: session[:user_id]) .group(:thread_id) .having(["count(case when isresponse <> ? isresponse end) = count(*)", 1]) ruby-on-rails ruby-on-rails-4 activerecord rails-activerecord

html - How to prevent horizontal scroll? -

html - How to prevent horizontal scroll? - currently code looks class="snippet-code-css lang-css prettyprint-override"> body { padding: 0px; margin: 0px; background-color: #aba49f; font-family: verdana, geneva, sans-serif } .header_bar { width: 100%; height: 45px; z-index: 1000 !important; box-shadow: 0px 2px 12px rgba(0, 0, 0, 0.506); height: 22px; padding: 7px 40px; background-image: linear-gradient(to top, #212121 9%, #181818 100%); border-bottom: 2px solid #606060; } .header_content { width: 50%; margin: left; } .header_content li { list-style: none; float: left; font-size: 15px; } .title li { color: #ffc900 !important; } .header_content li { text-decoration: none; color: white; margin-right: 30px; } .header_content a:hover { color: #ffc900; } .sidebar_frame { z-index: 111; position:absolute; top:0; bottom:0;

oauth 2.0 - How to get a Bearer access token for Service Accounts -

oauth 2.0 - How to get a Bearer access token for Service Accounts - i have generate credentials service business relationship this: f = file(settings.service_account_pkcs12_file_path, 'rb') key = f.read() f.close() credentials = client.signedjwtassertioncredentials(settings.service_account_email, key, scope=settings.groups_scope, sub=settings.admin_domain_email) print 'credentials : '+str(credentials.to_json()) the print display credentials in json format : {"private_key": "miigwaibazccbnoglun09ywa1l7g8xc2sga9edhxadkw4dah...83j+6iagieaa==", "id_token": null, "token_uri": "https://accounts.google.com/o/oauth2/token", "token_response": null, "client_id": null, "scope": "https://www.googleapis.com/auth/admin.directory.group", "token_expiry": null, "_class": "signedjwtassertioncredentials", "refresh_token": null, "_module"

css - Making responsive images with different aspect ratios the same height -

css - Making responsive images with different aspect ratios the same height - i'm trying figure out way create responsive row of images same height, regardless of aspect ratio of each image or width of container. actual image files same height, vary in width. problem when container gets smaller, @ widths rounding errors cause images pixel or 2 different in height. here's fiddle http://jsfiddle.net/chris_tsongas/vj2rfath/, resize result pane , you'll see @ widths images no longer same height. i'm styling content cms have minimal command on markup, , have mandate utilize css rather js. tried setting image height 100% makes image 100% of original size, not 100% of container height. here html , css fiddle linked above: <div class="table"> <div class="row"> <div class="cell"> <img src="http://placehold.it/600x400" /> </div> <div class="cell"

ggplot2 - Plot multiple timeseries using ggplot R -

ggplot2 - Plot multiple timeseries using ggplot R - this question has reply here: multiple time series in 1 plot 3 answers i have xts object containing number of timeseries. info looks like: head(data) date v1 v2 v3 v4 v5 v6 2014-07-31 na 721 696 na 487 469 2014-08-02 735 752 696 559 505 469 2014-08-04 1502 737 696 757 510 469 2014-08-06 799 722 697 559 487 469 ... "date" date variable , other variables contain cost developments. automatically plot of series (so v1, v2, v3), without manually inserting names. done using xtsextra, bundle no longer available r3.1.0. is there way plot these time-series in

How to deal with lots of different customizations in a code base? -

How to deal with lots of different customizations in a code base? - we created web app utilize saas business. simple customizations can done through css overwrites , simple plugins. however, have number of bigger "enterprise" customers "enterprise" demand customization. these customizations include changes ui, new screens, different screenflows, different backends, new features never go main app, new features may go main app in future , , forth. for kind of bigger changes app maintain forks per customer. in fork alter things need. codebases maintain on diverging , merge , cherry-pick things master maintain them date of import stuff happens in main development tree. it works wonder how scale in long term. wonder best way handle such customers high demand customization. i see 3 options. extreme modularization this instance atom editor does. in atom done through plugin , defined interfaces. the benefit of customizations can done isolated. don

c - Evaluate postfix notation -

c - Evaluate postfix notation - i doing exercise stucked @ lastly step. have evaluate postfix notation using stacks in c. code: #include<stdio.h> #include<stdlib.h> #define max 100 typedef struct { int info; }tipelement; typedef struct { tipelement magacin [max]; int vrv; }tipmagacin; tipmagacin postfixstack; void inicijalizacija(tipmagacin *mag) { (*mag).vrv = -1; //warehouse empty } int prazen(tipmagacin mag) { return(mag.vrv == -1); //returns true if warehouse empty } int poln(tipmagacin mag) { return(mag.vrv == max-1); //returns true if warehouse total } void push(tipmagacin *mag, tipelement element) { if (poln(*mag)) printf("warehouse full\n"); //if total study error else { (*mag).vrv++; //next position in warehouse (*mag).magacin[(*mag).vrv].info = element.info; //put element } } void pop(tipmagacin *mag, tipelem

c++ - How does virtual inheritance actually work? -

c++ - How does virtual inheritance actually work? - i know diamond problem thing - when google "virtual inheritance" results mention only diamond problem. want know how works in general , how different normal inheritance. i know when class (normally) inherits class contains members (fields , methods, leaving aside access levels). of them may overridden or hidden new members they're still there. inheritance defines relationships between classes in hierarchy affects casting , polymorphism. now how virtual inheritance different? instance: class { public: int a; int b; void fun(int x) {} void gun(int x) {} }; class b : public { public: int a; int c; void fun(int x) {} void hun(int x) {} }; class c : virtual public { public: int a; int c; void fun(int x) {} void hun(int x) {} }; what differences between b , c ? there other differences illustration doesn't exploit? standar

sbt configuration for apache commons -

sbt configuration for apache commons - there wrong sbt config. i entered "org.apache.commons" % "commons-lang3" % "3.1" into build.sbt, , complains when sbt package. what right setting include lib? sbt apache-commons

java - error in resolving org.apache.hadoop.conf.Configuration -

java - error in resolving org.apache.hadoop.conf.Configuration - i want write files hdfs nowadays on remote server , came across few examples this , this. have cdh4.2.1 on remote server , when code seek import org.apache.hadoop.conf.configuration; , next error: cannot resolve configuration my pom.xml looks like: <dependency> <groupid>org.apache.hadoop</groupid> <artifactid>hadoop-core</artifactid> <version>1.2.1</version> </dependency> <dependency> <groupid>org.apache.hadoop</groupid> <artifactid>hadoop-common</artifactid> <version>2.4.1</version> </dependency> in this post, pom.xml looks different , when seek set versions in pom, maven not recognize it. how can resolve issue? try using hadoop-client dependency , utilize cloudera specific version using cdh

html - Odd image loading in bootstrap carousel? -

html - Odd image loading in bootstrap carousel? - i'm trying improve bootstrap carousel using divs background image rather ordinary image. background images much more flexible , easier use, i'm having issues images. 1 time new slide comes, there no image after sec appears. if click buttons, looks next image empty appears. ideas on how can prepare this? this happen background images slower load, either increment server or alter image normal image trying requires background image? html css twitter-bootstrap carousel

php - Rearrange/sort data in form of associate array with Alphabet index -

php - Rearrange/sort data in form of associate array with Alphabet index - i have array of records (some category titles fetched database table) want sort them in next format can accomplish this $categories = array( 'a' => array( 'abreva', 'activia', 'advantage', 'advil', 'air wick', 'ajax', 'aleve'), 'b' => array(), ... , on upto z ); i don't know how perform best of knowledge should sort of sorting function performed after fetching info database. have tried on own unable accomplish desired output. help/hint sufficient. in advance here go... <?php $categories=array(); $i=0; $a=array('fas','abas','ajuma','bizzo','bike','chacha','cade'); //array, assume info db foreach($a $key=>$value){ // loop array $a result db if( subst

How to create a Google Hangout button for chat-only? -

How to create a Google Hangout button for chat-only? - i added google hangout button page next the instructions: <script src="https://apis.google.com/js/platform.js" async defer> </script> <g:hangout render="createhangout" topic="cpp11" hangout_type="moderated" invites="[{ id : '74838920', invite_type : 'profile' }, { id : 'my.email@gmail.com', invite_type : 'email' }]"> </g:hangout> when press button video hangout starts (informaing me should enable video). not sure if have hangout invitee correctly, adress later. how allow let chat-only window open on button press? i looked @ documentation , there no way of doing it. https://developers.google.com/+/hangouts/api/gapi.hangout.av#gapi.hangout.av.cameramuteevent the way inquire participants click on "turn photographic camera off" button on top 1 time come in hangout. goog

php - Slim Framework -> XML output with correct headers -

php - Slim Framework -> XML output with correct headers - writing api handle xml , json. want response in format request uses. example - api request header has: accept: application/xml the issue response has content-type: application/json . i want homecoming content-type: application/xml this code: public function setheaders() { $headertype = $this->app->request->headers->get('accept'); switch($headertype){ case "application/xml": $this->app->response->headers->set("content-type",'application/xml'); default: // default type application/json $this->app->response->headers->set("content-type",'application/json'); } } # 404 errors $app->notfound(function () utilize ($app) { $logmessage = sprintf("404 not found: uri: %s", $app->request->getpath()); $app->log->debug($logmessage); $

javascript - Ajax autocomplete Extender prevent to type invalid value in text box -

javascript - Ajax autocomplete Extender prevent to type invalid value in text box - am using ajax autocompleteextender in asp textbox below. it's working fine but, problem: when user type text invalid or not match database value, should show message user "keyword not matched..." code <asp:hiddenfield id ="hdnfieldvalue" runat="server"/> <asp:textbox id="txtcontactssearch" runat="server"></asp:textbox> <cc1:autocompleteextender servicemethod="searchcustomers" minimumprefixlength="2" completioninterval="100" onclientitemselected="clientitemselected" usecontextkey="true" enablecaching="false" completionsetcount="10" targetcontrolid="txtcontactssearch" id="autocompleteextender1" runat="server" firstrowselected = "false"> </cc1:autocompleteextender> java script code

javascript - .find Inquiry about how to find text -

javascript - .find Inquiry about how to find <a> text - how find text on page under tag? i tried this, didn't work: var link = "http://www.roblox.com/my/groups.aspx?gid=34039" function her() { $.get(link, function (data) { if ($(data).find('no one!').length) { post() lol() } }) } her() if retrieving info html can line below // below illustration statement find anchors has no one! text var phrasetofind = "no one!"; //links contain above phrase example. var isanylinkwithphrasefound = $(data).find('a:contains('+ phrasetofind +')').length > 0; your function alter below: function her() { var phrase = "no one!"; $.get(link, function (data) { if ($(data).find('a:contains('+ phrase +')') .filter(function(){return $(this).text() === phrase }).length) { //this filter give links exact phrase

Why Scala's Try has no type parameter for exception type? -

Why Scala's Try has no type parameter for exception type? - i'm curious why scala.util.try has no type parameter exception type like abstract class try[+e <: throwable, +t] { recoverwith[u >: t](f: partialfunction[e, try[e, u]]): try[e, u] ... } would help documentation, e.g def parseint(s: string): try[numberformatexception, int] still won't able express disjoint exception types throws securityexception, illegalargumentexception , @ to the lowest degree 1 step in direction. this might you're looking for: import scala.util.control.exception._ import scala.util.{ success, failure } def foo(x: int): int = x match { case 0 => 3 case 1 => throw new numberformatexception case _ => throw new nullpointerexception } val success(3) = catching(classof[numberformatexception]).withtry(foo(0)) val failure(_: numberformatexception) = catching(classof[numberformatexception]).withtry(foo(1)) // val neverreturns = catching(classof[

Java Swing Image doesn't show -

Java Swing Image doesn't show - it's first post here , english language isn't pretty hope guy's understand problem have , hope nil wrong here. my problem: i'm learning atm swing , how works, have problems image doesnt show up. maybe dont understand part of swing hope can explain me why image doesnt loading can larn , improve work : ) i tried much variatons failed , dont know why. tried graphics. my program: jframe -> jpanel -> jlabel (which have image , should set on jpanel or maybe there direct way on jpanel) test2.jpg in bundle folder , eclipse dont shout error. also jpanel in separate class , dont extend jframe gui class. here 3 classes: start: package verwaltungssoftware; public class start { //start der applikation public static void main(string[] args) { system.out.println("willkommen bei der verwaltungssoftware fuer die jobsuche"); new gui(); } } gui: package verwal

arrays - javascript loop needed to show hidden list onclick one at a time -

arrays - javascript loop needed to show hidden list onclick one at a time - i have list of hidden divs , able show 1 div @ time, when button pressed, .. having hard time writing proper loop this. product_options: function() { var product_option = $('.product_product_options_option_name') $(product_option).css("display", "none"); $('.add_product_option').on('click', function (e) { e.preventdefault(); $(product_option).each(function(){ $(this).css("display", "block") }); }); } currently displays them onclick, deleted other loop attempts, bc egregiously wrong or not doing much try product_option.first().show(); //show first 1 product_option = product_option.slice(1); //remove first 1 demo: class="snippet-code-js lang-js prettyprint-override"> $(function() { var options = $('.product_

xml - CPAN modules claim to install but dont -

xml - CPAN modules claim to install but dont - running ubuntu 14.04 through virtualbox. when executing script, next error: can't locate xml/simple.pm in @inc (@inc contains:... now, when check directories in @inc , indeed not contain xml/simple.pm i tried installing through cpan sudo cpan xml::simple and tells me that: xml::simple date (2.20). which, according perl not true, since output of perl -e "use xml::simple " is can't locate xml/simple.pm in @inc (@inc contains: so, missing? an alternative way install perl modules on linux systems distribution repository. on debian/ubuntu systems general rules converting cpan distribution name apt bundle name is: convert module name lower case convert '::' '-' add 'lib' prefix , '-perl' suffix so bundle name xml::simple be: libxml-simple-perl , install with: sudo apt-get install libxml-simple-perl there exceptions these rules, can searc

associations - Has many through relationship in rails -

associations - Has many through relationship in rails - i using facebook api fetch users fb. i want store users in model user i using has many through relationship store users user model relationship have in user model. has_many :friends, :through => :user_friends, :class_name => "user", :foreign_key => "friend_id" user friends model intermediate table fetch friends of user. belongs_to :user belongs_to :user, :foreign_key => "friend_id" user friends has user_id , friend_id columns added in migration. i error when utilize .friends on user object. activerecord::hasmanythroughassociationnotfounderror: not find association :user_friends in model user can help this? in advance. you need check self-referential association. apparently missing concepts. can not add together 2 associations same name in single model, (only 1 of them respond). you should add together has_many :user_friends , still missing o

android - Scan debit card number using card.io -

android - Scan debit card number using card.io - i using card.io scanning credit card , debit card. got know if number embossed scan card. want know possible utilize opencv or other technique read debit card (where number not embossed) same accuracy card.io providing now android card.io

vb.net - Clear contents in Cells based on String/empty cell -

vb.net - Clear contents in Cells based on String/empty cell - i trying clear cell contents if find "na" cell value or if cell blank. example looks this: rep intakes var plan cal rep intakes deed cal rep intakes na 373.00 na 8.00 371.00 374.00 23.00 379.00 358.00 69.00 398.00 -18.00 175.00 148.00 11.00 na 252.00 my numeric column start e ara want write vb code looks @ given column range , checks each cell check whether empty or "na". in both cases should clear cell. try this: sub nakiller() dim r range, v string each r in activesheet.usedrange v = r.text if v = "na" or v = "" r.clear end if next r end sub vb.net excel

java - How to run mwe.utils.StandaloneSetup in server -

java - How to run mwe.utils.StandaloneSetup in server - i'm working in web project uses xtext grammar every time run on apache tomcat find same error java.lang.classnotfoundexception: co.edu.uniandes.enar.picture.model @ org.apache.catalina.loader.webappclassloader.loadclass(webappclassloader.java:1324) @ org.apache.catalina.loader.webappclassloader.loadclass(webappclassloader.java:1177) @ co.edu.uniandes.picture.webpicture.servlet.util.uploaddownloadfileservlet.dopost(uploaddownloadfileservlet.java:75) @ javax.servlet.http.httpservlet.service(httpservlet.java:644) @ javax.servlet.http.httpservlet.service(httpservlet.java:725) ... i did steps mentioned in http://www.eclipse.org/forums/index.php/t/489925/ generate jar file 1 time again not work thanks in advance solved export xtext grammar project whole .jar export mwe2 runnable jar put jar files in web project modify code loading model follows //new org.eclipse.emf.mwe.utils.standalo

android - Having trouble creating a stopwatch timer with Calendar class -

android - Having trouble creating a stopwatch timer with Calendar class - i have been having little problem using calendar class create stopwatch timer. reason, programme keeps crashing when piece of code called. tried using other classes such timer & date, same thing happened. code follows: private onclicklistener clearbuttonlistener = new onclicklistener() { public void onclick(view v) { calendar.set(calendar.hour, 0); calendar.set(calendar.minute, 0); calendar.set(calendar.second, 0); calendar.set(calendar.millisecond, 0); fulltime = calendar.hour + ":" + calendar.minute + ":" + calendar.second + ":" + calendar.millisecond; timetextview.settext(fulltime); } }; should utilize class (other stopwatch class) prepare problem? bunch. please not vote downwards on post. if post unclear in way, please express concern in comments section. give thanks you.

javascript - Accessing JS variable in Razor and Aspx -

javascript - Accessing JS variable in Razor and Aspx - this code: <% if (somecondition) { %> var activetab = $("#mytabs").tabs("option", "active"); var language = <% mylanguages[activetab] %> ; <% } %> mylanguages of type dictionary. i want access mylanguages[activetab]. how do this? try this, variable gets value of variable, @ render time : <% if (somecondition) { %> var activetab = $("#kiosktabs").tabs("option", "active"); var language = '@html.raw(mylanguages[activekiosktab])'; <% } %> javascript asp.net-mvc razor

c - Voronoi diagram bound by circular tour -

c - Voronoi diagram bound by circular tour - i'm facing next problem: i'm given point cloud p , subset of point cloud b. nodes b in b constitute boundary of (whole) point cloud p. (in fact, b given closed, oriented circular tour). now, compute voronoi diagram of p, intersected b, , extract area of each (intersected) voronoi polygon. here illustration of situation: intersect bluish polygons greenish segments. questions: is there, chance, c library solves exact problem? if not, there improve way solve problem computing voronoi diagram using library, explicitly intersecting (green) segments polygons library output? maybe exploiting constrained delaunay triangulation? ps: know feat possible using cgal. however, having never used cgal, cgal seems quite complex , adapting illustration code such this seems far straight forward. also, prefer solution in c. so decided go against alpha shapes since know exact boundary , not want fine tune alpha value avoid holes i

sql - ORACLE left outer join issue (with empty table?) -

sql - ORACLE left outer join issue (with empty table?) - i'm wondering why query: select l.objectid left_code, r.object_code right_code oggetto_organizzativo l left outer bring together anag_oggetto_organizzativo r on l.objectid = r.objectid r.objectid null; returns rows, while other query select l.objectid left_code oggetto_organizzativo l left outer bring together anag_oggetto_organizzativo r on l.objectid = r.objectid r.objectid null; doesn't homecoming nothing. problem insert in right table rows nowadays in left table not in right table; @ moment right table empty. it seems if not referring right field in select clause, oracle not manage outer join. thanks in advance. paolo [update] first query select l.codice_oggetto_sap oggetto_organizzativo l left outer bring together anag_oggetto_organizzativo_sap r on l.codice_oggetto_sap = r.codice_oggetto_sap r.codice_oggetto_sap null execution plan second query select l.codice_ogg

Segmentation fault (core dumped) in PHP -

Segmentation fault (core dumped) in PHP - ok, i'm running php app on command line on ubuntu, , ends "segmentation fault (core dumped)". how go here debug it? i'm pretty sure there no memory leak checked get_memory_usage(). edit: alright, explained brendan , ulricht, tried gdb. that's not environment @ sorry oncoming newbie questions. i ran code under gdb , got segfault. here first 22 lines. (gdb) bt #0 0x00000000006f5d36 in ?? () #1 0x00000000006f7625 in ?? () #2 0x00000000006f7b68 in zend_parse_parameters () #3 0x0000000000610584 in zif_array_rand () #4 0x00000000006dd9bb in dtrace_execute_internal () #5 0x000000000079da15 in ?? () #6 0x0000000000717748 in execute_ex () #7 0x00000000006dd8b9 in dtrace_execute_ex () #8 0x000000000079e060 in ?? () #9 0x0000000000717748 in execute_ex () #10 0x00000000006dd8b9 in dtrace_execute_ex () #11 0x000000000079e060 in ?? () #12 0x0000000000717748 in execute_ex () #13 0x00000000006dd8b9 in dtrace_execut

apache - htaccess doesn't load new js/css from another vhost -

apache - htaccess doesn't load new js/css from another vhost - ok, here is! have 2 virtual hosts, named main.aaa.com , static.aaa.com. i have htaccess rule in main.aaa.com each path contains js|css|img|ico load them static.aaa.com. this htaccess main.aaa.com: options +indexes options -multiviews options +followsymlinks # turn on rewriteengine rewritebase / rewriteengine on # # rules # rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule !\.(css|js|ico|img)$ index.html [pt,l] rewriterule ^(.+\.(css|js|img|ico))$ http://static.aaa.com/$1 [l] what's going on works perfectly, absolutely perfect, but... if create new file in static/js folder , seek load in main.aaa.com index file, gives 200 ok, file not changed, , looking it seems htaccess doesn't bother file in static vhost. i have changed file permissions 755, of files have same permissions , same owner, new ones create not loaded. any help much appreciated! give th

c# - Determine corrupt file of "Data Error (Cyclic redundancy check) on IOException" -

c# - Determine corrupt file of "Data Error (Cyclic redundancy check) on IOException" - given code snippet: public ienumerable<ifileinfo> getfiles(string searchpattern) { homecoming this.directoryinfo .getfiles(searchpattern) .select(fileinfo => new fileinfowrapper(fileinfo.fullname)); } suppose physical disk have bad sectors. code called wrapped try/catch clause. try { var files = this.getfiles("*"); // ... } grab (ioexception ex) { // phone call writes new entry on windows eventlog // - text written ex.message plus ex.stacktrace value in case. new logentry((int)globaleventlogid.fileioerror, ex) { source = assembly.getexecutingassembly().getname().name, entrytype = logentrytype.error, }.write(); } how can determine what file corrupt if code raises ioexception text: data error (cyclic rendundancy check)? i modify getfiles() utilize yield return , wr

excel - Exxel Macro Copy Selection area and Paste -

excel - Exxel Macro Copy Selection area and Paste - this have. i trying excel re-create cells have selected , paste on next blank line in spreadsheet. but in code below, fixed range of cell beingness copied. how should alter code can me dynamic range? sub copypaste() range("a6:e6").select selection.copy sheets("sheet2").select lmaxrows = cells(rows.count, "a").end(xlup).row range("a" & lmaxrows + 1).select selection.pastespecial paste:=xlvalues, operation:=xlnone, skipblanks:= _ false, transpose:=false lmaxrows = cells(rows.count, "a").end(xlup).row range("a" & lmaxrows + 1).select end sub remove statement range("a6:e6").select this statement selects fixed range. try this sub copypaste() dim sht worksheet dim rngtarget range dim lmaxrows long selection.copy set sht = sheets("sheet2") lmaxrows = sht.cells(rows.count, &q

sql - How to insert data from two tables into one table -

sql - How to insert data from two tables into one table - i need insert values 2 tables 1 table. eg table 1 outward , table 2 product table. need insert values outward table , product table have productname needs inserted outward table. code insert tbltrn_outward, tbltrn product(chalanno,godownsrno, igodownsrno,deladdress,outwarddate,productname,qty,boxes,rate,price,batchcombo,active,createdby,createdon,fyearsno) values('$chalanno','$godownsrno','$igodownsrno','$deladdress','$outwarddate','$productname','$qty','$boxes','$rate','$price','$batchcombo','$active','$createdby','$createdon','$fyearsrno')"; there basic: insert tbltrn_outward(chalanno, godownsrno, ... ) select column1 , column2 , ... tbltrn_product sql

javascript - optional parameter in flatiron/director -

javascript - optional parameter in flatiron/director - is possibile create route optional parameter in flatiron/director? var router = router({ 'order' : function(){ // create order }, 'order/:orderid' : function(orderid){ // load order id } }).init(); can utilize 1 single route manage edit/load order? from director docs: var router = router({ // // given route '/hello/world/johny/appleseed'. // '/hello': { '/world/?([^\/]*)\/([^\/]*)/?': function (a, b) { console.log(a, b); } } }); basically utilize regex instead of simple :tokens johny , appleseed become optional parameters. javascript routing flatiron.js

PHP: How to access json object chain with hyphenated names -

PHP: How to access json object chain with hyphenated names - referring question ... how access object property hyphenated name? ... have additional one: i want access json property saved in variable ... ... $var = '$obj->my-prop'; if $var = 'my-prop' ... solve problem hyphenated name calling via $obj->{$var} which lead $obj->{'my-prop'} ... said in preceding question. but: variable contains preceding object value ('$obj'). calling via {$var} leads {'$obj->my-prop'}, invalid, way solve seams to explode('->',$var) , concatenate it, mess. does know 'solution idéale'? :-) edit: solution idéale of 1 has solve question whether maintain literal object syntax saving variable string looks(!) object. hence unpackpath function of h2ooooooo proper one. in contrast save variable in chain array (as tobe said) open more scheme appropriate way of processing data. json_decode string '

apache2 - Symfony2 on ubuntu virtual host debug toolbar not found -

apache2 - Symfony2 on ubuntu virtual host debug toolbar not found - i installed lamp on ubuntu 14.04 lts , created virtual host symfony project. didn't alter in symfony project yet seek load acmedemobundle error an error occured while loading web debug toolbar (404: not found). want open profiler? i did research found .htaccess file didn't work. have suspicions might virtual host conf file in /etc/apache2/sites-enabled/ content of file is: <virtualhost *:80> serveradmin admin@localhost servername registration.dev serveralias www.registration.dev documentroot /var/www/registration/web/ directoryindex app_dev.php errorlog ${apache_log_dir}/error.log customlog ${apache_log_dir}/access.log combined </virtualhost> i had same issue. here working file /etc/apache2/sites-enabled/ <virtualhost *:80> servername test.dev documentroot /var/www/html/test_symfony/web/ directoryindex app_dev.php

haskell - Variable List Comprehension Length -

haskell - Variable List Comprehension Length - i'm generating list of lists via list comprehension, have no thought how create sub list's length variable using parameter. input next tuple (first, second) , integer z : z = 1: [[a] | <- [first..second]] z = 2: [[a, b] | <- [first..second], b <- [first..second]] z = 3: [[a, b, c] | <- [first..second], b <- [first..second], c <- [first..second]] you can utilize replicatem task. it's defined as replicatem :: monad m => int -> m -> m [a] replicatem n m = sequence (replicate n m) the connection here turn list comprehension do notation: [[a] | <- [first..second]] == <- [first..second] homecoming [a] [[a, b] | <- [first..second], b <- [first..second]] == <- [first..second] b <- [first..second] homecoming [a, b] [[a, b, c] | <- [first..second], b <- [first..second], c <- [first..second]] == <- [first

HAXM and Lollipop -

HAXM and Lollipop - after sdk upgrade android 5, cannot utilize intel hardware accelerated execution manager: $ android-sdk-macosx/tools/emulator -avd avd_for_lowmemorydevice_by_user -netspeed total -netdelay none -gpu on hax working , emulator runs in fast virt mode emulator: vcpu shutdown request eax=80000001 ebx=019a0000 ecx=c0000080 edx=00000000 esi=00013c40 edi=01d9d000 ebp=00100000 esp=004f6104 eip=001000f0 efl=00000002 [-------] cpl=0 ii=0 a20=1 smm=0 hlt=0 es =0018 00000000 ffffffff 00c09300 dpl=0 ds [-wa] cs =0010 00000000 ffffffff 00c09b00 dpl=0 cs32 [-ra] ss =0018 00000000 ffffffff 00c09300 dpl=0 ds [-wa] ds =0018 00000000 ffffffff 00c09300 dpl=0 ds [-wa] fs =0018 00000000 ffffffff 00c09300 dpl=0 ds [-wa] gs =0018 00000000 ffffffff 00c09300 dpl=0 ds [-wa] ldt=0000 00000000 00000000 00008200 dpl=0 ldt tr =0020 00000000 00000fff 00008b00 dpl=0 tss64-busy gdt= 00000000004ea098 00000030 idt= 0000000000000000 00000000 cr0=80000011 cr2=000000000000

Create dropdown list jsf -

Create dropdown list jsf - currently i'm stuck in create 2 dropdown list in jsf click "add" button. initial have form 2 dropdownlist, "add" button , "submit" button. the first dropdownlist list country. sec dropdownlist list city. when user take country sec dropdownlist add together dynamic city of country(i done using ajax f:ajax). how can add together 2 other dropdownlist(list country , list city also) when add together button clicked?(it mean user can add together lot of pair dropdownlist using add together button) how construction of bean manage pair dropdownlist when click submit button? please give me illustration code it. thanks have tried using c:foreach ? similar following: <c:foreach var="i" begin="1" end="#{bean.numberofaddsclicked}" step="1"> <!-- elements repeat here. bind values bean.country[i] respective bean.city[i] country , city beingness arr

.net - When a template in an xsl file overlaps with a template in an included xsl file, the included xsl would not add the needed content -

.net - When a template in an xsl file overlaps with a template in an included xsl file, the included xsl would not add the needed content - i generate various xml files , utilize them test cases programme of mine. utilize xslt generate more complex test cases basic ones avoid duplication of xml content. xsl files include other xsl files add together xml content existing test case. i have problem: when template in xsl file overlaps template in included xsl file, included template not add together needed content. hello.xml : <ebc> <positionen> <position> <artikelnr>helloworldproductref</artikelnr> <herstnr>hello world! (productname)</herstnr> </position> </positionen> </ebc> hello.xsl : <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/xsl/transform"> <xsl:template match="node()|@*"> <xsl:copy> <xsl:ap

r - QuantMod getOptionChain "subscript out of bounds" error -

r - QuantMod getOptionChain "subscript out of bounds" error - i trying utilize function getoptionchain() quantmod library download alternative chains vix, sp500 , eurostoxx 50 next doesn't work: library(quantmod) vix.opt <- getoptionchain("^vix") i'm getting error: error in lapply(strsplit(opt, "<tr>"), function(.) gsub(",", "", gsub("n/a", : subscript out of bounds in addition: warning message: in readlines(paste(paste("http://finance.yahoo.com/q/op?s", symbols, : incomplete final line found on 'http://finance.yahoo.com/q/op?s=^vix+options' how can prepare this? i'm working on patch this. far works, must specify opex date (3rd fri of month). example calls: getoptionchain("^vix") $calls strike bid inquire lastly vol oi vix141119c00010000 10.0 7.10 7.40 7.10 18 1974 vix141119c00010500 10.5 6.60 6.90 6.

sublimetext2 - How to show find results in separate tab or window? -

sublimetext2 - How to show find results in separate tab or window? - i started using sublime text 2 coming notepad++. i cannot find way show find results in separate space (tab,window,sidebar whatever). in notepad++ had little window showing line string found. double click go line. i cant in sublime. press ctrl+f type string , press find all. i have indication x results found , can loop through them, cant create open separate space them. also find results submenu in find menu grayed out. what doing wrong? ok, there few ways utilize search in sublime. doing searching in current file have open ctrl+f. what think want ctrl+shift+f - type string , click 'find' – open results panel in new window/pane , can click on highlighted results jump place in file. find sublimetext2

python - Upload to Aws elastic beanstalk -

python - Upload to Aws elastic beanstalk - i have question how upload aws elastic beanstalk my file construction blelow: i have virtualenv folder. , create folder name project . in project,there 2 folders. 1 djangoproject (a website) , other python files run scrapy project . i seek upload before.it seems if utilize method deploying django application ,i have upload pure django project root folder,so aws can grab files. please teach me how upload these aws eb, construction correct? or give tutorial websites can move on. > virtualenv >bin >include >lib >doc >etc > project > requirements.txt > djangoproject > scrapy i tested ec2 deployment, can't tell eb workflow, have upload django app, not entire virtualenv folder. improve utilize git, can host files on bitbucket witch offers free private repos , install git on eb instance , git. here link aws documentation. python

java - Error handling of a Custom Form Handler in ATG -

java - Error handling of a Custom Form Handler in ATG - i new atg. , trying utilize repositoryformhandler of own. not able validations on form. here .java file: public class myloginbean extends repositoryformhandler { private string logname; private string logpwd; private string message; public string getlogname() { homecoming logname; } public void setlogname(string logname) { this.logname = logname; } public string getlogpwd() { homecoming logpwd; } public void setlogpwd(string logpwd) { this.logpwd = logpwd; } public string getmessage() { homecoming message; } public void setmessage(string message) { this.message = message; } public boolean handlelogname(dynamohttpservletrequest prequest, dynamohttpservletresponse presponse) throws servletexception, ioexception { boolean tf=true; if(logname.isempty() || logname=

java - expect static call with some certain result -

java - expect static call with some certain result - i've got static phone call of scheme function in method long currentdatemilliseconds = system.currenttimemillis(); how test phone call , set specific result using powermock? i mean this system.currenttimemillis(); expectlastcall().andreturn(leftbound); // expect homecoming amount of milliseconds well...i've done this mockstatic(system.class); expect(system.currenttimemillis()).andreturn(rightbound.gettime()); replayall(); asserttrue(dateutils.isinrange(leftbound, rightbound)); verifyall(); java powermock

php - Wordpress Titles in Javascript -

php - Wordpress Titles in Javascript - i have post title ' in it. wordpress outputting encoded html entity ( i&#8217;m example), when utilize track events in analytics mixpanel, don't nice human-readable title, title html entity, obviously. i've been searching , tried several things, nil seems work. here's current code. mixpanel.track("episode view", { "title": epnum + " <?php wp_kses_decode_entities(the_title()); ?>", "episode number": epnum, "season": 1 can point me way decode string say, contains ' , escape javascript? javascript php wordpress mixpanel

How to shift column data using UPDATE in a MySQL table? -

How to shift column data using UPDATE in a MySQL table? - i want utilize static-sized table this: +------+----------+-----------+ | id | col1 | col2 | +------+----------+-----------+ | 1 | | x | +------+----------+-----------+ | 2 | b | y | +------+----------+-----------+ | 3 | c | z | +------+----------+-----------+ is there way shift column info upwards when update [3, col1] example? table should this... +------+----------+-----------+ | id | col1 | col2 | +------+----------+-----------+ | 1 | b | x | +------+----------+-----------+ | 2 | c | y | +------+----------+-----------+ | 3 | d* | z | +------+----------+-----------+ *new value in [row3, col1] , column info has been shifted up; in advance. you can update / join : update table t left bring together table tnext on t.id = tnext.id - 1 set t.col1 = (case

javascript - Single Meteor application having multiple domains -

javascript - Single Meteor application having multiple domains - is possible create single meteor application having multiple domains , displaying different views/layouts depending on domain? for example, have admin interface accessible on admin.myapp.com , 2 domains storex.com , storey.com. both domains should point info admin.myapp.com displaying info (mostly) independently of each other. perhaps improve approach utilize meteor's pub/sub capabilities, rather sharing db per say. it's exclusively possible publish , subscribe across meteor apps, or indeed implementation using ddp. http://docs.meteor.com/#/full/ddp_connect javascript node.js meteor multiple-domains sites

recursion - Stored values and echoed values different in php recursive function -

recursion - Stored values and echoed values different in php recursive function - hey guys making head hurt. i writing recursive function go through directory of files create xml sitemap. i have come across problem in if echo out value shows want, if store (to write file @ end) value different. function dirtoarrayxml($dir, $langcode, $data) { $result = array(); $cdir = scandir($dir); $str = ""; foreach ($cdir $key => $value) { if (!in_array($value,array(".",".."))) { if (is_dir($dir . "/" . $value)) { $result[$value] = dirtoarrayxml($dir . "/" . $value, $langcode, $data); } else { $result[] = $value; if(endswith($value, ".php")) { $page = substr($value, 0, -4); $str .= " <url> <loc>http: