Posts

Showing posts from February, 2011

css - Inline-blocks inside fixed width content overflowing -

i have 2 inline-blocks of fixed content, i'm trying display these next each other. they're both held within div of width: 1000px; , 2 inline-block divs both width: 400px; , width: 600px; respectively. the 2 divs don't display inline, second div collapses underneath first, if drop width of second width: 550px; both display inline, question being: how come 2 divisions have combined width of 1000px can't both fit inside container has width of 1000px; ? fiddle below. <div class="layout"> <div class="width"> <div class="area left"> </div> <div class="area right"> </div> </div> </div> and css .layout { box-sizing: border-box; padding-left: 250px; padding-right: 250px; padding-top: 50px; } .layout .area.left, .layout .area.right { display: inline-block; height: 250px; } .layout .area.left { width: 400px; background: green; } .la

html - Addding a item to a list in JavaScript -

i'm debutant in javascript please patient me, in code have list of ingredients, when user puts in input area , click on body, text must added item in list before last one, code not working , can't find problem. <!doctype html> <html> <head> <title>kitchen</title> <script type="text/javascript"> function ajout(){ var newingredient = document.createelement("li"); var ingredient = document.getelementbyid("in2").value; var text=document.createtextnode(ingredient); newingredient.appendchild(text); var lastone=document.getelementbyid("last"); var list=getelementbyid("listecommissions"); list.insertbefore(newingredient, lastone); } </script> </head> <body onclick="ajout()"> <br /><br /><br /> <ul id=&qu

ios - Moving between UIViewControllers without Segue -

i have storyboard has 8 uiviewcontroller s on (and counting). need able move between pair of these on demand. essentially, trying mimic functionality of uitabbarcontroller . since there many of these, can't use uitabbarcontroller (that solve problem immediately), using uipopovercontroller embedded uitableview allow user choose destination. of course, create segues on storyboard, set of segues need currently, have create 56 such segues view controllers have right now, , potentially many more things grow. one idea had create 'hub' view controller doesn't other hold segues each of 'real' vcs , delegate of each of vcs. then, when want switch between vcs, first dismiss view controller , pass segue name destination hub. hub can perform segue, gets me want. think work, seems sort of hackish. does know how if there better way accomplish this? thank you! why don't give each 1 storyboard identifier, grab need identifier using this: uiviewcontro

How to open google play store url in android webview -

i'm gonna open google play app url on webview. says this browser no longer supported. please use google play store app access google play. i've researched solve issue didn't find solution. there ways open on activity there no way open on webview yet. i know same message when i'm going access url in normal web browser. anyhow there solution? you need change user agent : http://developer.android.com/reference/android/webkit/websettings.html#setuseragentstring(java.lang.string e.g. webview.getsettings().setjavascriptenabled(true); webview.getsettings().setuseragentstring("mozilla/5.0 (x11; linux x86_64; rv:10.0) gecko/20100101 firefox/10.0"); // linux desktop mozilla user agent then load google play.

hibernate - Grails many to many relationship not creating expected tables -

hi have 2 domain classes. idea user can create events, guest @ other peoples events: class event { appuser creator static belongsto = appuser static hasmany = [guests: appuser] and class appuser { static hasmany = [friends: appuser, events: event] the problem is, expected make creator_id column in event table, , appuser_events table appuser_id , event_id , including creator_id column here , making primary key. i tried creating event class this: class event { static belongsto = [creator:appuser] static hasmany = [guests: appuser] but grails not recognize belongto relationship. any idea how fix? ok, solved issue. key add 2 hasmany references event class appuser, , add mappedby, event class contains: static hasmany = [friends: appuser, events: event, invites:event] static mappedby = [invites: "guests", events: "creator"] the appuser class unchanged first example in question.

Exact meaning of dashtype index in the Gnuplot 5.0? -

Image
i got problem in gnuplot 5.0, dashtype index, such ``set dashtype 1 (2,5,2,15)` in manual. my question is: these numbers in parenthesis mean? tried change them feeling, great know exact meaning. my actual problem is, using dashtype n , gives lines different previous 4.6 version, unfortunately. try reproduce plots made in gnuplot 4.6. those numerical pairs <solid length>,<empty length> those lengths factors internal unit length. dash pattern length further depends on dashlength terminal option , line width. so, having plot x dt (2,4,2,6) plots dash, empty space twice long, again dash of same length , empty space 3 times dash length. the actual length of first dash then linewidth * terminal_linewidth * solid_length * terminal_dashlength * dash_unit first example: set terminal pngcairo size 600,50 dashlength 2 linewidth 1 set output 'dash1.png' unset border; unset key; unset tics plot 0 dt (2,4,2,6) lw 10 what might confusing is,

apache - htaccess HTTPS only no redirect -

i want block port 80 (http) , allow https requests. have found many examples of how redirect http https prefer display error instead. cannot block port 80 in config file hosting provider not allow me modify these files. if possible, how can achieve same results htaccess. the reason me wanting on api.domain.com added security after reading article . quote article... aside abandoning http basic altogether there easy fix. close port 80 on api host. stops connection being made dead in tracks, preventing credentials being sent in clear try: rewriteengine on rewritecond %{https} off rewritecond %{request_uri} !/error\.php rewriterule ^ http://%{http_host}/error.php [l,r] or rewriteengine on rewritecond %{https} off rewriterule ^ - [l,f]

Binding HTML template to data in AngularJS -

i have simple html template following <p>{{data.id}}</p> and can compile data object string, not want bind scope. like var data = {id:123}; var result = $compile(html)(data); thanks! added plunker here .

Android Sqlite table column foreign keys? -

i creating simple sqlite db android project. has been long time since have written msql commands, let alone sqlite. to keep question simple, lets have 2 tables. 1 table dogs , owners . in dogs there column hold owner's _id primary key other table. i can't life of me remember how in sqlite or if can. i creating dog table string : private static final string create_table_dogs = "create table" + table_dogs + "(" + column_id + " integer primary key autoincrement, " + column_name + " text not null, " + column_owner + " integer );"; sqlite not have foreign keys enabled default. you'll need execute pragma foreign_keys=on; every time before using database. to create actual foreign key relation, add column dogs table this: foreign key(owners_id) references owners(_id) . should define rules constraint violations. for more information on sqlite foreign k

mySQL, multiple COUNT INNER JOINs with GROUP BY DATE() -

i have table of install logs , want select table number of installs per day status = 1 number of installs per day status = 0 number of installs per day status in(0, 1) field created_utc keep install unix timestamp. this table structure create table `installs` ( `created_utc` int(11) default null, `status` tinyint(1) default '1' comment '1 - installed, 0 - deleted' ) engine=innodb default charset=utf8; and query, not work correctly (i'm selecting u.id crutch execute inner joins... i'm totally lost) select u.id, count(pa.created_utc) installs_this_day, unix_timestamp(from_unixtime(pa.created_utc, '%y-%m-%d'))*1000 time_utc, count(pa2.created_utc) installs_active_this_day users u inner join installs pa on pa.status = 0 inner join installs pa2 on pa2.status = 1 u.id = 1 group date(from_unixtime(pa.created_utc)), date(from_unixtime(pa2.created_utc)) this results in duplicates , incorrect counts. 1 45 14302800000

html - Favicon isn't showing -

i have website, trying make favicon. problem is, isn't showing up. on local host shows cloud thing , on page open using html file shows regular white page on sites without favicon. this how trying implement it. <link rel="icon" type="image/icon" href="http://www.mywebsite.com/myfavicon.ico"/> <link rel="stylesheet" type="text/css" href="maincolortest.css" /> i without writing single line of code, , works. just make sure format of file png, , 16x16 pixels . rename 'favicon.ico' , put on root directory of website. your browser automatically fetch icon , use wherever needs. may need use ctrl+f5 on browser see effect, (it makes deeper refresh)

symfony - Erreur in Installation PUGXMultiUserBundle -

i want install pugxmultiuserbundle. followed documentation of pugxmultiuserbundle: https://github.com/pugx/pugxmultiuserbundle/blob/master/resources/doc/index.md have downloaded pugxmultiuserbundle success , continued creating entities. created entity user: <?php namespace register\userbundle\entity; use fos\userbundle\model\user baseuser; use doctrine\orm\mapping orm; use symfony\component\validator\constraints assert; /** * @orm\entity * @orm\table(name="user") * @orm\inheritancetype("joined") * @orm\discriminatorcolumn(name="type", type="string") * @orm\discriminatormap({"societe" = "societe", "chercheur" = "chercheur"}) * */ abstract class user extends baseuser { /** * @var integer * * @orm\column(name="id", type="integer") * @orm\id * @orm\generatedvalue(strategy="au

android - Swipe image views left and right like a drag and drop -

i have image view. want touch image , drag left or right. when image dragged left, new image should appear array. when drag right should saved in activity. how can possibly this, if guide me tutorial or example. thank-you you can use viewpager , pageadapter. protected class imagepageradapter extends pageradapter { public imagepageradapter() { } @override public int getcount() { return getimages().size(); } @override public boolean isviewfromobject(view view, object o) { return view == o; } @override public void destroyitem(viewgroup container, int position, object object) { container.removeview((view) object); } @override public object instantiateitem(viewgroup container, int position) { layoutinflater inflater = (layoutinflater) container.getcontext() .getsystemservice(context.layout_inflater_service); view view = inflater.inflate(r.layout.image_page_view, n

regex - Extracting data between curly brackets in text file in MATLAB -

i have text file has multiple lines , hierarchies this: ... ... ... hierarchy { { b { name "b1" type virtual } c { name "c1" parent "b1" } d { name "d1" type virtual } } { b { name "b2" type virtual } c { name "c2" parent "b1" } d { name "d2" type virtual } } } ... ... i looking @ extracting text "a {" till end of quotes matching "a" in matlab. content inside "a" vary in number of elements (there more name , contains fields). there way extract "a" , possibly fields cell array? any appreciated! i guess want code work number of object , name. i'd recommend store objects in structs

How does git store duplicate files? -

we have git repository contains svm ai input data , results. every time run new model, create new root folder model can organize our results on time: /run1.0 /data ... 100 mb of data /classification.csv /results.csv ... /run2.0 /data ... 200 mb of data (including run1.0/data) /classification.csv /results.csv ... as build new models may pull in data (large .wav files) previous run. means our data folder 2.0 may contain files 1.0/data plus additional data may have collected. the repo going exceed gigabyte if keep up. does git have way recognize duplicate binary files , store them once (e.g. symlink)? if not, rework how data stored. i not going explain quite right understanding every commit stores tree structure representing file structure of project pointers actual files stored in objects sub folder. git uses sha1 hash of file contents create file name , sub folder, example if file's contents created following hash: ob064b56112cc80495ba

passing variables from bash to executable (which reads argument with stdin) -

i have following test.cpp c++ program #include <stdio.h> #include <stdlib.h> #include <iostream> using namespace std; int main() { float a,b,c; cout<<"give 1st number"; cin>>a; cout<<"give 2nd number:"; cin>>b; c=a+b; cout<<"\n"<<a<<"+"<<b<<"="<<c<<endl; return 0; } and want create shell script gives input variables. know how pass 1 variable, , know if there way pass 2 variables ... following test.sh file not working #!/bin/bash g++ test.cpp -o testexe chmod +x testexe a=1 b=2 ./testexe <<< $a $b to compatible not bash, /bin/sh -- while avoiding pipeline overhead -- use heredoc: ./testexe <<eof $a $b eof if don't care pipeline overhead (and still maintaining /bin/sh compatibility, answer using <<< lacks): printf '%s\n' "$a" "$b" | ./

php - cakePHP multidimensional array loop back to previous push -

i have created array need show list of projects current user. each project made of stages, each stage can have multiple kpis assigned it. as can see stages appended array fine , part kpis. the exception kpis not stage specific. when have type of kpi should assigned project section, spans multiple stages. kpis assigned stages psid, if id null project wide kpi. the issue i'm having project wide kpis. repeated, need each kpi appear once in array. i've tried check pushed array element pushed 1 in order check. $i=0; foreach($projects $project){ $projectstages = $this->projectstages->find('all', array( 'conditions' => array( 'pid' => $project['projects']['pid'] ) ) ); array_push($projects[$i], $projectstages); $n=0; foreach($projectstages $stage){ $proje

python - Cheapest way to get a numpy array into C-contiguous order? -

the following produces c-contiguous numpy array: import numpy = numpy.ones((1024,1024,5)) now if slice it, result may not longer same. example: bn = a[:, :, n] with n 0 4. problem need bn c-contiguous, , need many instances of a. need each bn once, , want avoid doing bn = bn.copy(order='c') i don't want rewrite code such that a = numpy.ones((5,1024,1024)) is there faster, cheaper way bn doing copy? background: i want hash each slice of every a , using import hashlib hashlib.sha1(a[:, :, n]).hexdigest() unfortunately, throw valueerror , complaining order. if there fast way hash want, i'd use it. as things stand, attempt coerce slice bn c contiguous order going create copy. if don't want change shapes you're starting (and don't need a in c order), 1 possible solution start array a in fortran order: >>> = numpy.ones((1024, 1024, 5), order='f') the slices f-contiguous: >>> bn = a[:,

javascript - How to distinguish between keyboard character's keycodes -

i making simple program binds each key character. noticed keycode of ' key same right arrow key. both 39. how can distinguish between these 2 (and other conflicts). please dont tell me use key combination right arrow. dont want that. alerter alerts code (ive tested , both give 39): <html><head> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <script type="text/javascript"> function code(e) { e = e || window.event; return(e.keycode || e.which); } window.onload = function(){ document.onkeypress = function(e){ var key = code(e); alert(key); }; }; </script> </head> <body> </body> </html>

php - Session Array not working -

so i'm creating array in session reason when try add stuff it, no longer array. i'm not sure happening. adding item if(!isset($_session['printsid']) && !isset($_session['printsnum'])){ $_session['printsid']=array(); array_push($_session['printsid'],$_get['itm']); $_session['printsnum']=array(); array_push($_session['printsnum'],$_get['num']); header('location: google.com'); } else{ array_push($_session['printsid'],$_get['itm']); array_push($_session['printsnum'],$_get['num']); header('location: http://www.repmofbla.com/simmonsredone/'); } getting item if(isset($_session['printsnum'])){ $cartitems = array_sum($_session['printsnum']); $cartitems += sizeof($_session['artwork']); } else{ $cartitems = sizeof($_session['artwork']); } any great. thank guys :) (i&

maven - Deploy as ROOT and SpringLoaded Hippo CMS -

spring loaded has been working fine me until switched deploy root. (to rid of "/site" in urls of website) i've modified original config brought jeroen here it's not working. (the files under ${project.basedir}/target/tomcat7x/webapps/root not updated , website referring outdated source instead of up-to-date ${project.basedir}/site/target/root ) what missing? my ${project.basedir}/pom.xml : <profile> <id>cargo.run</id> <build> <plugins> <plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-resources-plugin</artifactid> <executions> <execution> <id>copy-tomcat-resources</id> <phase>validate</phase> <goals> <goal>copy-resources</goal> </goals> <configuration> <outputdirectory>${

qliksense - Qlikview Current selections box to use labels rather than table.fieldnames -

Image
in qlik view document want change current selections information use label applied field rather table.field format. for example partstable.partno would be part number unfortunately there's no way in current selections object. however, may have alternatives depending on requirements. first of all, if you're happy seeing current selections text (rather having functionality of current selections object), can create text object , use expression: =replace(getcurrentselections(), 'partstable.partno', 'part number') this below: the other alternative use rename statement in load script after table loads complete. rename allows rename single field or collection of fields using mapping table. syntax single field shown below: rename field oldname newname if should need rename more 1 field @ time, can expand to: rename field oldname1 newname1, oldname2 newname2,... more detail on syntax including using mapping table can found

ms access - SQL based on complex criteria -

i'm struggling sql statement i'm trying write in ms access , appreciate help. i have table: *************************** * attr1 * attr2 * attr3 * *************************** * * * 1 * * * b * 2 * * * b * 3 * * * c * 4 * * b * * 1 * * d * * 1 * * * * 2 * *************************** i need result this: *************************** * attr1 * attr2 * attr3 * *************************** * b * * 1 * * d * * 1 * * * * 2 * * * b * 3 * * * c * 4 * *************************** so, need in result rows attr1 not null, , other rows attr3 has different values in rows attr1 not null. i can in access in way make 1 query select rows attr1 not null, 1 "find unmatched" query select rows values in attr3 not included in first query, , make union of 2 queries... n

php - How can connect to two databases in same time and query data in mysql, I have same host -

i have 2 database, & b how can copy data b using mysql, did there wrong, there 2 same tables called members in & b, , want copy username a.members b.members. there error ! can using mysql, can me solve problem because must connect databases & b in same time query data mysql_connect("$host", "$user", "$pass"); mysql_select_db("a"); mysql_connect("$host", "$user2", "$pass2"); mysql_select_db("b"); //host = host b same host $mysql="select username a.members insert b.members"; $result= mysql_query($mysql); if connecting same host, need make connection once. , setting default database using mysql_select_db("a"); should not necessary because specifying database use in statement. the sql insert should be: insert b.members (username) select username a.members check out the documentation insert...select .

Ruby on Rails Nested Forms - Unpermitted Parameters: users_attributes -

when trying add users band using nested_form gem, unable access users params. after investigation noticed getting unpermitted parameters error in console. need access users_attributes can search users in database display name in controller. (so nested_form add users in database, if there better way this, please let me know) here error rails console: started patch "/band_steps/videos" 127.0.0.1 @ 2015-04-29 01:59:03 -0400 processing bandstepscontroller#update html parameters: {"utf8"=>"✓", "authenticity_token"=>"oa16rrntw9tn/7n45jsjrg+q6vo8q+txryrhloksjys=", "band"=>{"users_attributes"=>{"0"=>{"display_name"=>"tyler", "_destroy"=>"false", "id"=>"330"}}}, "commit"=>"next", "id"=>"videos"} band load (0.2ms) select "bands".* "bands" "b

php - Removing a span with a specific class from HTML , but not the content using regular expression -

here sample html <div> <span class="target"> remove parent span class , save text </span> </div> here want above html following using regex function only <div> remove parent span class , save text </div> i have tried this: $html = preg_replace('#<h3 class="target>(.*?)</h3>#', '', $html); but didn't work. you matching wrong tag, h3 instead of span check signature of preg_replace, 2nd argument replacement, in case empty string. $html = preg_replace('/<(span)[^\>]+>(.*?)<\/\1>/i', '\2', $html); edit: noticed op wanted remove spans specific class $html = preg_replace('/<(span).*?class="\s*(?:.*\s)?target(?:\s[^"]+)?\s*"[^\>]*>(.*)<\/\1>/i', '\2', $html); this should cover spans number of attributes , classes , replace spans has class target.

C++: Correct syntax for friending a template type member of template parameter? -

i have class takes template type parameter (ttrait). want friend template type member alias of ttrait, can't figure out syntax. (is possible?). template <bool bbool> struct sfoo {}; struct strait { template <bool bbool> using tfoo = sfoo<bbool>; }; template <typename ttrait> struct sbar { template <bool bbool> friend typename ttrait::template tfoo<bbool>; }; sbar<strait> bar; clang's error (on friend line) is: error: friend type templates must use elaborated type i have tried exhausting possible combinations can think of: friend ttrait::tfoo; friend ttrait::template tfoo; friend typename ttrait::tfoo; friend typename ttrait::template tfoo; template <bool bbool> friend ttrait::tfoo; template <bool bbool> friend ttrait::tfoo<bbool>; template <bool bbool> friend ttrait::template tfoo; template <bool bbool> friend ttrait::template tfoo<bboo

javascript - Dropdown onclick, close on click -

previously got header dropdown displayed on hover. wanted change onclick. the dropdown displays onclick, when clicking again dropdown not close. close when mouse navigate off div. how can change this, dropdown open, , can closed clicking somewhere on website or on event? code: <a href="#header-cart" class="skip-link skip-cart <?php if($_cartqty <= 0): ?> no-count<?php endif; ?>"> <span class="icon"></span> <span class="label"><?php echo $this->__('cart'); ?></span> <span class="count"><?php echo $_cartqty; ?></span> </a> <div id="header-cart" class="block block-cart skip-content"> <div class="block block-progress opc-block-progress minicart-wrapper"> <div class="block-title-cartsidebar">shoppingcart</div> <p class="empty"><?php

ReactJS Flux Application directory structure -

my team working on large application being written in reactjs using facebook's flux architecture. still in infancy right going grow big soon. have more 50 small component views, plenty of actions, stores , action-creators. currently, our directory structure looks - app |___ module_1 | |___ components | | |___ component1.react.js | | |___ component2.react.js | |___ module1actioncreators.js | |___ module1constants.js | |___ module1store.js | |___ module_2 |___ ... (same structure above) one of problems approach module_x folders become increasingly large in number app grows. does have share how structured app? in our experience, facebook's example apps (todo , chat) have architecture suited small apps once stores, components , actions grow in number, becomes harder manage. thanks in advance. the usual directory structure more this: js ├── appbootstrap.js ├── appconstants.js ├── appdispatcher.js ├── actions │ ├── appactions.j

c# - Create relationship between User and Addresses (1-Many) and Order and Address (1-1) -

i have user class each user can have multiple addresses. i have order class each order can have 1 address. i have following code , getting cascade delete errors, prior getting foreign key constraint issues , have fixed these already. public class user : identityuser { public virtual icollection<purchase> purchases { get; set; } public virtual icollection<address> addresses { get; set; } } public class order { [key, foreignkey("user")] public string orderid { get; set; } public virtual user user { get; set; } [required, foreignkey("address")] public int addressid { get; set; } public virtual address address { get; set; } public virtual icollection<orderitem> items { get; set; } } public class address { public int id { get; set; } [required] public string userid { get; set; } public user user { get; set; } } i unsure wrong now, assume cascade issue attempt implement 1-1 , 1-many

c# - How to find all unused properties in Entity Framwork model -

i have model many tables , columns , want clear it, searching unused columns. it's not possible 1 one searching references. there's way that? you can use resharper remove unused stuff.

sql - Linq Performance with predicates -

i'm refactoring project @ moment, has lot of similar queries on page db.wf_process.where(x=>x.workflowprocessstate == (int)workflowprocessstateenum.subtitlefileversion && x.workflowprocesssubstate == (int)subtitlefileprocessenum.subtitleqcreferred).count(); db.wf_process.where(x=>x.workflowprocessstate == (int)workflowprocessstateenum.subtitlefileversion && x.workflowprocesssubstate == (int)subtitlefileprocessenum.qcuserfailed).count(); this produces following sql runs quick select [groupby1].[a1] [c1] ( select count(1) [a1] [dbo].[wf_process] [extent1] (4 = [extent1].[workflowprocessstate]) , (119 = [extent1].[workflowprocesssubstate]) ) [groupby1] //repeat above queries 100 different enum values to clean code bit i've refactored below method private int getsubtitleprocesscount(func<wf_process, bool> predicate) { return db.wf_process.where(x => x.workflowprocessstate == (int)

xcode - New iTunes Connect - No suitable application records were found. Verify your bundle identifier -

Image
i have been thru posts on 1 , nothing seems help. no matter changes make or else do, getting this: most of (old) answers seem revolve around 'changing applications status waiting upload.' in new itunes connect cannot change status manually far can see. things have done: verified bundle id correct. surfed google , stackoverflow until want belt out string of expletives long suck air current zip code in thereby causing natural disaster of epic proportions. verified provisioning profile contains bundle id. verified , re-verified seems correct. i using xcode 6.3.1. i know missing somewhere. have other apps on appstore, not complete noob, first 1 under new itunes connect. know missing tired of beating head against wall, hoping community help. seems needed walk away. hadn't received response question yet, decided refocus on problem ... solved within 30 seconds. pros i no longer want punch kittens in face ;) cons i deserve flamage. answer

node.js - Sails.js Waterlock /auth/register causes error 500 -

in trying make waterlock not create new user on login. when set createonnotfound false , try use http://localhost:1337/auth/register?email=a@s.d&password=12345678 register new user. i've got 500 error: error: sending 500 ("server error") response: typeerror: undefined not function @ object.module.exports (d:\temp\sails-waterlock\node_modules\waterlock\lib\controllers\actions\register.js:25:44) @ bound (c:\users\sandres\appdata\roaming\npm\node_modules\sails\node_modules\lodash\dist\lodash.js:729:21) @ routetargetfnwrapper (c:\users\sandres\appdata\roaming\npm\node_modules\sails\lib\router\bind.js:179:5) @ callbacks (c:\users\sandres\appdata\roaming\npm\node_modules\sails\node_modules\express\lib\router\index.js:164:37) @ param (c:\users\sandres\appdata\roaming\npm\node_modules\sails\node_modules\express\lib\router\index.js:138:11) @ param (c:\users\sandres\appdata\roaming\npm\node_modules\sails\node_modules\express\lib\router\index.js:135:11) @ pass (c:\us

javascript - Setting CSS Animation Iteration Count using jQuery -

i created plugin called bootstrap notify . recommend using animate.css control animations of notifications. reported issue glyphicons pro notification repeat animate enter , exit animations animate.css. brought attention cause of issue because both animate.css , glyphicons pro use similar class called animated . animate.css not set animation-iteration-count defaults 1 whereas glyphicons pro sets animation-iteration-count infinite . i trying force plugin set animation-iteration-count 1 notification not repeat it's animation on , on again. using jquery set css of notification. i tried use var css = { animationiterationcount: 1 } i have tried var css = { webkitanimationiterationcount : 1, animationiterationcount: 1 } then later set notify css $notify.css(css) but if inspect notification on website notice animation-iteration-count not set. just figured out if set using javascript instead of jquery appears work fine. fo

c - bit-declaration - undefined reference to 'variable' -

i have problem , hope, me. try make can-communication between 2 dspic30f4011. works. have make identifier. have use sid , eid. divided 4 parts. want make bit-declaration , error. made new header-file #ifndef identifier_h #define identifier_h #ifdef __cplusplus extern "c" { #endif #ifdef __cplusplus } #endif #endif /* identifier_h */ #include <p30f4011.h> #include "system.h" #include <p30fxxxx.h> typedef struct tagcxtxxsidbits{ unsigned : 11; unsigned prio4_0 : 5; }cxtxxpriobits; extern volatile unsigned int c1tx0prio __attribute__((__sfr__)); extern volatile cxtxxpriobits c1tx0priobits __attribute__((__sfr__)); extern volatile unsigned int c1tx1prio __attribute__((__sfr__)); extern volatile cxtxxpriobits c1tx1priobits __attribute__((__sfr__)); extern volatile unsigned int c1tx2prio __attribute__((__sfr__)); extern volatile cxtxxpriobits c1tx2priobits __attribute__((__sfr__)); in code want write ... ... c1tx0prio

Asp.Net MVC login form not working on chrome and firefox -

i have login form in mvc working on ie when using chrome , firefox , click on log in(after entering appropriate credentials),the page gets refreshed , and lands on same login page. validations working fine though. @using (html.beginform("logonstepone", "account", formmethod.post, new { @class = "registration-form" })) { <div class="form-field inputfieldlogin top"> <label for="accountnumber"> account number @html.textboxfor(m => m.accountnumber, new { pattern = "[0-9]*", title="please provide account number",maxlength=maxaccountlength,autocomplete = "off" }) </div> <div class="form-field inputfieldlogin bottom"> <label for="pincode"> password @html.passwordfor(m => m.pincode, new { pattern = "[0

javascript - jquery post form and variables together -

i used code send form + variable php-script. function upload() { var test = "test"; var infos = $('form').serialize() + '&' + test; $.post("ajax.php", { infos: infos }).done(function (data) { alert(data); }); } now php-code: $data = $_post['infos']; echo $data; returns: formfield1=value1&formfield2=value2&formfield3=value3&test all values in variable... how can use them seperatly php? for example: $data = $_post['formfield1']; didn't worked :( use jquery's serializearray() . return array of objects contain 2 properties: name , value. can parse , pass data. it this var formdata = = $('form').serializearray(); var infos = { }; (var = 0; < formdata.length; i++) { infos[formdata[i].name] = formdata[i].value; } // add separate values, add them `infos` infos.newitem = "new value"; $.post("ajax.php", infos).done(function (data) { al

c - Using dup2 from file to another file -

i'm trying execute command sort < in.txt > out.txt, using dup2. code: int fdin = open("in.txt",o_rdwr); int fdout = open("out.txt",o_rdwr); dup2(fdin,fdout); //close(fdin); //close(fdout); //execvp... how dup2 work? can't it... thank you! the way use closes fdout again, removing connection fdout , , connects fdin . if fdin , fdout are, maybe, 4 , 5, both 4 , 5 point in.txt . rather that, should dup2(fdin, 0) // 0 point same fdin dup2(fdout, 1) // 1 point same fdout close(fdin); // don't need these longer - if not 0 or 1! should checked. close(fdout); execvp(...); there other pitfalls taken care for, however. example, should fork() before 1 if want process go on does. why comment @ close() above? well, when process hasn't fd 0 and/or 1 open (what unusual, not impossible), fdin might 0 or 1 , fdout might 1. these situations have cope with. an better way be if (fdin > 0) { dup2(fd