Posts

Showing posts from June, 2010

Predefined Interface exposes some method,we are using that method but interface doent have definition part ,then how its working in c#? -

interface exposes method,we using method in class interface doent have definition part ,then how working in c#. example class productnamecomparer : icomparer { public int compare(object x, object y) { product first = (product)x; product second = (product)y; return first.name.compareto(second.name); } } here icomparer exposes compareto() method, icomparer doesn't have compareto() method definition part, how working? interface contract declares method rather having implementation part.... class implements particular interface should have implemenation detail. for instance, have ianimal interface , dog class implements ianimal interface, public interface ianimal { void walk(); // declares method, not implemenation } //class implementing interface //must define method specified in interface class dog : ianimal { public void walk() { console.writeline("dog can

php - Filtertering HTML tags -

is there way filter html tags except tags of choice <strong>, or <b>, <i> ? know htmlentities job filter of html tags. check this: http://www.php.net/strip_tags // allow <p> , <a> echo strip_tags($text, '<p><a>'); edit: actually, mean "filter"?

Android Uploading apk first time with apk exapansion -

i uploading game apk expansion.but when upload first apk not showing popup expansion file upload,second time updated version show popup upload expansion file. let me know if have solution it. thank you. this issue of google developer console. you have upload second apk able add expansion file.

Magento XML configuration -

i have follow instruction per magento u, configuration xml. xml configuration not working side. here code have done. app/etc/first_module.xml <?xml version="1.0"?> <config> <modules> <first_module> <active>true</active> <codepool>local</codepool> </first_module> </modules> </config> in local codepool first/module/etc/config.xml <?xml version="1.0"?> <config> <default> <some> <ranadom> <xpath>here value</xpath> </ranadom> </some> </default> </config> now, want call xpath value in cmscontroller indexaction() for have put code in cms/contollers/indexaction() echo "test"; echo mage::getstoreconfig('some/random/xpath'); die; with of echo mage::getstorecon

hibernate - How to update columns value with new value -

i update column value new entity value incrementally, example: support have table user column name balance for specific user, balance 3000. now, set value 3500. i have hibernate "user" entity has 'balance' value of 500. how can make update?? if make using pure sql query, simple do: "update user set balance = balance+500 user_id=3" i avoid calling sql , use hibernate. have tried below code? remeber mention possible solutions tried before asking question. user user=session.get(user.class, 3); // 3 id of user. user.setbalance((user.getbalance()+500)); session.saveorupdate(user); session.commit();

"time" command in Cygwin works, but not in NetBean -

i can in cygwin, adding time command user@user_pc ~ $ time ./helloworld shows smthing like hello world!!! real 0m0.270s user 0m0.270s sys 0m0.270s i've deployed similar c/c++ project @netbean7.2 @win 7. it shows error message @ run time, when add time command ,like: time "${output_path}" ,at text field of projcet_file-> r_click -> properties -> run -> run_command: ,and default value ${output_path} only. error message c:\projectfolder\time not exist or not executable ,seems netbean consider time excutable any better ways solve it?? full command bash needs in quotes if calling cmd shell bash -c "time ls"

php - Sort the contents of the textfile in ascending -

i trying develop code sort contents of text file in ascending order. have read contents of file , able display texts. having difficulty sorting them out in low high order, word word. i have tried asort php.net, not code work well. thanks. to answer second question, can read text file into variable (like you've said have already), eg. $variable, use explode ( http://php.net/manual/en/function.explode.php ) separate, @ each space, each word array: //$variable content text file $output = explode(" ",$variable); //explode content @ each space //loop through resulting array , output ($counter=0; $counter < count($output); $counter++) { echo $output[$counter] . "<br/>"; //output screen line break after each } //end loop if paragraph contains commas etc don't want output can replace in variable before exploding it.

unity3d - IOS (IPad) How to load a screenshot created at runtime into a Texture or Texture2D -

we facing issue unity. developing ipad app. 1 feature take screenshot , use button. because tree directory in ipad doesn't exist resources folder, can't use "resources.load", , so, because how feature must work, texture won't available @ beginning, can't put in resources folder. have tried several solutions, creating in ipad resources folder (inside documents folder) , trying load texture it, or piece of code: public texture loadtexturefromfile(string filename) { texture2d texture = new texture2d(1024, 768); filestream fs = new filestream(filename, filemode.open, fileaccess.read); byte[] imagedata = new byte[fs.length]; fs.read(imagedata, 0, (int)fs.length); texture.loadimage(imagedata); return (texture texture); } any appreciated. we've been stuck issue several days you can try following: texture2d tex = new texture2d(screen.width, screen.height); tex.readpixels(new rect(0, 0, screen.width, screen.height), 0, 0)

php - Store magento contact form data in database? -

i want store magento contact form data database. don't know posts controller? i want send email store data in custom table. thanks. once have custom table built create module in local pool , extend mage_contacts_indexcontroller . @ ticket submitted in magento.stackexchange.com . code use in post below contact form. use right $_post variable pass custom form. see code here , how extend it

javascript - Firefox gives error for an event object -

this code works great on chrome, wont work on ie or firefox. $('.modal').on("click", ".action", function() { if($(event.target).hasclass('added')) { if($(event.target).hasclass('remove_vehicle')) { //code } i error on firefox console: referenceerror: event not defined [break on error] if($(event.target).hasclass('added')) { what wrong here? both event.trigger , hasclass supposed work on firefox. try - $('.modal').on("click", ".action", function(event) { // see difference in line if($(event.target).hasclass('added')) { if($(event.target).hasclass('remove_vehicle')) { //code }

android - Performing a Scheduled task from a Service and Keeping that service Alive -

public class myhibernatedservice extends service{ public void oncreate() { super.oncreate(); //declaring intents .. //some codes... alarmmanager = (alarmmanager)getsystemservice(alarm_service); pendingintent pendingintent = pendingintent.getservice(this, 0, intentservicetoberun, 0); calendar calendar = calendar.getinstance(); calendar.add(calendar.millisecond, 10000); am.setrepeating(alarmmanager.rtc_wakeup, calendar.gettimeinmillis(), alarmmanager.interval_day, pendingintent); } } i want service launch intentservice every single day @ time. however, i've read somewhere on internet, stackoverflow, google,etc.. service cannot stay alive forever, how android works. have kill service whenever android needs memory or using memory. guarantees me code run everyday , service not killed? edit : i noticed in android docs: the android system attempt keep process hosting service around long servi

Google Drive mobile offline app -

i'm developing mobile app have hyperlinks user's google drive documents. if mobile device offline, hyperlinks still function if mobile device owner has installed google drive android/ios app? i.e. document url retrieved online work offline access? google drive android/ios app downloads online files local storage , serve local file system when device got offline. should follow similar approach.

XPATH Error : Unable to evaluate expression -

i have xml mentioned below. trying obtain value cardnumber using following expression. xpath : paymentservice/ns0:submit/ns0:order/ns0:paymentdetails/ns0:visa-ssl/cardnumber but it's giving me error. can any1 guide me on this? <?xml version="1.0" encoding="utf-8"?> <paymentservice version="1.0"> <ns0:submit xmlns:ns0="http://www.tibco.com/ns/no_namespace_schema_location/payment/paymentprocessors/worldpay_cc/sharedresources/schemas/paymentservice_v1.dtd"> <ns0:order> <description>description</description> <amount value="500" currencycode="eur" exponent="2"/> <ns0:paymentdetails> <ns0:visa-ssl> <cardnumber>00009875083428500</cardnumber> <expirydate> <date month="02" year="2008"/>

how to retrieve the data from two table in mysql database with if condition in php mysql -

Image
my code <html> <head> <body> <div style="width:400px;height:300px;border:1px solid blue;"> <div style="width:400px;height:50px; float: left;">&nbsp;</div> <form> <div align="right" style="width:150px;height:30px; float: left;">show name :&nbsp; </div> <div style="width:250px;height:30px; float: left;"> <select name="show_name" onchange="showuser(this.value)"> <option selected="selected"> -- select show --</option> <?php session_start(); include_once('db.php'); $sql = mysql_query("select show_id, show_name show_name"); while($row=mysql_fetch_array($sql)) { $show_id = $row['show_id']; $show_name= $row['show_name']; echo "<option value ='.$show_id'>$show_name</option>"; } ?> </select> </div> <div align="right" style=&

c - OpenSSL - find error depth in certificate chain -

i writing c program retrieve , verify x509 certificate chain using openssl. first time programming in c , relying heavily on tutorial @ http://www.ibm.com/developerworks/linux/library/l-openssl/ i able retrieve error code connection using code below: if (ssl_get_verify_result(ssl) != x509_v_ok) { printf("\nerror verifying certificate\n"); fprintf(stderr, "error code: %lu\n", ssl_get_verify_result(ssl)); } however need know certificate offending one. there way determine chain depth of error command line s_client? example code appreciated. i found answer in "network security openssl" chandra, messier , viega. it uses ssl_ctx_set_verify designate callback function gets run after verification routine each certificate in chain. ssl_ctx_set_verify(ctx, ssl_verify_peer, verify_callback); int verify_callback(int ok, x509_store_ctx * store) { if (!ok) //if particular cert had error { int depth = x509_store_ctx_get_error_dept

c# - Match <keyword> with whitespace at end/start of line -

i can't figure out how c# regex ismatch match <keyword> followed end of line or whitespace. i have [\s]+keyword[\s]+ works spaces, not work keyword<end of string> or <start of string>keyword . i have tried [\s^]+keyword[\s$]+ , makes fail match spaces, , doesn't work @ end or start of string. here's code tried: string pattern = string.format("[\\s^]+{0}[\\s$]+",keyword); if(regex.ismatch(text, pattern, regexoptions.ignorecase)) the problem ^ , $ inside character classes not treated anchors literal characters. use alternation instead of character class: string pattern = string.format(@"(?:\s|^){0}(?:\s|$)",keyword); note there no need + , because want make sure if there 1 space. don't care if there more of them. ?: practice , suppresses capturing don't need here. , @ makes string verbatim string, don't have double-escape backslashes. there way, find neater. can use lookarounds , ensure ther

php - Does hash values contain quotes? -

does hash values contain quotes? if dependent algorithm, want know blowfish using phpass . i'm asking in regard sql injection because don't want prepare query authentication , use place holders , wrapping username , password hash in quotes. ( have doubt username safe when validated consist of word chars [a-wa-w1-9_] (no quotes or other special chars)? ) yes, hash values can contain quotes. usernames. you should not base database-interaction on fragile assumption never should have (because hope not prepare sounds ridiculous). instead make database query safe possible regardless assume data be. things go wrong on end , don't want error stored in persistence layer nor want offer potential door sql injection.

How to change border color of radio button in android? -

how change border color of radio button in android? i want change circle color of android radio button. thanks in advance. appreciated. i have try different soluation , concern if property there other drawable image the easiest way customize(change color) views. goto : http://android-holo-colors.com/ select color want radio button download output resources (download.zip) extract zip contents copy files extracted zip project drawables, styles , values change parent of app theme 1 downloaded and have got wanted

android supporting arabic in html tags? -

i want use arabic language inside html tags in android application, html tags in strings.xml file , works english language, when added arabic version of strings.xml file every thing ok html string becomes understandably language ?? tried add <head> <meta http-equiv="content-type" ; content="text/html; charset=utf-8" ; /> </head> but problem still. how can fix ?? yesss found it, have load text way in activity aboutus.loaddata(stringdata, "text/html; charset=utf-8", null);

Remove space in PHP that was added using JavaScript -

my requirement add space after comma using javascript , added space should using php in order continue operation. javascript: return date.replace(/\,/g ,', '); php code: $reqfilterdata['reqfrmdt'] = preg_replace('/\s+/', '', $reqfilterdata['reqfrmdt']); $reqfilterdata['reqfrmdt'] variable has date value. please me try str_replace $reqfilterdata['reqfrmdt'] = str_replace(", ",",",$reqfilterdata['reqfrmdt']);

r - Converting dates with a format of d/mm/yy (for years earlier than 69) -

this question has answer here: add correct century dates year provided “year without century”, %y 2 answers converting character "6/07/69" date using as.date function results in "2068-07-06" instead of "1968-07-06". how can fix this? example: as.date(c("6/07/68", "6/07/69"), format="%d/%m/%y") [1] "2068-07-06" "1969-07-06" you can use library chron e.g. > library(chron) > as.date(chron(c("6/07/67", "6/07/69"), format = c(dates = "m/d/y"))) #[1] "1967-06-07" "1969-06-07"

iOS control Animation or Video via swiping -

Image
is possible control animation or better video via swiping on it? i have: an animation video (~2sec playtime, can converted other file types if needed, shouldn't big) ios >= 6.0 i want: show first frame of animation play animation , forward if user moves finger tip on control speed, corresponding speed of finger tip. i'm experimenting mpmovieplayercontroller currently. there better controls? have suggestions solve problem?

c++ - Return Generic Type data from function -

i have written following code. function func() print header , data. class icell { public: wstring header; virtual void fetch() = 0; }; template <class t> class cell : public icell { public: //wstring header; t data; void fetch() { wcout<< header << l": "; cout<<data<<endl; } // implementation of cell methods }; class row { public: vector <icell *> cells; }; is there way return data instead of print within function? if so, portion of code should modified? in advance. int main() { cell<int>c1; cell<double>c2; c1.header = l"roll", c1.data = 100; c2.header = l"cgpa", c2.data = 3.5; row r; r.cells.push_back(&c1); r.cells.push_back(&c2); vector <icell *>::iterator it; for(it=r.cells.begin();it!=r.cells.end();it++) { //checkt type of wherther points cell<int> or cell<dou

struts2 - How to catch the exception thrown by default interceptor's stack in Struts 2? -

there no action mapped action name index . how catch exception, because want define handling. com.opensymphony.xwork2.defaultactionproxy.prepare(defaultactionproxy.java:189) org.apache.struts2.impl.strutsactionproxy.prepare(strutsactionproxy.java:61) org.apache.struts2.impl.strutsactionproxyfactory.createactionproxy(strutsactionproxyfactory.java:39) com.opensymphony.xwork2.defaultactionproxyfactory.createactionproxy(defaultactionproxyfactory.java:58) org.apache.struts2.dispatcher.dispatcher.serviceaction(dispatcher.java:475) org.apache.struts2.dispatcher.ng.executeoperations.executeaction(executeoperations.java:77) org.apache.struts2.dispatcher.ng.filter.strutsprepareandexecutefilter.dofilter(strutsprepareandexecutefilter.java:91) org.apache.catalina.core.applicationfilterchain.internaldofilter(applicationfilterchain.java:243) org.apache.catalina.core.applicationfilterchain.dofilter(applicationfilterchain.java:210) com.opensymphony.sitemesh.web

mysql - how the command 'use database-name' is using java code -

i make o program store data excel files in databases. have plenty of databases in program have choose in 1 store data. have made code able connect mysql program , show available databases. in database store data. more specific user first of see tha available databases in client , afterwards have chance in database data stored. me how this? the code see available databases below: class.forname("com.mysql.jdbc.driver"); connection con = (connection) drivermanager.getconnection( "jdbc:mysql://localhost:3306/", "root", "root"); databasemetadata meta = (databasemetadata) con.getmetadata(); resultset res = meta.getcatalogs(); system.out.println("list of databases: "); while (res.next()){ system.out.println (" " +res.getstring(1)); } thank in advance! i hope this link should . can data connection object

database - Hibernate sequence, use the specific sequence -

today db responsible boss told me i'm using wrong sequence, in jpa/hibernate, weren't checked on why generated table entries had higher id normal(trigger) generated entries. , found this on so horrific me, since use db sequence in db triggers generate entries. means, far know. in 50x time db start hit sequence numbers generated java application. to avoid this, need use specific sequence, , not sequence*50. havn't found out how this, can me? thanks in advance currently defined this: @id @column(name = "pvp_cost_elements_id") @generatedvalue(strategy = generationtype.sequence, generator = "wtstatseq") @sequencegenerator(name = "wtstatseq", sequencename = "warehouse.wt_stat_seq") in hibernate can specify used seq explicitly using annotations @id @column(name = "column_name", nullable = false) @generatedvalue(strategy = auto, generator = "yourentityseqgen") @sequencegenerator(name = "youre

python - How to get Django South to migrate a field with changed max_length? -

i have charfield in model want increase max_length attribute. south isn't noticing change, saying there's nothing migrate. how migrate this? issue command (after change of max_length in code): python manage.py schemamigration <name of app> --auto python manage.py migrate <name of app> that worked me. hope helps

php - convert mime mails from the input stream to readable text -

can php mime email parser/decoder https://code.google.com/p/php-mime-mail-parser/ not involve installations. tried zend , decoder phpclasses.org, did not help. unable find how give input program , take output there no tutorial this my aim: need convert mime mails input stream readable text please help try library, have used in many application make sure should have mail parser extension installed in server. http://codepad.org/zguef8ly

Sandboxed plugins for Ruby on Rails -

i'm looking create web app run plugins untrusted sources (i.e. community submissions). need lock down plugins sandbox access allowed (can't write disk, etc.). ideally, plugin able use approved packages , apis. is possible in ruby on rails? if so, can point me toward package or documentation me started? set $safe 4, should trick.

styles - WPF Listview Gridview styling column header presenter -

Image
i making style gridview in wpf consists of several parts, stuck column headers part i made style gridviewcolumnheader need style container is there part similar "datagridcolumnheaderspresenter" wrapper of columns? any find parts of control? want find name of part , default template it. thank you another reason why snoop good. you snoop identify element looking for guess it's gridviewheaderrowpresenter looking for.

jQuery and non-unicode characters -

i'm trying use jquery autocomplete database. works fine english values have rows in arabic , showing (????). i start pages with: <meta http-equiv="content-type" content="text/html; charset=utf-8"> <link href="style2.css" rel="stylesheet" type="text/css"> <style type="text/css"></style> my database formatted in utf8. include connection db file says : $conn = mysql_connect("localhost","root","") or die ($dberror1); mysql_select_db("finishing", $conn); mysql_query("set names 'utf8'"); mysql_query('set character set utf8') note: other items in arabic work fine. it's jquery autocomplete having issues with. change charset type in meta tag: <meta http-equiv="content-type" content="text/html; charset=charset=iso-8859-6"> charset=iso-8859-6 used support arabic language in html page on

java - class life cycle with ActionBar Sherlock Tab fragments -

i'm working on 1 of first android applications , got stuck understanding of how controllers/classes lifecycle arranged. i'm coming ios background. basicly did following simple tutorial so understand bind tablistener fragment. when switching tabs tablistener's ontabselected() gets called , each time new instance of fragmenta/fragment b created. that leads fact every time switch tabs oncreate..() methods called again. i don't want create new fragment instance every time switch tabs rather use 1 created intially @ application start. the question how can switch tabs without killing fragments in there? you can achieve attaching/detaching fragments, on tab listener every time tab unselected detach current fragment , on ontabselected method check if have created fragment before. private fragment mfragment; private final string mtag; private final class<t> mclass; public tablistener(string ptag, class<t> pclass) { mtag = ptag;

Basic C++ Multithreading -

i'm in design phase of development , considering using multi-threading in c++ implement functionality. i'm familiar basics of multi-threading wanted others take on idea. haven't chosen multi-threading library yet (leaning towards boost) question independent of library chosen. basically have class (let's call commandgenerator) executes in while loop (until terminated) , checks message queue of commands populated piece of software. every time commandgenerator gets message off queue, i'd spawn thread executes in background , works data pulled off queue. meanwhile want commandgenerator continue run , come around while loop again , pull new messages , again spawn more threads. conceptually possible? can keep spawning threads , let them run in background until complete while code continues loop , check queue? commandgenerator not need have control on threads. able execute independently once created , guaranteed terminate may take minute finish executing (the

Nunit pass params to Test from nunit-console -

i using below pass single parameter test. c:\documents , settings\>"c:\program files\nunit 2.6.2\bin\nunit-console" "d:\automation\classlibrary2\bin\debug\classlibrary2.dll /run:classlibrary2.class1.test1(\"option1\") mycode: namespace classlibrary2 { [testfixture] public class class1 { [test] public void test1(string browser) { messagebox.show(browse ); } } } result: tests run: 0, errors: 0, failures: 0, inconclusive: 0, time: 0 seconds so how pass parameters directly nunit-console test. the way have solved problem allowing environment variables override configuration properties. then can control environment variables build scripts, build servers, etc. control tests run in environment want them to. for example: [testfixture] public class dataaccesstest { static string getconnectionstring() { return environment.getenvironmentvariable("connectionstringfo

ios - SearchBar works only after I call a UIAlertView -

i have search bar in application sometime works, sometime not. keyboard normally, when press keyboard button, nothing happens. when does't work not call -(bool) searchbar:(uisearchbar *)searchbar shouldchangetextinrange:(nsrange)range replacementtext:(nsstring *)text after call uialertview in application, searchbar works great. why? doesn't make sense the searchbar init hidden, , when user click in searchbutton, searchbar appears. http://pastebin.com/xuagtd1w

permutation - Enumeration of distinct events in R -

i searching general approach enumerate sequence associated following problem , deposit results in 3 dimensional matrix in r. i think there must combinatorial solution have been unable find one. hopefully, detailed below sufficiently characterize problem. welcomed. given there n periods , c distinct areas in occurrence of event e must occur once in each area, enumeration of possible sequences? for example, if there 3 time periods {1,2,3} , 2 areas {a,b}, manually enumerating solutions gives: period 1 2 3 area b b b sol 1 e e - - - - ; ie event occurs in both areas @ time 1, nothing happens @ time 2 , 3 sol 2 - - e e - - ; event occurs in both areas @ time 2 etc sol 3 - - - - e e sol 4 e - - e - - sol 5 e - - - - e sol 6 - e e - - - sol 7 - e - - e - sol 8 - - e - - e sol 9 - - - e e - regardless of number of areas , number of time steps, know number of solutions n^c. case 3 ways event occur in 'a' times 3 ways event occur in

ibm midrange - Creating a ruby-on-rails model -

i have existing model connects as400 db , need create new model connects new file , pulls 1 field (an email address) , loops through 5 times. shouldn't difficult have never done in ruby , can't seem work. point me in right direction appreciated! here existing model: class distributor < activerecord::base establish_connection "as400_#{rails_env}" set_table_name "distj01" # todo: return if no distributor? # create array of hashed distributor info. def self.get_distributors_by_state state, preferred_distributor d = [] # see validate_distributor_number below # if have preferred distributor, pull 1 , make first default that. if !preferred_distributor.blank? s = distributor.find_by_sql ["select cnam05 cnam05, cusnp1 cusnp1 distj01 cusnp1 = ?", preferred_distributor] d << { :name => s[0].cnam05, :id => s[0].cusnp1 } unless s.blank? end # if have account number, can choose purchase direc

oop - Anyone able to help move a C# framework 4.5 class library to a compatible framework with XNA 4.0? -

i've been working class library built against .net 4.5 , , in middle of development had move view of project xna. i'm running compatibility errors between view , model. know how change version of .net existing project? creating new project seems less ideal flipping switch somewhere in options. i solved problem, merely switching framework .net 4.0, in properties pane. don't believe using specific 4.5.

Java File path encoding? -

i have made simple app asks user folder name in later copy files. problem folder name contain non lating (greek) characters. , while folder being created correct name , no errors, when store absolutepath in string greek characters ?????? _22-03-2012. when try use stored path send copied files error because java can't read path properly! any ideas? (clearly i'm new java bare me plz!) package neworderandxcopy; import java.io.file; import javax.swing.joptionpane; import initiate.*; public class neworder { private string orderpath = null; //constructor public neworder() { if(newordername()) { file no = new file(orderpath); no.mkdir(); } } public boolean newordername() { boolean name = false; int counter = 3; while(counter > 0) { string test = joptionpane.showinputdialog("here ask user give order name form -> ΠΑΡΑΛΑΒΗ ΧΧ-ΧΧ-ΧΧΧΧ (π.χ. ΠΑΡΑΛΑΒΗ 12-04-2013):"); if(!test.matches("ΠΑΡΑ

javascript - Ascensor plugin div between section -

i using ascensor plugin website. have this <section>section 1</section> <section>section 2</section> what trying put div between sections, ascensor takes height , width of screen , stretches section based on screen causes div not appear. did create: <section>section 1</section> <section class="slicer" style="height:400px !important;">slicer</section> <section>section 2</section> it worked have space between section , slicer. ideas on how rid of space??

asp.net - how to fetch the data from string input and save into datatable -

Image
i want fetch data string input passenger name, base fare, total fare,commission, fop. field, showing in below image. field, want store in data table. column name is:- passenger name, base fare, total fare,commission, fop. this string input:- string request= @"tst00009 dca1s211e rh/07feb f n ld 13feb13 od sansan si t-e fxp/r,u 3.macdorman/sam corbin (chd) 1 san ba 272 n 24jun 825p ok nhxuqcnj ch 24jun24jun 1pc 2 o lhr ba 273 n 07aug 325p ok nhxuqcnj ch 07aug07aug 1pc san fare u usd 492.00 tx001 x usd 458.00yqac tx002 x usd 5.50ycae tx003 x usd 17.20usap tx004 x us

Why doesn't SQL Server tell me which field is causing the error? -

this question has answer here: why can't sql server tell me column causing error 3 answers when doing sql insert, may fail because 1 of fields fail validate. there variety of validations may fail. example have seen: [22003] [microsoft][odbc sql server driver][sql server]arithmetic overflow error converting varchar data type numeric. (8115) and [22001] [microsoft][odbc sql server driver][sql server]string or binary data truncated. (8152) it quite frustrating go hunting troublesome field when have many columns , inserting many rows @ time prepared statements. why can't sql server tell me field problematic? please note not looking on how solve these individual errors, rather more fundamental question why better error messages not implemented. edit: why can't sql server tell me column causing error being marked duplicate off doesn't answer ques

sql - Limit the number of rows per ID -

i trying limit number of rows per case 5 rows. cases have 1 or 2 rows have 15 or more. this example of stored procedure using count number of rows per case. select row_number() over(partition rce.reportruncaseid order rce.reportruncaseid) row, rce.reportruncaseid caseid, year(rce.ecodate) ecoyear phdrpt.reportcaselist rcl inner join phdrpt.rptcaseeco rce on rce.reportid = rcl.reportid , rce.reportruncaseid = rcl.reportruncaseid group rce.reportid, rce.reportruncaseid, year(rce.ecodate) order rce.reportruncaseid, year(rce.ecodate) here screenshot of stored procedure produces: screenshot i have tried use clause not allow me place window function after clause. not recognize "row" alias. is there way count number or rows per case (instead of window function) can use clause? or there way limit records per case 5 using existing stored procedure? thank in advance help. you can wrap statement in cte since sql server supports i

javascript - Extract Variable from jQuery object -

this question has answer here: javascript object: access variable property name string [duplicate] 3 answers i have single object returns following: {left: "642px", top: "305px", opacity: "1"} i trying break these out 3 separate variables: var left , var top , , var opacity what simplest way go this? use: var data = {left: "642px", top: "305px", opacity: "1"}; var left = data.left, top = data.top, opacity = data.opacity; demo: http://jsfiddle.net/dxxuc/1/

combinations - Combinational Circuit with LED Lighting -

combinational circuit design question. ____ | | f | | b | | ____ | g | e | | c | | ____ d suppose led display. take input of 4 bit (0000)-(1111) , display hex of it. example if (1100) come in display c turning on afed , turning off bcg. if (1010) comes in display turning on abcefg , turn off d. these display capital letters there no visual difference between 0 , d , 8 , b. develop truth table , optimized expression using karnaugh maps. i'm not sure how begin. truth table using (w,x,y,z) input variable or abcdefg variable since it's 1 turning on , off? input (1010)-->a--> abcefg~d (~ stand not) input (1011)-->b--> abcdefg input (1100)-->c--> adef~b~c~g so hex 0-f give me min. term canonical use karnaugh map optimize it? grateful! 1) map lights bits: abcdefg, truth table be: abcdefg input (1010)-->a-->1110110 and on. you have big table (with 16 rows). 2) follow

c# - Check for empty fields in form -

this question has answer here: find controls in wpf window type 15 answers checking unfilled fields php 3 answers is possible check form empty text boxes rather having put check on each individual text box if? appreciated. i'm not familiar wpf, might try list of child-elements in form, , each, check if of type textbox . if so, perform validation.

Output multiple objects from function R -

i'm not sure if question exists or not. after looking around internet, can't find relates specific problem. so, in r programming, mass output objects (specifically time series objects) data frame splitting it. before this, have been pasting duplicate concatenation commands each user , feels extremely tedious process, wondering if build function split data frame variable, apply ts() function, label object created, , output objects created. now ideally, first thing thought of using command , apply function each split. example, below code tried (note, small example, real data frame larger this). #test df stackoverflow df<-data.frame(user=c(rep(1,5),rep(2,5),rep(3,5),rep(4,5))) df$values<-c(10,20,30,40,9,19,29,39,11,21,31,41,12,22,32,42,8,18,34,44) #playing around command dd<-by(df,df$user,fun=function(x){ time = ts(x$values,freqency=2), label = x$user[1], label<-time, return(label) }) the error says there's error squiggly bracket. i've look

javascript - Angular.js and DAO pattern -

first of must admit quite new angular.js , haven't used new generation js framework backbone or knockout before. i'm creating application communicates server using restful api. dug lot angular documentation , blog notes right. i found examples $resource . looks pretty good: many built-in methods, when design rest interface don't have write more. but (and whole team too) more used javaee way of thinking model layer: lightweight model classes (pojo, etc), dao classes persisting , fetching model , optionally service layer between dao , controllers. on other hand in angular $resource creates more resembling active record. i've come 2 ways how implement dao pattern in angular: writing scratch, going down $http abstraction level. i'd implement every dao method $http call, take care errors. using $resource objects lightweight model classes , passing them daos unit responsible calling actions .$save() on them. of course cannot prevent calling in different plac

ironpython - Python: sys.path.append vs. import? -

i have (single) .py script. in it, need import library. in order library found, need call sys.path.append. however, not want hardcode path library, pass parameter. so problem if make function (set_path) in file, need import file, , import fails because path not yet appended. what ways solve problem? clarification after comments: i using ironpython, , library path path cpython/lib. path (potentially) different on every system. as far know, cannot pass via sys.argv, because script run in embedded python interpreter, , there no main function. maybe pass file argument using sys.argv, add path , import it. run program this: python my_program.py somefolder/some_import.py here's reference using sys.argv: http://www.pythonforbeginners.com/systems-programming/python-sys-argv/

How can i declare a file name in c language? -

i have c module: #include "stdafx.h" #include "targetver.h" #include "libavutil\mathematics.h" #include "libavcodec\avcodec.h" file filename; i did file filename; this have init function: void init(const char *filename) { filename = filename; avcodec_register_all(); printf("encode video file %s\n", filename); so did filename = filename; reason did have function did called start(): void start() { /* open */ if (avcodec_open2(c, codec, null) < 0) { fprintf(stderr, "could not open codec\n"); exit(1); } // f = fopen(filename, "wb"); errn = fopen_s(&f,filename, "wb"); if (!f) { fprintf(stderr, "could not open %s\n", filename); exit(1); } } and in start had filename didn't find wanted use filename instead. i'm getting few errors: on line: filename = filename; on = symbol i'm getting red line

sql - Creating a Stored Procedure -

i trying create stored procedure allow me update actualarrivaldate , actualdeparturedate in tripstop table stoptypecode = drop in tripstoporder table. create proc spupdatetable @orderid int, @arrivaldate datetime, @departuredate datetime begin begin transaction select * dbo.tripstoporder join dbo.tripstop on dbo.tripstoporder.tripstopid = dbo.tripstop.tripstopid orderid = ''and stoptypecode ='drop' once find record need grab tripstopid , pass update statement. not sure how this...can use temp table run select statement pick tripstopid? update dbo.tripstop set arrivaldate='',departuredate='' tripstopid = '' end commit any ideas or suggestions appreciated. ~newbie~ instead of doing select , update, change clause in update statement: where tripstopid = (select t.tripstopid tripstoporder o inner join tripstop t on o.tripstopid = t.tripstopid orderid = @orderid , stoptypecode = 'drop')

drop down menu - Excel - Creating a dynamic dropdown of values that match a string -

in excel trying create dropdown pulls in values part of value in cell next dropdown so have spreadsheet 2 columns, description , price. i have spreadsheet have dropdown , in cell left of dropdown enter text. when entering text, want dropdown find values in other spreadsheet text matches. finally once click dropdown take price cell right. first of know if possible. if if give me little guidance in how it appreciated. i'm not expecting fools guide nudge in right direction , i'll work out rest. thanks mike i managed using vb code in end.

sql server - T-SQL : Get Current + Previous years from date table -

i have year values 2009 2015 in date table. want years min(year) current(year). how can achieve this? thank you just select thouse "smaller or equal" current year select * table datepart(year, date) <= datepart(year, getdate())

VS 2012 Bug? - Driver Package Project does not always use Output Directory -

in process of moving driver project wdk8 , visual studio 2012, came across minor issue regarding driver package output directory configuration. fortunately, easy reproduce using standard project templates , these steps: open vs 2012 , choose new project start page in "new project" dialog, choose installed | templates | visualc++ | windows driver | networking | filter driver: ndis. change location c:\projects, select "createdirectory solution", , click ok. in standard toolbar, choose x64 in solution platform dropdown. in solution explorer, select both projects, right click , choose properties shortcut menu. choose "all configurations" in configuration drop down, set configuration properties | general | output directory "$(solutiondir)bin\$(platform)\$(configurationname)\" place output in bin subdirectory in solution directory , click ok. @ point, dir \projects\ndislsf1 returns: directory of c:\projects\ndislwf1 04/25/2013 0

sql server - What to do when IDENTITY column has been exhausted -

how reseed identity column in sql when have existing data ? there easy way perform operation data updated identities (which reflected on associations foreign keys aswell) ? edit: happen if reach limit of identity column ? in case ? why asked question. want understand how kind of problem can solved. there no way automatically. write own set of scripts done, not aware of comercial (ms or other) solution "compress" existing identity range. but, aaron said, why want in first place? sql server's identity values not guaranteed free of gaps or monotonically growing. more details check out http://sqlity.net/en/792/the-gap-in-the-identity-value-sequence/ if need values monotonically growing or continuous might have develop own "value provider service".

c - Putting output from rand() into an array -

i wrote small dice rolling program print out results of many dice rolls entered. want count how each number occurs thought put output rand() function array , search array different values. don't know how put numbers array not entered in manually. #include <stdio.h> #include <stdlib.h> #include <time.h> int main(void) { int count; int roll; srand(time(null)); printf("how many dice being rolled?\n"); scanf("%d", &count); printf("\ndice rolls\n"); (roll = 0; roll < count; roll++) { printf("%d\n", rand() % 6 + 1); } return 0; } #include <stdio.h> #include <stdlib.h> #include <time.h> int main(void) { int count; int roll; int* history; srand(time(null)); printf("how many dice being rolled?\n");

iphone - How to replicate the CNN iOS app pull down menu -

Image
does know how cnn doing top pull down menu? it looks uitableview called touch drag event wasn't sure. googled various keywords not able turn up. looking guidance on how replicate behavior. i guess doing https://github.com/mikefrederick/mfsidemenu you have customize "mfsidemenu" lot though. if dont want show menu on every view need disable uigesturerecognizerdelegate on view. there https://www.cocoacontrols.com/controls/pullableview may need add uigesturerecognizer class.

Download many files in parallel? (Linux/Python?) -

i have big list of remote file locations , local paths them end up. each file small, there many of them. generating list within python. i download of these files possible (in parallel) prior unpacking , processing them. best library or linux command-line utility me use? attempted implement using multiprocessing.pool, did not work ftp library. i looked pycurl, , seemed wanted, not run on windows 7 x64. i use pscp things this, , call using subprocess.popen for example: pscp_command = '''"c:\program files\putty\pscp.exe" -pw <pwd> -p -scp -unsafe <file location on linux machine including machine name , login, can use wildcards here> <where want files go on windows machine>''' p = subprocess.popen( pscp_command, stdout=subprocess.pipe, stderr=subprocess.pipe ) stdout, stderr = p.communicate() p.wait() of course i'm assuming linux --> windows

internet explorer 9 - Javascript: why is our website extremely slow in a Terminal Services session? -

we created website relies heavily on javascript , has quite lot of dom-elements. in browsers, ie7 , ie8, works fine. user experience bit faster , more responsive in ie9, chrome , firefox, our clients use ie7 don't complain. but... clients use remote desktop complain our website much slow, when using ie9 on windows 2008 server (64-bit). pages take 1 second load, take 30 seconds! reason not slow internet connection, other websites load quickly, our website doesn't. , when these clients use chrome it's fast, problem somehow in combination of remote desktop , ie. now here comes strange part : when button "compatibility mode" clicked in ie9, our website fast again! what cause these extreme differences in speed? we thought using <!doctype html> in ie9 best practice, seems in remote desktop session somehow should use quirks-mode or force compatibility mode?? any thoughts on subject? update we found solution : disabling css rounded corners

asp.net mvc 3 - Whats wrong with my routes and actions? -

i asked question based on how create pages based on content table contains following: title , content . followed steps, understanding, in answer given . i created route so: public static void registerroutes(routecollection routes) { routes.ignoreroute("{resource}.axd/{*pathinfo}"); routes.maproute( "default", // route name "{controller}/{action}/{id}", // url parameters new { controller = "home", action = "index", id = urlparameter.optional } // parameter defaults ); routes.maproute( "contentmanagement", "{title}", new { controller = "contentmanagement", action = "index", title = "{title}" } ); } i assuming can routes this? can set multiple routes? assuming can pass title to controller action have done? i created model: namespace locapp.models {

Browser loading php script after submitting form using jQuery Form plugin -

i'm trying implement form using jquery form plugin. form has 3 text fields , file input , validating form in beforesend callback. problem is, whether validation passes or not, php script handles file upload gets loaded in browser, which, not want happen - need stay on form's page. you can take @ form , it's dependent files @ http://www.eventidewebdesign.com/public/testupload/ . indexing on directory, can take @ of related files. form on testupload.php. i'd appreciate if take @ code , me figure out what's going on here. please write following script instead of your, work. <script> $(document).ready( function() { // initialize , populate datepicker $('#sermondate').datepicker(); var currentdate = new date(); $("#sermondate").datepicker('setdate',currentdate); $("#sermondate").datepicker('option',{ dateformat:

mysql - Is it better to store list of each user's Blocked users for query exclusion in $_SESSION var, or to exclude in "real-time" with sub-query? -

on 1 of php/mysql sites, every user can block every other user on site. these blocks stored in blocked table each row representing did blocking , target of block. columns indexed faster retrieval of user's entire "block list". for each user, must exclude search results user appears in block list. in order that, better to: 1) generate "block list" whenever user logs in querying blocked table once @ login , saving $_session (and re-querying time make change "block list" , re-saving $_session ), , querying such: not in ($commaseparatedlistfromsession) or 2) exclude blocked users in "real-time" directly in query using sub-query each user's search query such: not in (select userid blocked blocked.from = $currentuserid) ? don't use $_session substitute proper caching system . more junk pile $_session , more you'll have load each , every request. using sub-select exclusions can brutally slow if you&#