Posts

Showing posts from March, 2012

node.js - How to send HTTP requests to the v8 debugger? -

the v8 javascript engine implements this debugger protocol. start v8 (node.js) , can connect through browser open port (5858). format of request needs send v8 debugger? is or post? the thing mentioned page says is: "each packet [...] transmitted string value" give me please 1 example request made 1 of: curl, node.js, or browser. you use node-inspector sample. the relevant files should in https://github.com/dannycoates/node-inspector/tree/master/lib the debugger not use http. don't know curl need send content-length , json without http headers.

python - Writing to csv file via django is adding the module name in the first cell of the file header -

i trying write csv file django given list of headers , various data. file being created 1 exception, first cell showing module info right before value of header , i'm not sure why. read documentation related csv file outputting , modeled code after indicated below: file_name = '%s_success.csv' % file_name response = httpresponse(csv, content_type='text/csv') response['content-disposition'] = 'attachment; filename=%s' % file_name c = csv.writer(response) headers = ['foo', 'bar', 'abc', '123'] c.writeheader(headers) row in data: ... ... result: <module 'csv' '/usr/local/lib/python2.7/csv.pyc'>foo, bar, abc, 123 i want: foo, bar, abc, 123 what should change? it looks you're including module in response: response = httpresponse(csv, content_type='text/csv') just try response = httpresponse(content_type='text/csv')

node.js - How do I setup MongoDB database on Heroku with MongoLab? -

i'm using express.js , mongolab , followed heroku setup mongodb working in production throwing code in app.js . //mongo on heroku setup var mongo = require('mongodb'); var mongouri = process.env.mongolab_uri || process.env.mongohq_url || 'mongodb://localhost/mydb'; mongo.db.connect(mongouri, function (err, db) { db.collection('mydocs', function(er, collection) { collection.insert({'mykey': 'myvalue'}, {safe: true}, function(er,rs) { }); }); }); and have following routes , field email form (also in app.js): //routes app.get('/', function(req, res) { res.render('index', { title: 'dumbyapp' }); }); //save new email app.post('/', function(req, res){ emailprovider.save({ address: req.param('address') }, function( error, docs) { res.redirect('/') }); }); this renders new form on index page , lets me save locally not in pro...

python - Different results when using sklearn RandomizedPCA with sparse and dense matrices -

i getting different results when randomized pca sparse , dense matrices: import numpy np import scipy.sparse scsp sklearn.decomposition import randomizedpca x = np.matrix([[1,2,3,2,0,0,0,0], [2,3,1,0,0,0,0,3], [1,0,0,0,2,3,2,0], [3,0,0,0,4,5,6,0], [0,0,4,0,0,5,6,7], [0,6,4,5,6,0,0,0], [7,0,5,0,7,9,0,0]]) csr_x = scsp.csr_matrix(x) s_pca = randomizedpca(n_components=2) s_pca_scores = s_pca.fit_transform(csr_x) s_pca_weights = s_pca.explained_variance_ratio_ d_pca = randomizedpca(n_components=2) d_pca_scores = s_pca.fit_transform(x) d_pca_weights = s_pca.explained_variance_ratio_ print 'sparse matrix scores {}'.format(s_pca_scores) print 'dense matrix scores {}'.format(d_pca_scores) print 'sparse matrix weights {}'.format(s_pca_weights) print 'dense matrix weights {}'.format(d_pca_weights) result: sparse matrix scores [[ 1.90912166 2.37266113] [ 1...

How can I pass an expression to a calc() mixin that uses Sass variables -

i have mixin set cross browser calc, @mixin calc($property, $expression...) { #{$property}: -moz-calc(#{$expression}); #{$property}: -o-calc(#{$expression}); #{$property}: -webkit-calc(#{$expression}); #{$property}: calc(#{$expression}); } i have variable. $line: 12px; i want able use variable within it. @include calc(width, "30% - ( $line * 2) ) "); but i'm not sure if that's best way go it. you'll need use string interpolation on value you're passing mixin: .foo { @include calc(width, #{"30% - #{$line * 2}"}); } output: .foo { width: -moz-calc(30% - 24px); width: -o-calc(30% - 24px); width: -webkit-calc(30% - 24px); width: calc(30% - 24px); }

java - My multi threaded server is not working -

hi trying make multi threaded server client app server resends upper cased version of string sent client, here 3 classes: the server class: package q2; import java.net.*; import java.io.*; public class server { public static void main(string[] args) throws ioexception { serversocket serversocket = null; try { serversocket = new serversocket(10118); } catch (ioexception e) { system.err.println("on ne peut pas écouter au port: 10118."); system.exit(1); } //socket clientsocket = null; system.out.println ("le serveur est en marche, attente de la connexion....."); try { multith mt = new multith(serversocket.accept()); thread t = new thread(mt); t.start(); //clientsocket = serversocket.accept(); } catch (ioexception e) { system.err.println("a...

Rails integration tests. Testing for actual pages -

when using automated tests test custom routes work, this: test "that /logout route opens logout page" '/logout' assert_response :success end or test "that /logout route opens logout page" '/logout' assert_response :redirect end enough test? mind seems bit vague. how write test explicitly verify /logout route going logout page/the user served logout view? i suggest rspec/rails , capybara integration , or acceptance tests. these tests more descriptive , sounds may asking about. example, spec describing authentication process describe "signin" before { visit signin_path } describe "with invalid information" before { click_button "sign in" } { should have_selector('title', text: 'sign in') } { should have_selector('div.alert.alert-error', text: 'invalid') } describe "after visiting page" before { click_link "...

java - How do I schedule a print statement upon completion of 4 independent threads? -

i have simple java application calculates prime numbers user-given number , prints out numbers. i've built upon include 4 separate threads iterate through 4 separate ranges of numbers. once 4 threads have completed iterations want print final arraylist. i'm getting concurrentmodificationexception because after start 4 threads, next line of code print statement trying print arraylist @ moment being modified @ least 1 of still active threads. therefore, want able have print statement execute after 4 threads have died. furthermore, without using spinning loop. have nothing in particular against using spinning loop except imagine there better way , have assign greater priorities 4 threads in order prevent spinning loop using significant amount of cpu. use countdownlatch . javadoc class tells how have the main thread creates latch number of threads. the main thread starts working threads. each thread has reference latch. it counts latch down when finishes wor...

notepad++ copy characters on every line and add to the end of every line -

i have list this: abc+133346thr+end abc+sdf465768+end abc+645646rte+end abc+564886rjrt+end abc+464686fnfg+end abc+5468466mfytr+end and want copy characters in middle of each line , paste on end of each lines, become this: abc+133346thr+end+133346thr abc+sdf465768+end+sdf465768 abc+645646rte+end+645646rte abc+564886rjrt+end+564886rjrt abc+464686fnfg+end+464686fnfg abc+5468466mfytr+end+5468466mfytr how notepad++ ? thank answering, got case still in same topic, more complicated. here is: <a href="http://domain.com/wp-content/uploads/2013/05/1080p-car-1024x640.jpg" target="_blank"><img src="http:// <a href="http://domain.com/content/images/2013/05/1080p-wall-1080x675-1024x640.jpg" target="_blank"><img src="http:// <a href="http://domain.com/content/images/2013/05/1080p-apers-1080x675-150x150.jpg" target="_blank"><img src="http:// and want make this: <a href=...

r - highlight every other row knitr+Rmd -

how can highlight every other row of table in knitr? output following .rmd white table rather every other row grey: ```{r setup, include=false} opts_chunk$set(cache=false) ``` <style> .mytable tr:nth-child(even) { /*(even) or (2n 0)*/ background: #eeeeee; } .mytable tr:nth-child(odd) { /*(odd) or (2n 1)*/ background: #ffffff; } </style> <table border=1 class="mytable"> <tr> <th> </th> <th> mpg </th> <th> cyl </th> <th> disp </th> </tr> <tr> <td align="right"> mazda rx4 </td> <td align="right"> 21.00 </td> <td align="right"> 6.00 </td> <td align="right"> 160.00 </td> </tr> <tr> <td align="right"> mazda rx4 wag </td> <td align="right"> 21.00 </td> <td align="right"> 6.00 </td> <td align="right">...

hibernate - Centos JBOSS deploy war file fail, cannot load the persistence.xml. Working on Windows 7 but not centos -

i have spent 2 days still can't solve problem. my problem i have war file using jpa , hibernate. when deploy on windows jboss 7.1.1 works prefect. however, when deployed on centos 5.8 jboss 7.1.1 throws exception. root cause common: caused by: javax.persistence.persistenceexception: no persistence provider entitymanager named xx i have no idea why works differently in 2 os. having jdk7 update 21 on both machines. development machine: windows 7(64bit), eclipse ide, jdk7_21 deployment machine: centos 5.8(64bit), i have try using classloader loader = thread.currentthread().getcontextclassloader(); enumeration<url> resources1 = loader.getresources("/meta-inf/persistence.xml"); url seurl = resources1.nextelement(); however, works on windows 7, on centos didn't persistence.xml , throws nosuchelement exception when calling .nextelement() . have place meta-inf folder resoures , when deployed placed in location xx.war/web-inf/classes/meta-inf/persis...

Creating a 3D matrix with R? -

Image
i'm trying build 3d matrix looping variables in large data set (please see 'head' of data below). specifically, need create matrix many rows maximum number of 'lastfixes', many columns there subjects (sub = 36) , many pages there conditions (i.e., 8), , want assign 1s in row start of fixstart until end of fixend, , 0s end of fixend until start of fixstart , on , forth. example, first rows of data, need have 1s in first 165 rows of matrix , 0s row# 166 until 330. r code works, strangely, numbers other 0s , 1s in matrix! below can see 'head' , r code. grateful if me fix problem. many thanks enter code here head (data) sub item condition fixstart fixend 1 1 4 7 1 165 2 1 4 7 331 600 3 1 4 7 623 1180 4 1 4 7 1202 1487 5 1 4 7 1511 1561 6 1 4 7 1696 2466 lastfix <- max(data$fixend) datamatrix<-array(0,dim=c(lastfix,36,8)) (...

c++ - What is this compiler error when using a lambda as a template parameter? -

edit: this has been reported vs2012 c++ compiler bug on microsoft connect (link) . nov. 11, 2014: microsoft has responded saying fix bug should show in next major release of visual c++. i've been struggling vs2012 compiler error message don't understand, trimmed down problem seems bare minimum. i'm building following main.cpp using vs2012: #include <utility> template <typename t> struct { t x; a(a&& other) : x(std::move(other.x)) { } a(t&& x) : x(std::move(x)) { } }; template <typename t> a<t> build(t&& x) { return a<t>(std::move(x)); } int main(int argc, char* argv[]) { auto f = []() { return build([](){}); //error here }; return 0; } the salient point i'm trying use lambda template type t of build function. error message is: 1> main.cpp 1>c:\test\main.cpp(21): error c2664: 'a<t>::a(a<t> &&)' : cannot convert parame...

asp.net web api - Looking for recommendations on using a logging module for WebAPI -

i'm looking recommendations on using logging module webapi. log4net seems staple logging library, i've heard elmah great well. of actively building webapis, logging module use? do have recommendations and/or list of pros/cons logging library use? i use elamh.mvc since integrates elmah base mvc project comprises webapi platform. project availble nuget package , , recommend using means add project. i using elmah because simple integrate , has flexible logging targets (xml files, database, etc.) elamh.mvc package great b/c handles integration painlessly. in case of wanting consolidate/aggregate multiple elmah logs, recommend looking elmahr .

iphone - Why is my VBO updated on 2nd click? -

i have method (invertpolygonmesh) takes array (my vbo) , inverts vertices along z axis. method directly invoked click of button (ibaction). odd reason vbo doesn't change on first click, inverted on every subsequent click after 1st one. why there no update 1st click? method below: -(void)invertpolygonmesh { nslog(@"invert mesh data."); glbindbuffer(gl_array_buffer, _vertexbufferphoto); glbufferdata(gl_array_buffer, sizeof(g_meshvertexdata), g_meshvertexdata, gl_dynamic_draw); int index = 0; bool edgecase = false; (int row = 0; row < map_size; row += step_size) { (int col = 0; col < map_size; col += step_size) { g_meshvertexdata[index].vertex.z = 255 - g_meshvertexdata[index].vertex.z; ++index; } } } i fixed calling glbindbuffer , glbufferdata functions after mesh vertices have been updated. resolved !!!

javascript - Media queries for dynamically added images -

i have added images dynamically on page using js code this: if (doorcount == 1) { $("#doorframe").html('<img src="content/image/door2unopenedlight.jpg" />'); $("#map1").html('<img src="content/image/map2light.jpg" />') } else if (doorcount == 2) { $("#doorframe").html('<img src="content/image/door3unopenedlight.jpg" />'); $("#map1").html('<img src="content/image/map3light.jpg" />') } and on. the #doorframe , #map1 divs have fixed sizes match sizes of jpeg images have right , looks fine on desktop/laptop sized screen. however, want use media queries rendering same page on smaller screens. know how same else on page how go altering size of these dynamically added images scale according screen size? you can tell images scale width of containing element. e.g. img {width: 100%;} just wrap in media query applies want to.

error handling - No matching function call in C++ -

i'm getting error of 'no matching function call' ideas why? in advance. #include <iostream> #include <string> using namespace std; void redactdigits(string & s); int main(int argc, const char * argv[]) { redactdigits("hello"); return 0; } void redactdigits(string & s){ double stringlength = 0; string copystring; stringlength = s.size(); (int = 0; < stringlength + 1; i++) { if (atoi(&s[i])) { copystring.append(&s[i]); } else { copystring.append("*"); } } s = copystring; cout << s; } you missing void in function declaration. furthermore, need pass const reference, able bind temporary: void redactdigits(const string & s); ^^^^ ^^^^^ without const , call illegal: redactdigits("hello"); although compilers have non-standard extensions allow non-const references bind temporaries. edit : since attempting modify input ...

ruby - Why does .all? return true on an empty array? -

using ruby want evaluate items in array, , return true if pass conditional test. i can using e.g. array.all? { |value| value == 2 } so: > array=[2,2] > array.all? { |value| value == 2 } => true > array=[2,3] > array.all? { |value| value == 2 } => false great! but, why empty array pass test? > array=[] > array.all? { |value| value == 2 } => true shouldn't return false? and if need return false, how should modify method? in ruby can never loop on empty collection (array, hashes, etc.), in case block never gets executed. , if block never gets executed, all? returns true (there no condition make result false). read all? in the ruby documentation . you can achieve goal by !array.empty? && array.all? { |value| value == 2 }

Blur Activity Background with Swipe in android -

i need blur activity background when swipe right left , left right. have read blur or dim background when android popupwindow active , dim background flag_dim_behind . can't use because use dim behind current window. in case there no other windows. in app, changes on same activity swipe gesture. how can ? for dimming activity.... getwindow().getattributes().windowanimations=r.style.pausedialoganimation; getwindow().getattributes().flags=windowmanager.layoutparams.flag_dim_behind; getwindow().getattributes().dimamount=0.5f;

android layout - How to add typeface in eclipse -

Image
how add typeface in eclipse can use in our application. have read provided typeface in inbuilt typeface android http://developer.android.com/reference/android/graphics/typeface.html typeface static fields. is there way add typeface here i used own font in android application follows, put font file .ttf assets folder. then create object of typeface as, mtypeface = typeface.createfromasset(getassets(), ttffilename); and set type face ui elements as, findviewbyid(r.id.nametextview).settypeface(mtypeface, typeface.bold);

dynamic - Expression and delegate in c# -

i have below code pseudo-code. want make function can accept expresstion type, compile expression , invoke proper parameters. public static void f<t>(expression<t> exp, params dynamic[] d) { console.writeline("begin"); exp.compile().invoke(d[0],d[1].....);//this pseudo-code console.writeline("end"); } i'm sure t action type. (t can action , action<int> ,etc.). parameter d array of dynamic type, sent invoke. but don't know how finish code. i'm sure that's not easy implement it. perhaps can't true in c# you can't use invoke unless know exact signature. can, however, use dynamicinvoke , example: ((delegate)exp.compile()).dynamicinvoke(d); note dynamic in above serves no purpose - d object[] . the other, more complicated, approach - compile func<object[]> , , re-write expression ( expressionvisitor ) replace "parameter n" (from original exp ) p[n] , p single parameterexp...

php - How to display the images from a mysql database? When I tried to display images, its showing only the name of that images -

i retrieve images mysql table. getting images icons only. please me solve this. <?php include 'config.php'; $query = mysql_query("select * addproduct"); echo "<table border='1'> <thead> <th>product</th> <th>price</th> <th>quantity</th> <th>image</th> </thead>"; while ($row=mysql_fetch_array($query)) { echo "<tr>"; echo "<td>".$row['addproduct']."</td>"; echo "<td>".$row['quantity']."</td>"; echo "<td>".$row['price']."</td>"; //header("content-type: image/jpeg"); //echo $row['image']; //echo "<td><img src=".$row['image']."</td>"; echo "<td>...

Memory management scope in C/C++ -

when freeing memory in c , c++, need memory address or require specific variable? so if such as: int* test() { int* x = new int(5); return x; } int main(int argc, char** argv) { int* y = test(); delete y; return 0; } would cause memory leaks? thanks! no, there wouldn't leaks there, again, neither there in int test() { return 5; } int main(int argc, char** argv) { int y = test(); return 0; } avoid dynamic allocation if can.

sql server 2008 - How to select a column from one table and two columns from another table when both the tables have no relation in T-SQL? -

i explain problem simple possible. have written select query query1 on table1 gives me following result select * table1 typeid=1 id column1 column2 typeid 1 a 1 2 b b 1 3 c c 1 i have table table2 has data in following format id column1 column2 1 0 0 1 1 1 2 2 2 2 3 3 2 4 4 3 5 5 3 6 6 i have written select query query2 on table1 gives me following result select * table1 typeid=2 id column1 column2 typeid 4 a 2 5 b b 2 6 c c 2 table1 , table2 have no column in common , data in column1 , column2 both typeid's in table1 same , data in table2 has data values of id column table1 id's 1,2,3 , want write select query select same data table2 values of id column table1 typeid 2 have given below id column1 column2 4 0 0 4 1 1 5 2 2 5 3 3 5 4 4 6 5 5 6 6 6 how can achieve writing select query in sql server? select t1.column1, isnull(t2.column2,0) col...

vb.net - How to remove duplicates rows out of table where certian field is equal to specified -

Image
hi have matching application matches 2 fields using jaro algorythms. how can remove following : please see image link below understand question :) thanks assuming "keep row highest match str1" this declare @t table (str1 varchar(50), str2 varchar(50), match decimal (5,2)); insert @t values ('abc elec', 'abc elec', 100), ('abc elec', 'abb elec', 95), ('abc elec', 'abc elek', 92.5), ('abc elec', 'abf elec', 91.5), ('abc elec', 'add elek', 95.5), ('bbc invest', 'bbc domest elec', 85.94); delete x ( select str1, str2, row_number() on (partition t.str1 order t.match desc) rn @t t ) x rn > 1; select * @t t;

parallel processing - Minimising number of calls to std::max in nested loop -

i'm trying reduce number of calls std::max in inner loop, i'm calling millions of times (no exaggeration!) , that's making parallel code run slower sequential code. basic idea (yes, assignment) code calculates temperature @ gridpoint, iteration iteration, until maximum change no more certain, tiny number (e.g 0.01). new temp average of temps in cells directly above, below , beside it. each cell has different value result, , want return largest change in cell given chunk of grid. i've got code working it's slow because i'm doing large (excessively so) number of calls std::max in inner loop , it's o(n*n). have used 1d domain decomposition notes: tdiff doesn't depend on what's in matrix the inputs of reduction function result of lambda function diff greatest change in single cell in chunk of grid on 1 iteration blocked range defined earlier in code t_new new temperature grid point, t_old old one max_diff = parallel_reduce(range, 0.0, ...

Java. How to append text to top of file.txt -

this question has answer here: writing in beginning of text file java 5 answers i need add text beggining of text file via java. for example have test.txt file data: peter john alice i need add(to top of file): jennifer it should be: jennifer peter john alice i have part of code, append data end of file, need make added text top of file: public static void irasymas(string irasymai){ try { file file = new file("src/lt/test.txt"); if (!file.exists()) { file.createnewfile(); } filewriter fw = new filewriter(file.getabsolutefile(), true); bufferedwriter bw = new bufferedwriter(fw); bw.write(irasymai+ "\r\n"); bw.close(); } catch (ioexception e) { e.printstacktrace(); } } i hav...

plugins - CKEditor 4 : Templates and allowedContent set in the config.js -

is there way of setting allowedcontent property true given plugin within config.js file? i've downloaded minified, full version of ckeditor, has each plugin minified in main ckeditor.js file , plugin folders hold supporting files - hence need set within config.js file. i know can set globally using config.allowedcontent = true, possible on per plugin basis? you can download ckeditor-dev on github here edit plugins , build ckeditor release : ./dev/builder/build.sh a "release ready" working copy of development code built in new dev/builder/release/ folder.

javascript - Adipoli jQuery Image Hover Effects don't work -

i have problem adipoli plugin - doesn't want work though have done seems correct. code follows: head section: <script src="js/jquery-1.7.2.min.js"></script> <script src="js/jquery-ui-1.10.3.custom.min.js"></script> <script src="js/lightbox.js"></script> <script src="js/slider.js"></script> <script src="js/jquery.adipoli.min.js"></script> <script> $('.shadow').adipoli({ 'starteffect' : 'normal', 'hovereffect' : 'popout' }); </script> content section: echo '"<a><img class="shadow" src="photos/thumbs/thumb_'.$image['filename'].'" alt="" /></a>'; along adipoli hover effect, want make simple css drop shadow effect , works in comparison hover effect. lightbox , slider script work well. useful ideas appreciated, useful ones. ;-...

php - i have 3 if statment that include 3 queries related to each other by foreign keys the system display error message how to fix it? -

i have 3 if statment query 3 tables , each table have foreign key table before problem system not take foreign of other table (id) instead make value 0 the idea behind code user enter gov name , click add system insert gov name ......if user enter dist name without entering gov name system display error msg else system insert both value ( but in dist table in governorate_id field system enter 0 not right id of governorate id ) when try enter $dist in third system display undefined variable: dist in . so how fix error ?? code: if(isset($_post['add'])) { if(isset($_post['gov']) || isset( $_post['dist']) || isset($_post['city']) || isset( $_post['lat']) || isset($_post['long']) == "" ) { $errormsg = "you must fill 1 of these fields befor submit!!"; } if($_post['gov']) { $gov = $_post['gov']; $sql = mysql_query("ins...

c++ - Qt ActiveX data types -

i developing c++/qt application communicates activex server. try use function returns reference array of floats parameter. function prototype is: frequencies([in, out] safearray(float)*) my code is: qlist<qvariant> variantlist; object->dynamiccall("frequencies(qlist<qvariant>&)", variantlist); but unfortunately have following error: type mismatch in parameter. pass array of type string or real. after reading this document tried qlist<qstring>& , qlist<float>& no success. the documentation of activex server says: use safearray of strings (vt_bstr) or reals (vt_r8 double or vt_r4 float). any idea? thanks! http://qt-project.org/doc/qt-4.8/activeqt.html the activeqt modules part of qt commercial edition , open source versions of qt. http://qt-project.org/doc/qt-4.8/qaxobject.html#details http://qt-project.org/doc/qt-4.8/qaxbase.html#details here quote documentation qaxbase : to call methods of...

vbscript to change drive letter -

want change drive letter of volumes. once script run should show partitions in pop box , ask new drive letters. used below code changing d q strcomputer = "." set objwmiservice = getobject("winmgmts:" _ & "{impersonationlevel=impersonate}!\\" & strcomputer & "\root\cimv2") set colvolumes = objwmiservice.execquery _ ("select * win32_volume name = 'd:\\'") each objvolume in colvolumes objvolume.driveletter = "q:" objvolume.put_ next

javascript - Dynamically add markers on changed map - Google Maps API -

i have google map markers retail locations are. it works fine. if user change map focus drag , drop (change map extract) want add dynamically new markers if in map extract shop. i have no idea, find such example or else. first of need load initial batch of markers , listen "bounds_changed" event. when event fires new coordinates , zoom level , load markers accordingly. you can find example here: https://developers.google.com/maps/documentation/javascript/events google.maps.event.addlistener(map, 'bounds_changed', function() { //get new location , zoom parameters //and print new markers });

What's the difference between 'git merge' and 'git rebase'? -

Image
what's difference between git merge , git rebase ? suppose there 3 commits, a , b , c : then developer dan created commit d , , developer ed created commit e : obviously, conflict should resolved somehow. this, there 2 ways: merge : both commits d , e still here, create merge commit m inherits changes both d , e . however, creates diamond shape, many people find confusing. rebase : we create commit r , actual file content identical of merge commit m above. but, rid of commit e , never existed (denoted dots - vanishing line). because of obliteration, e should local developer ed , should have never been pushed other repository. advantage of rebase diamond shape avoided, , history stays nice straight line - developers love that!

http - how to create 400 bad request so that I can verify a feature -

currently doing work handle 400 bad request status error. wondering how create request server return 400 status. a http 400 error occurs due bad syntax in request. to create request forces server return 400 error, can: open tcp connection port 80 on server send junk observe response.

c# - The templates had the following errors when running -

Image
when try add typed view in asp.net mvc 3, following error: i restarted visual studio, rebuild project, tried again add view , got following: my model: public class simplemodel { public int id { get; set; } public string name { get; set; } public bool isactive { get; set; } } my controller: public class testcontroller : controller { public actionresult test() { return view(new simplemodel()); } } the problem environment-wide (i created new project , tried add view, same result) , not solved restarting visual studio or development machine. edit: reinstalling asp.net , web tools 2012.2 solved problem. using process monitor , i've found, @ least on machine, visual studio loads system.componentmodel.dataannotations.dll gac: 12:43:12.6470833 pm devenv.exe 772 load image c:\windows\microsoft.net\assembly\gac_msil\system.componentmodel.dataannotations\v4.0_4.0.0.0__31bf3856ad364e35\system.componentmodel.dataannotations.d...

CSS inline svg background in select with firefox -

i building custom select tag inline svg background using -webkit-appearance: none in css. http://jsfiddle.net/sucrenoir/yhr53/5/ select { font-size: 30px; border: 1px solid lightblue; border-radius: 10px; color: black; padding: 12px; width: 300px; -webkit-appearance: none; background:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='50px' height='50px'><polyline points='46.139,15.518 25.166,36.49 4.193,15.519'/></svg>") right no-repeat; background-color: lightblue; background-transparency: 0.5; background-position: right 15px top 22px; background-size: 18px 18px; } it not work in firefox (obviously). what equivalent of -webkit-appearance: none in firefox work ? thank in advance unfortunately answer no @ moment. according mdn doc , it's not recommended use it's buggy.

classpath mess when deploying war with org.eclipse.jetty.server.Server -

i using org.eclipse.jetty.server.server start jetty , deploy war. have this: class runner { private static void run(string[] arg) { server server = new server(); ... server.sethandler(webapp); server.start(); } } i got problem classpaths: seems webapp's classpath contains (inherit) classpath of runner class. for example if have spring service com.my.myclass1 in classpath of runner (not in webapp classpath) , inside wepapp run spring scanning pacage "com.my" spring find , try create bean myclass1 . is correct behavior servlet container (jetty)? possible configurate jetty not have such behavior?

html5 css 3d transforms and div stacking like an accordion -

i stack divs in vertical stack above each other, , apply css3 3d transforms 'fold' them in slightly, however, when try this, can transform divs rotate on x axis, after rotation there gap between each of divs because divs not collapse in on each other, can achieved? as example: http://www.papercraftsforchildren.com/wp-content/uploads/2010/04/garland2.jpg image shows after (although horizontal, not vertical). i hope makes sense. edit: here code (work in progress): .stripcontainer { width: 80px; -webkit-transform-style: preserve-3d; -webkit-animation: spin 10s infinite linear; } .edge_a { float: left; width: 20px; -webkit-transform: rotatex(0deg) rotatey(0deg) rotatez(0deg) translate3d(0px, 0px, 0px) } .edge_b { float: left; width: 20px; -webkit-transform: rotatex(0deg) rotatey(15deg) rotatez(0deg) translate3d(0px, 0px, 0px) } .edge_c { float: left; width: 20px; -webkit-transform: rotatex(0deg) rotatey(30deg) rotatez(...

c# - @Html.Action MVC 4 with QueryString Parameters -

i have question related html.action in mvc 4 want pass querystring variables details view the code have system.text.stringbuilder mobiledata = new system.text.stringbuilder(); mobiledata.appendformat("<a style=\"text-align:left;\" data-role=\"button\" onclick=\"window.location='" + @url.action("taken_detail", new { id = tk.id }) + "';\" data- ajax=\"true\" data-icon=\"alert\"><span class=\"agenitems\">{1:dd-mm-yyyy}</span>", tk.id, tk.datum); the problem redirect me localhost/projectname/home/taken_detail/2 want home/taken_detail?id=2 missing here starting learn mvc 4, every tip welcome. this because routes contain id parameter. remove routes , url.action change url , add parameter query string. example: routes.maproute("default", "{controller}/{action}/{id}", new { controller = "home", action = "index...

C++ library - Using Quadprog++ and Array.hh -

i'm trying use quadprog++ library ( http://quadprog.sourceforge.net/ ) there no documentation it. in particular i'm trying exponential of matrix function of array.hh ( http://bit.ly/za0k1j ) have no idea how write it. thought write in way: matrix<double> a; a.resize(4,4); a=a^2; but doesn't work. lot help!

blackberry - swipe event for page? -

i have got page in qml , have implemented new logic (function back()) button on page. want, logic run after swiping page screen. best way it? onpeekended event not suitable situation, because fires when swiping canceled. thanks. paneproperties: navigationpaneproperties { backbutton: actionitem { ontriggered: { back(); } } } when push new page screen using navigationpane, onpoptransitionended() signal fired after page dismissed, either button or because user swiped away. can add slot signal controller, , put logic there. there no need implement manual button functionality here. of free.

sql - Problems with group by and order by -

hi newbie world of sql struggling of basics work. i have set of data looks this: table name: sample project work order amount ----------------------------------------- 111 100 222 b 200 111 c 300 444 d 400 111 e 500 666 f 600 i want end looking this: table name: sample project work order amount project amount -------------------------------------------------------- 111 e 500 900 111 c 300 900 111 100 900 666 f 600 600 444 d 400 600 222 b 200 200 sorted project greatest total amount group not work me groups projects one, can'...

android - Proguard - Can't find any super classes -

i'm getting error: unexpected error while performing partial evaluation: class = [org/apache/log4j/chainsaw/main] method = [<init>()v] exception = [java.lang.illegalargumentexception] (can't find super classes of [org/apache/log4j/chainsaw/loadxmlaction] (not immediate super class [javax/swing/abstractaction])) error: can't find super classes of [org/apache/log4j/chainsaw/loadxmlaction] (not immediate super class [javax/swing/abstractaction]) part of proguard configuration: -dontwarn javax.jms.** -dontwarn com.sun.jdmk.comm.** -dontwarn android.support.v4.** -dontwarn com.google.api.client.googleapis.extensions.** -dontwarn org.apache.harmony.** -dontwarn com.sun.** -dontwarn org.simpleframework.** -dontwarn com.google.android.gms.** -dontwarn org.apache.log4j.lf5.viewer.** -dontwarn java.beans.** -dontwarn org.apache.log4j.** -libraryjars 'd:\workspace\android\libs\acra-4.5.0.jar' -libraryjars 'd:\workspace\android\libs\activation....

wxpython - wx Python Gui start up too slow? -

the code below quite incomplete. want check stuff errors.... thing when compile it.... nothing happens after starts up. did wrong here? check task manager , see in background, gui never pops up. from wx import * import order o import orderitem oi import customer c import item class ordermain ( wx.frame ): def __init__( self, parent ): wx.frame.__init__ ( self, parent, id = wx.id_any, title = u"orders", pos = wx.defaultposition, size = wx.size( 517,486 ), style = wx.default_frame_style|wx.tab_traversal ) self.setsizehintssz( wx.size( -1,-1 ), wx.defaultsize ) bsizer3 = wx.boxsizer( wx.vertical ) #create order item here self.ord = o.order() self.list = wx.listctrl( self, wx.id_any, wx.defaultposition, wx.defaultsize, wx.lc_report ) self.list.setminsize( wx.size( 500,300 ) ) self.list.setmaxsize( wx.size( 1000,800 ) ) self.list.insertcolumn(0,"order id...