Posts

Showing posts from July, 2015

php - ROW wise SUM VS COLUMN wise SUM in MySQL -

Image
i have tablea contains following structure i modified structure tableb below reduce number of rows , category fixed length assume have 21 lakh data in tablea after modified new structure tableb contains 70k rows only in case want sum values table, query1: select sum(val) total tablea; vs query2: select sum(cate1+cate2+cate3) total tableb; query1 executing faster while comparing query2. tableb contains less rows while comparing tablea as of expectation query2 faster query1 fastest one. help me understand why performance reduced in query2? mysql optimized speed relational operations. there not effort @ speeding other kinds of operations mysql can perform. cate1+cate2+cate3 legitimate operation, there's nothing particularly relational it. table1 simpler in terms of relational model of data table2, though table1 has more rows. it's worth noting in passing table1 conforms first normal form table2 not. 3 columns repeating group though it's...

linux - Run sudo command with password -

sudo command can used in following way sudo -u <user_name> <command/script> but want know how include password want avoid user interactivity. also, admin, don't want disable password prompt sudo commands. how can achieve this. tried man sudo , not of help. you can use -s switch reads password stdin , example: ~$ echo "yourpassword" | sudo -s <command> anyway, @thrustmaster said, not right way use sudo .

C# NULL VALUES BEING INSERTED IN DB -

i reading xml file , saving extracted data according elements of xml file. using xmlreader. when running program ... runs fine but, null values being sent db. codes follows : using system; using system.xml; using system.collections.generic; using system.linq; using system.web; using system.web.ui; using system.web.ui.webcontrols; using system.data.sqlclient; using system.configuration; using system.data; public partial class _default : system.web.ui.page { string org_id; string org_desig; string org_name; string add_1; string add_2; string add_3; string cityname; string countrycode; string countryname; string postalcode; protected void page_load(object sender, eventargs e) { } protected void button1_click(object sender, eventargs e) { // load xml file xmltextreader reader = new xmltextreader("pxmlf-8612013050420130606105906.xml"); // loop on xml file while (reader.rea...

c++ - How to Run a whole QApplication Asynchronously? -

i'm trying run modified qt-programm library. need not not block main execution. so want run qapplication , commence execution of main application. how achive this? my first thought run in seperate thread. void myclass::execute() { someclass = someclass::instance(); std::thread t1(&myclass::startapp, this); someclass->somefunction(); someclass->domorestuff(); } void myclass::startapp() { qapplication app(argc, argv); app.exec(); qcoreapplication::quit(); } but results in call '__invoke' ambiguous error. though don't know why/where __invoke overwritten , how handle error. :( so how can accomplish qapplication doesn't block main execution? design pattern totally wrong, qapplication qcoreapplication not supposed multiplied inside 1 application. should example make own class like: class librarycore: public qobject { } and substitute qapplication class inside future library sources. should implement needed...

join - Does Core Data support VIEW in SQLite? -

would know if core data support creating view in sqlite3 database? if not, join way can select data 2 tables (each of them has different table structure) ? directly api can't. core data object storage, not database - if it's sqlite behind. anyway, can open coredata database standard sqlite , make direct queries on stored data. db structure easy understand.

servlets - Downloading a CSV File in Browser by using Java -

i'm trying add button on web application when clicked, downloads csv file (which tiny, 4kb in size). i have button made , listener attached it. file ready. thing need create actual event downloads csv file when button clicked. assuming "file" (which of type file) name of csv file i'm using, , it's ready go, method have far: public void downloadcsv(httpservletrequest _request, httpservletresponse _response, logfiledetailcommand cmd) throws exception { servletoutputstream outstream = _response.getoutputstream(); _response.setcontenttype("text/csv"); _response.setheader("content-disposition", "attachment; filename=data.csv"); } i realise i'm missing part writes file servletoutputstream part i'm stuck on. know class servletoutputstream extends class outputstream ( http://docs.oracle.com/javaee/5/api/javax/servlet/servletoutputstream.html ), , therefore has inherited "write" methods, in ideal...

javascript - Set predefined subject and text for contact form on button click -

i trying following think dont have clue how work properly: on page products.html have products buttons order. buttons redirect contact form , set defualt subject , text. e.g: if click on "order computer" redirected contact page form , form contain filled datas. subject: "computer order" text: "i make order..." this how button looks like <a class="dc_c3b_large dc_c3b_orange dc_button" href="/contact.html?subject="computer"><span style="font-size:25px !important">objednaj!</span></a> and form <form action="contact.php" method="post" id="contactform_main"> ... <label for="subject">predmet*</label> <input id="subject" name="subject" class="text"/> <input type="submit" name="imagefield" value="submit" class="send" /> <...

ruby on rails - How should I import this data into my database? -

i have database thousands of records code | name | price 00106 | water | 9.99 00107 | onion | 8.99 which coded in ges file below: 00f means column header 00i means insert row there others like( 00d delete row or 00u update) 00f 0101 02code 031 00f 0102 02name 031 00f 0103 02price 030 00i 0100106 02water 030999 00i 0100107 02onion 030899 i want create importer process file , push database. started implemented that: class importer conn = activerecord::base.connection f = "00f" = "00i" def extract_to_database(collection) add = true tmp = [] type = f inserts = [] collection.each_with_index |line, i| _type = line.strip _changed = [f,i].include? _type if _changed && > 0 case type when f @f << tmp when group_id = group.find_by(code: tmp[1]).id inserts.push "(group_id,'#{tmp[2]}','#{tmp[3]}')...

I need to compare column values in 2 tables using Visual Studio 2010 -

i want compare values between 2 mysql tables: table1: 1839 records columns follows no1, no2, no3, no4, no5, no6 table2: 983816 records columns follows no1, no2, no3, no4, no5, no6, pick_no, hits i have created form in visual studio 2010 has table adapter each table, want compare each column table1 against each column in table2 updating pick_no column 1 each time number matches column in table2, when each row in table1 has been checked against rows in table2 if pick_no greater 2 update hits column 1, start on record 2 table1 , on. after each row has been done table1 need 0 pick_no can cleared next run through.

android - sqlite bulk insertion from text file in assets -

i facing problem in case while having bulk of insert queries in text file (stored in assets), want execute queries while installation of app after creation of tables. i unable understand how this. i have following code, executes only first one of queries. @override public void oncreate(sqlitedatabase db) { //create table queries // inserting text file in assets inputstream in_s = cntx.getassets().open("vistalog.txt"); byte[] b = new byte[in_s.available()]; in_s.read(b); string sql = new string(b); db.execsql(sql); } but, need execute queries 1 one. update using code stringbuilder sb = new stringbuilder(); try { inputstream = ctx.getassets().open("vistalog2.txt"); reader reader = new inputstreamreader(is); char[] chars = new char[8192]; for(int len; (len = reader.read(chars)) > 0;) { // process chars. sb.append((char)len);...

SSH - Permission denied (cannot authenticate git@github.com) via CMD -

i'm on windows xp. i'm facing weired problem when try connect git@github.com using bash ssh -v git@github.com i'm able connect when trying connect via cmd on same machine i'm getting message permission denied. on debugging found in case of bash, ssh checking id_rsa key in case of cmd ssh checking github_rsa. not trying check id_rsa. below logs. openssh_4.6p1, openssl 0.9.8e 23 feb 2007 debug1: reading configuration data /etc/ssh/ssh_config debug1: applying options * debug1: applying options github.com debug1: connecting github.com [204.232.175.90] port 22. debug1: connection established. debug1: identity file /c/documents , settings/username/.ssh/github_rsa type 1 debug1: remote protocol version 2.0, remote software version openssh_5.5p1 debia n-6+squeeze1+github12 debug1: match: openssh_5.5p1 debian-6+squeeze1+github12 pat openssh* debug1: enabling compatibility mode protocol 2.0 debug1: local version string ssh-2.0-openssh_4.6 warning: permanently added ...

jQuery dynamic height on list items -

scenario i have container (there more), list items inside, each containing image. height of container dynamic relative height of list items, change within media query. container has min-height, when images larger idea adjust size of container, slide down. i'm getting height of images list item when page loads, isn't great quite few images can take while adjust. unfortunately it's quite large project , wouldn't able replicate scenario in jsfiddle exactly, think close enough. solution i need way of getting height of first images' list item loads , making container same height. code html <ul class="container"> <li class="img"> <img src="http://www.lorempixel.com/50/100" width="100%" height="100%" /> </li> <li class="img"> <img src="http://www.lorempixel.com/50/100" width="100%" height="100%" /> ...

java - Create MySql Database using Matlab -

i using database toolbox of matlab run mysql queries. doing using jdbc driver (connector/j). i able connect/create/delete new tables given database. is there way can directly create new database matlab itself? i'm looking solution lets me using toolbox or using java matlab. here's have used. in matlab works. import java.sql.*; connd = drivermanager.getconnection(... 'jdbc:mysql://localhost/?user=urname&password=urpassword'); sd=connd.createstatement(); result=sd.executeupdate('create database urdatabasename'); sd.close(); connd.close(); mind you, doesn't include error handling , checks. make sure handle data carefully.

objective c - adding CCPhysicsSprite to CCLayer cocos2d -

i'm trying reorganize helloworld project in cocos2d our needs. thing did - made class, inherent ccphysicssprite , wanted add cclayer ( helloworldlayer ). goes wrong. according debugger instance created, can't see in ios emulator. need , explanations. helloworldlayer.h @interface helloworldlayer : cclayer <gkachievementviewcontrollerdelegate, gkleaderboardviewcontrollerdelegate> { cctexture2d *spritetexture_; // weak ref b2world* world_; // strong ref glesdebugdraw *m_debugdraw; // strong ref } helloworldlayer.mm (only changed me functions:) -(id) init { if( (self=[super init])) { // enable events self.touchenabled = yes; self.accelerometerenabled = yes; cgsize s = [ccdirector shareddirector].winsize; // init physics [self initphysics]; // create reset button //[self createmenu]; //set sprite //#if 1 // // use batch node. faster // ...

qt - QtWebkit, Can't use '@' key -

my qt program (using qt v5.0.2) contains qwebview in user supposed login using email address , password. works fine on windows (tried on w7 , server 2008) on mac (10.7.5) have encountered annoying issue. when pressing alt-2 (key combination @) nothing happens. i have spent countless hours testing , trying find info on net it, can't find it. is there workaround? fix? or known issue? edit: noted in comments below, keyboard european/swedish. it's genuine qt bug. reported https://bugreports.qt-project.org/browse/qtbug-34981 today found code responsible in ./qtwebkit/source/webkit/qt/webcoresupport/editorclientqt.cpp around line 480 says #ifndef q_ws_mac // need exclude checking alt because different shift if (!kevent->altkey()) #endif shouldinserttext = true; apparently, q_ws_mac isn't defined on mac builds @ time - think it's been deprecated in favor of q_os_mac.s ...

How to change default port of a Rails 4 app? -

i know can start rails server on port via -p option. i'd setup port per application long start webrick. any ideas? regards felix quick solution: append rakefile task :server `bundle exec rails s -p 8080` end then run rake server

ajax - Retrieve JSON information? Jquery -

ok, might seem dumb question, please keep in mind json new me (i've heard expression before. know nothing it). i have callback function notify authors on site email, when new comments added disqus thread. <script type="text/javascript"> function disqus_config() { this.callbacks.onnewcomment = [function(comment) { var authname = document.getelementbyid('authname').value; var authmail = document.getelementbyid('authmail').value; var link = document.getelementbyid('link').value; var disqusapikey = 'my_api_key'; var disquscall = 'https://disqus.com/api/3.0/posts/details.json?post=' + comment.id + '&api_key=' + disqusapikey; $.ajax({ type: 'post', url: 'url_of_mail.php', data: {'authname': authname, 'authmail': authmail, 'link': link, '...

JavaFx - Is it possible to implement Drag-and-drop of GUI elements? -

i drag button 1 vbox another.. possible javafx 2.2? i found looking for. source object i'm using event.getgesturesource() method... need add object target target.getchildren().add(event.getgesturesource());

integration - How to deal with 3+ message formats in mule? -

let's suppose i'm dealing 3 (very) different messages formats inside mule esb, i'll call them a, b , c. xml (via socket), custom text-format , soap transporting kind of xml (it's not same transported via socket), example. of them can transformed each other. a, b , c carry same information, in different formats. each 1 of them have it's own entry point in flow, format validations etc.. but, there's (a lot) of logic need executed in of them dealing/extracting information, routing based in content, enriching etc etc.. what should do? mean, did research on integration patterns didn't found situation or similar. the easier approach sounds taking 1 of formats (let's take b) "default" 1 of "main-flow" , implementing common logic based on it. then, every message arrives transformed b , transformed again destination format, if 2 points uses same format. examples: 1) 1 "a" hit app, it's transformed "b" e...

delphi - How can i read/set atribut for object soap -

if use vb .net follow code work good. how can realize on delphi 2010. problem find analog r.messagedata.appdata.any. i try use rootnode := otv.messagedata.appdata.objecttosoap(rootnode,rootnode,httprio.converter,'orderinfo','otv',[],s); or p := otv.messagedata.appdata.datacontext.getdatapointer(0); but cann't find atribut of object of appdata - (orderid example). i must read , set atribut appdata - how can on delphi 2010 thank you. **part of unit wsdl importer(commonappdatatype class empty)** unit aismfcservice; interface uses invokeregistry, soaphttpclient, types, xsbuiltins; const is_optn = $0001; is_unbd = $0002; is_nlbl = $0004; is_attr = $0010; is_ref = $0080; type // ************************************************************************ // // following types, referred in wsdl document not being represented // in file. either aliases[@] of other types represented or referred // never[!] declared in document. type...

agile - Velocity Chart in Rally -

i working on project pull out data rally , create velocity chart. i understand rest web service apis use defects, iteration, hierarchical requirement , iteration cumulative flow data. how calculations done calculate velocity per iteration particular project? what data required , how can achieved? right i'm able pull plan estimate of accepted user stories , total plan estimate. i wrote app calculate velocity. used story points of accepted stories/defects in time period (iteration/release). numbers ended matching rally had velocity, believe takes.

php - Html button action only on first click -

i can set action on click html button. need set action on first click. there way this? button radio in form. javascript maybe? what's important - radio button still might changed. action has done once. this doesn't work function myfunction(i){ oform = document.forms["myform"]; if(oform.elements["field"+i].checked) alert("action done earlier"); else action } the cleanest solution use removeeventlistener to... remove event listener : var mybutton = document.getelementbyid('someid'); var handler = function(){ // dosomething mybutton.removeeventlistener('click',handler); } mybutton.addeventlistener('click', handler); (to make cleaner, wrap in iife, in example below) demonstration

.net - Server.MapPath returning a path with a folder that doesn’t exists -

i have following code: var dir = @"content\posts\" + yr + @"\" + mnth + @"\"; var = path.combine(dir, dy.tostring() + pid.tostring() + ".txt"); //a contains: "content\\posts\\2013\\8\\file01.txt" stts = obj.notifymail(title, writeup, "author@gmail.com", a); and in notifymail function have this: public bool notifymail(string subject, string body, string toadd, string filepath) { … string attachments = httpcontext.current.server.mappath(filepath); //now here attachments contains: "g:\\program files\\derby\\work\\development\\proj\\proj\\`post`\\content\\posts\\2013\\8\\file01.txt" var attchmnts = new linkedresource(attachments); attchmnts.contentid = "attchmnts"; … } now problem in notifymail when attachments retrieving physical file path through server.mappath returning path invalid folder included in i.e. post folder doesn't exists anywhere, not i...

layout - Yii is not rendering theme -

i'm having strange issue yii , theme. set in config/main.php like: 'theme'=>'themename', as usual. when try render view, rendered is, without layout, if called: $this->renderpartial i double check don't call renderpartial, themes seem equal others theme i've done. can issue about? thank's help, i'm going out of mind on this... here structure , syntax should have check -yiiroot -!-!protected -!-!-!controllers -!-!-!-!testcontroller.php -!-!themes -!-!-!themename (it 1 have set on config file) -!-!-!-!views -!-!-!-!-!layouts -!-!-!-!-!-!main.php // default if public $layout has not been overwriten or layout file has been set not found -!-!-!-!-!test -!-!-!-!-!-!viewname.php on controller testcontroller public $layout main default or overwritten there in actionindex set $this->render('viewname'); if rendered page method renderpartial() directly in controller , not layout template sure re...

android - Programatically setColor,font to Textviews -

i have created list view 3 items in each list view item using 2 seperate .'xml's. 1)list_view.xml <listview xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/listview"> </listview> 2)list_item.xml <?xml version="1.0" encoding="utf-8"?> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:textappearance="?android:attr/textappearancelarge" android:text="text here" android:id="@+id/textview" android:layout_aligntop="@+id/textview" android:layout_alignleft="@+id/textview" android:layout_centervertical="true"/> <textview android:layout_width="wrap_content" android:l...

How to set Borders graphics G JAVA -

i trying make game there few borders on map, being generated text document. text document has 1s , 0s ther 1 shows wall. how make character stops infront of wall my code: main class: public class javagame { public static void main(string[] args) { final platno p = new platno(); final jframe okno = new jframe("test"); mapa map = new mapa(); okno.setresizable(false); okno.setdefaultcloseoperation(jframe.exit_on_close); okno.setsize(800, 600); okno.setvisible(true); map.nacti(); okno.add(p); p.mapa = map; okno.addkeylistener(new keylistener() { @override public void keytyped(keyevent e) { } @override public void keypressed(keyevent e) { int kod = e.getkeycode(); if(kod == keyevent.vk_left) { platno.x -= 3; p.repaint(); } else if(kod == keyevent.vk_right) { platno.x +=3; ...

perl - function to print document in json format (mongodb) -

hi i'm using perl query mongodb, when cursor how can print documents in json format { "_id" : objectid("51fdbfefb12a69cd35000502"), "biography" : "colombian pop singer, born on february 2, 1977 colombian mother of spanish-italian descent , american father of lebanese-italian descent. shakira known high iq , fluent in spanish, english, italian , portuguese.\r\rwriting songs , belly-dancing since childhood, first album released when mere 14 years old. other spanish-language albums followed, each faring better predecessor, not until 2001 achieved world-wide breakthrough english-language \"laundry service\" album.\r", "imguri" : "http://api.discogs.com/image/a-5530-1218936486.jpeg", "index" : "shakira", "name" : "shakira", "ready" : "yes", "requests" : "0"} i dont see function in mongodb module migh try this run_command({printjs...

swing - java JPanel setSize and setLocation -

hey second post don't mad @ me i'm having issues jpanel in java. trying set size , location won't work, have tried repaint(); not work. help? here's code: package test.test.test; import java.awt.color; import java.awt.flowlayout; import java.awt.textfield; import javax.swing.jbutton; import javax.swing.jframe; import javax.swing.jpanel; public class test extends jframe { jpanel colorpanel = new jpanel(); public display(){ super("jpanel test"); setlayout(new flowlayout()); add(colorpanel); colorpanel.setbackground(color.cyan); colorpanel.setsize(300, 300); repaint(); } } for benefit of reading question later, here's short, self contained, correct example of defining jpanel background color. almost time, should let swing component layout manager determine size of swing components. in case, define preferred size of jpanel because jpanel not contain other swing components. the default layout manager of...

regex - Regular Expression to split by VbCrLf + ignores VbCrLf within double quotes. VB.NET -

Image
still trying understand regex. need split string on vbcrlf, not when inside double quotes. so string built using stringbuilder below: "abcdef" "this is sampletext" so io stream , parse it. in io stream, single string parse "abcdef" vbcrlf "this vbcrlf sampletext" now convert iostream string , want split this. required output is "abcdef" "this sampletext" (if possible explain me expression, can understand , modify per needs) thank you description i think easier use regex matching routine output each line. regex will: assumes \r\n equivalent vbcrlf matches entire lines , text trims delimiting \r\n mimic how split command drop delimiter keeps quoted strings if quoted string contains \r\n ^(?:[^"\r\n]|"[^"]*")*(?=\r\n|\z) example live demo of regex sample text line 1 line 2 line 3 "this line 3a line 3b line 3c" , more text line 4 line 5 code vb...

javascript - How to characterize z-indexing for the DOM? (2) -

i've been bit care-less choosing z-indexes in css. i'd traverse dom , report z-indexes respective id's. for example: id z-index header 10 main 0 menu 20 the end result object keys element id , value z-index. 1 might call z_obj // pseudo code var z_obj = {el_id: el_zindex}; getting z-index each element ( el ) should easy using filter , code below: // attr attribute data = _.filter(el.attributes, function (attr) { return (/^z-index/).test(atttr.name); }); but how traverse dom z-indexes , store in object? i'd w/ out libraries, , using code above if possible. this debug tool in general. you can elements getelementsbytagname("*") , iterate on collection for loop, , use window.getcomputedstyle(node) . there, can retrieve z-index . here's example: var zobj, allels, i, j, cur, style, zindex; zobj = {}; allels = document.body.getelementsbytagname("*"); (i = 0, j = allels.length; ...

SQL server: Order by multiple columns incorrect syntax -

i'm using sql server 2008. select resulttable.ordernumber, resulttable.projectid, resulttable.batchid, resulttable.customerid, resulttable.city, resulttable.street, resulttable.postalcode, resulttable.country, resulttable.createddate, resulttable.name, count(*) over() orderscount, row_number() on (order case when @sortby = 'ordernumber' resulttable.ordernumber end, case when @sortby = 'projectid' resulttable.projectid end, case when @sortby = 'address' resulttable.country, resulttable.city, resulttable.street, resulttable.postalcode end, case when @sortby = 'createddate' resulttable.createddate e...

http - AngularJS 1.1.5 $resource.get is not creating XHR request from setTimeout -

i have asked question on google forum angularjs , haven't heard until now. can me understand going on here? i trying periodically refresh resource , doesn't seem working. have tracked until fact promise has been obtained $http service xhr request never created , fired when method invoked in settimeout. however, if same without settimeout seems working fine. working jsfiddle: http://jsfiddle.net/hponnu/z62qn/2/ window.root_module = angular.module("myapp", ['ngresource']); function maincontroller($scope, $resource) { $scope.buttonclick = function () { var res = $resource("http://www.google.com"); res.get({}, function (response) { alert("response"); }, function (err) { alert("error"); }); } } broken jsfiddle: http://jsfiddle.net/hponnu/h8aet/10/ window.root_module = angular.module("myapp", ['ngresource']); window.count = 0; function mainc...

angularjs - Angular, ng-repeat to build other directives -

i'm building complex layout, takes json document , formats multiple rows, each row having more rows and/or combinations of rows/columns inside them. i'm new angular , trying grips directives. easy use simple things, become difficult once need more complicated. i guess i'm doing wrong way around, there way add name of directive (in example below, i've used ) , directive rendered on ng-repeat? maybe same way can use {{{html}}} instead of {{html}} inside of mustache partial render html , not text. as expected, example below writes name of directive dom. need angluar take name of directive, understand it, , render before before written. due complex layout of page need design, rendering many different directives, inside each other, 1 json document (which has been structured different rows , row / column combinations). example code renders name of directive page, gives idea of how i'd write solution problem... <div app-pag...

mysql - SQL full outer join or Union -

i have 2 different tables. 1 article table , gallery table. gallery contains multiple images , there table named images (which not shown here). images in images table link gallery table foreign key gallery_id . now trying achieve is, in home page, need combined result of both articles , galleries. if article, thumbnail of article displayed , if gallery, last image gallery displayed. |article | |-----------| |id | |category_id| |title | |slug | |filename | |body | |created | |modified | |gallery| |-----------| |id | |category_id| |title | |slug | |body | |created | |modified | i using complex union query achieve it. how can sort results. possible use order by clause. can result achieved outer join ? sounds outer join not apply here because want results in 1 column. joins make data in 2 columns, unions make data 1 column. to sort can this select id , category_id , title ...

node.js - Mongo/Mongoose: cleanup orphaned refs -

suppose typical one-to-many relationship modeled using references suggested mongodb official documentation : var user = mongoose.schema({ }); var group = mongoose.schema({ user: [{ type: mongoose.schema.types.objectid, ref: 'user' }] }); let's assume care order, in users appear in group, array necessary. now, let's assume user has been deleted -- , groups have not been maintained $pull reason. if use mongoose's populate looks fine, garbage persists in array. is there way identify orphaned refs , remove them? maybe automatically -- cascade in relational world? what's best approach maintain referential integrity in mongo/mongoose? finally, what's efficient one? first, use remove hook on user model try maintain data integrity on ongoing basis: user.post('remove', pulluserfromgroups); keep integrity intact. can remove user every group single $pull operation. mongo analog cascade relational dbs. for after-the...

sql - Remove the only single column from datatable and insert it into a generic list of strings c# -

here method public virtual list<string> getjobname(nullable<int> id, nullable<int> userid) { list<sqlparameter> parameters = new list<sqlparameter>(); var idparameter = id.hasvalue ? new sqlparameter("id", id) : new sqlparameter("id", typeof(int)); parameters.add(idparameter); var useridparameter = userid.hasvalue ? new sqlparameter("userid", userid) : new sqlparameter("userid", typeof(int)); parameters.add(useridparameter); table = executespdatatable("getjobname", parameters, out list); // datafiller<string> j = new datafiller<string>(); // list<string> rows = j.fromdatatabletolist(table); } table holds 1 value, single job , want put single string list<string> , return. any help? if variable table string, , want return string list of str...

c# - ADO.net Data Model Best Practice -

i've been working time ado.net data models (in asp.net). i'm not sure, use correctly. for example, have model, "sqlentities.edmx" , try simplify access. created class called "eh" (for entity helper), kinda looks this private static class eh { private static sqlentities _sql = new sqlentities(); public static list<user> users { { return _sql.users.tolist(); } } public static void save(this object o) { dbset entities = _sql.set(o.gettype()); entities.add(o); _sql.savechanges(); } public static void delete(this object o) { dbset entities = _sql.set(o.gettype()); entities.remove(o); _sql.savechanges(); } public static void update() { _sql.savechanges(); } } first tried use it, needed it, like: using(sqlentities sql = new sqlentities()) { user utemp = new user() { name = "foo" }; sql.users.add(utemp); ...

git - Compilation Error when building Giraph -

i trying build giraph. have following: java version "1.7.0_25", apache maven 3.0.4, hadoop 1.0.4. following instruction in page: https://cwiki.apache.org/confluence/display/giraph/quick+start+guide when run: mvn compile , following error: [info] scanning projects... [info] ------------------------------------------------------------------------ [info] reactor build order: [info] [info] apache giraph parent [info] apache giraph core [info] apache giraph examples [info] apache giraph accumulo i/o [info] apache giraph hbase i/o [info] apache giraph hcatalog i/o [info] apache giraph hive i/o [info] apache giraph rexster i/o [info] [info] ------------------------------------------------------------------------ [info] building apache giraph parent 1.1.0-snapshot [info] ------------------------------------------------------------------------ [info] [info] --- mavanagaiata:0.5.0:branch (git-commit) @ giraph-parent --- [info] [info] --- mavanagaiata:0.5.0:commit (git-commit) @...