Posts

Showing posts from June, 2011

indexing - To get details or to retrieve deleted notes documents -

what doing : from java code retrieving notes database , indexing documents of database using full text indexing using solrj client , saving indexed data of particular documents on full text server. suppose when same database comes again indexing, considered 1 of documents database deleted indexed on full text server, but document deleted notes database don't want keep (means want delete) indexed data on full text server of deleted document. so how know document deleted what thinking is , store document's id , db name while indexing, have record of indexed documents, can identify documents deleted particular database. any other efficient way? thank reading question. the document universal id of document unique identifier @ least complete database. you can document.getuniversalid() in java by design every unique id unique worldwide, designer can go around (unids writable) , replicas of course have documents same unique id. combine unid fil

There is no parameter $1 ...Sending SQL statement to Rails for Postgresql, what am I doing wrong? -

activerecord::base.connection.execute( "with numberofdays (select percent_change asset_histories date < $1 , asset_symbol = $2 order date desc limit $3) select stddev_samp(percent_change) stdev numberofdays", [day,symbol,daystolimit]) where day, symbol , daystolimit variables assigned before above code. assigned such: day = '2013-03-25' symbol = 'aapl' daystolimit = 20 i don't want use #{variable} because of potential malicious intent. referenced in title, statement returning pgerror error: there no parameter $1 line 1 ... date <$1 and... using postgresql 9.2 , rails 3.2 edit adding alternative solution found here: in addition mu short uses connection.method(:quote), couldn't find documentation on came across post quoting done such: a = activerecord::base.connection a.execute(%q{select * table id = #{a.quote(variable)}...}) from fine (

unable to find compatible version of spree with rails 4.2.5.1 -

i have installed spree 3.0.0 rails 4.2.5.1..can suggest version of spree should install?spree not working although gives bundle updated there no files in stylesheets , images etc when run rails g spree:site gives me following error folder.c:\rubyy\rails\myshoppingmall>rails g spree:site not find generator 'spree:site'. maybe meant 'spree:dummy', 'spree:install' or 'resource' run rails generate --help more options.

java - What Exception is thrown when an implementation breaks its interface's contract? -

through amount of debugging (i not wish repeat) i've found circumstance can arrived @ if 1 of objects given comparator breaks interface's contract (namely comparator compare(a, a) returns non-zero value). what kind of exception should throw? i thought take inspiration treemap, takes comparator, acts bizarrely (not throwing exception) if give nonsense comparator. the common way use java.lang.illegalargumentexception : throw new illegalargumentexception("one of objects given breaks comparators interface contract "); you can take @ documentation : thrown indicate method has been passed illegal or inappropriate argument.

Better Confluence Page Index Macro? -

i'm using confluence page index macro index sub-pages specific area. issue is, can't customize results generated macro. i have specific pages dedicated tag result. the question is: exist better page index macro? want have same output less content. regards!

Ruby on Rails redirect_to relative URL -

i have rails 4 app hosted behind cloudflare, flexible ssl option turned on, no ssl between cloudflare , app servers sit behind load balancer. so happens that, instance when user signs using https , redirect welcome page... redirect_to :action => :welcome ... or .... redirect_to "/users/welcome" ... rails throws http header "location: http://www.example.com/users/welcome ". breaks session , turns off ssl. i have tried config.force_ssl browser goes infinite redirect loop. i cannot switch app ssl because parts of have use http, , there's nothing sensitive on wire justify switching, , have or 60 different websites built on app, buying certificates of them cost small fortune. want cloudflare's ssl because users think "little green lock" means site safe , trustworthy :) so, there way make rails redirect using relative urls? opposed adding http://www.example.com ... in front of each url redirects to? tia i've found ea

javascript - jQuery disable scroll doesn't work in Firefox -

i use code in other projects , works fine. don't know wrong in code. works fine in chrome not in firefox. this code: $('body').on({ 'mousewheel': function(e) { e.preventdefault(); e.stoppropagation(); } }); body { height: 5000px; } <script src="//code.jquery.com/jquery-1.11.3.min.js"></script> example jsfiddle . the jquery version in project 1.11.3. some browsers have there default "scroll-overflow" not on body. instand on html or document. try $('html') or $(document) example. help

php pagination of an array with previous and next tab -

i have array contain around 1000 records. want display 20 array records per page. $list=array( array([title]=>"sony", [description]=>"camera"), array([title]=>"sony", [description]=>"mobiles"), array([title]=>"lenovo", [description]=>"laptop"), array([title]=>"lenovo", [description]=>"mobiles") ); i have used following code pagination. giving me long row pagination. can me include previous , next code existing code pagination good. $page = isset($_request['page']) && $_request['page'] > 0 ? $_request['page'] : 1; function display($list, $page = 1) { $start = ($page - 1) * 2; $list = array_slice($list, $start, 15); foreach ($list $key => $val) { echo $val['title'] . '<br/>'; echo $val['description'] . '<br/>'; echo &q

Is there a way to derive Num class functions in own data type in Haskell? -

let's have type declaration: data mytype = n double | c char | placeholder i want able treat mytype double whenever it's possible, num, real, fractional functions resulting in n (normal result) arguments wrapped in n constructor, , placeholder other arguments > (n 5.0) + (n 6.0) n 11.0 > (n 5.0) + (c 'a') placeholder is there way other defining class instance of classes in manner similar to: instance num mytype (+) (n d1) (n d2) = n (d1+d2) (+) _ _ = placeholder ... (which seems counter-productive)? there no generic deriving available in standard haskell : currently, deriving available defined compiler specific prelude typeclasses: read , show , eq , ord , enum , , bounded . the glasgow haskell compiler (ghc) apparently has extensions support generic deriving . however, don't know if save work try , use them: how many typeclasses need derive num instance from? and, sure can define automatic scheme deriving num want?

Get system local timezone in python -

seems strange, cannot find easy way find local timezone using pandas/pytz in python. i can do: >>> pd.timestamp('now', tz='utc').isoformat() out[47]: '2016-01-28t09:36:35.604000+00:00' >>> pd.timestamp('now').isoformat() out[48]: '2016-01-28t10:36:41.830000' >>> pd.timestamp('now').tz_localize('utc') - pd.timestamp('now', tz='utc') out[49]: timedelta('0 days 01:00:00') which give me timezone, not best way it... there command in pytz or pandas system time zone? (preferably in python 2.7 ) i don't think possible using pytz or pandas , can install python-dateutil or tzlocal : from dateutil.tz import tzlocal datetime.now(tzlocal()) or from tzlocal import get_localzone local_tz = get_localzone()

html - From container to container-fluid on XS devices -

i saw 1 question in subject - answer there doesn't works. so, said in title, have page <div class="container"> . want in extra-small devices (767px) , container become container-fluid . any suggestions? if @ bootstrap css file, .container class starts using fixed widths 768px upwards - below ( 767px , below ), spans 100% of parent, same container-fluid (default div behaivour albeit 15px of padding either side): @media (min-width: 768px) .container { width: 750px; } in other words, on face of it, it's pretty pointless if ask me following style applies @ viewports: .container, .container-fluid { margin-right: auto; margin-left: auto; padding-left: 15px; padding-right: 15px; } and since .container widths don't kick in until 768px , upwards, can see container , container-fluid styled same below 767px. edit - further op's comments, remove padding left / right side of container, first append secondary c

validation - silex validator using last constraint from previous collection item -

based on tutorial validation in silex i've created constraint: $constraint = new assert\collection([ 'token' => [ new assert\notblank(), new assert\length(['min' => constant::token_length, 'max' => constant::token_length]), ], 'languagecode' => [ new assert\notblank(), new assert\choice(['choices' => [constant::language_code_de, constant::language_code_en]]) ], 'startdate' => [ new assert\notblank(), new assert\date() ], 'enddate' => [ new assert\notblank(), new assert\date() ], 'duration' => [ new assert\greaterthanorequal(['value' => 1]) ], ]); which should match following structures (here json): { "token": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca4959

xml - How to deploy one maven project to different nexus locations -

my maven-project build in "modes" production , develop through maven profiles. at moment deploy production code nexus repo, have deploy develop mode well, should stored @ nexus-folder, because have use project in maven project, this: <!-- profile a: --> <dependency> <groupid>com.mavenproject</groupid> <artifactid>mavenproject-production</artifactid> <version>1.0</version> </dependency> <!-- profile b: --> <dependency> <groupid>com.mavenproject</groupid> <artifactid>mavenproject-develop/artifactid> <version>1.0</version> </dependency> could me here? have create second pom.xml, because artifactid of pom.xml unique , cannot deploy nexus "mavenproject-production" and/or "mavenproject-develop" inside 1 pom? best regards

angularjs - Run python scripts from website -

i needed bit of guidance should read more on following problem: i have few python scripts in folder on network drive run daily , want create website display scripts in form of list , when click on them want them running. is there way solve problem angularjs ? thanks help okay, have small node server changed bit purpose, know isn't ideal server, should job. response on post request should depend on weather want fire python script or want output too. from frontend, send post request data containing path python script or else, , change post case yourself. use angular loop read through list, can json served static folder in directory. this server not secure means , can cracked in short while, local scenario serves purpose. also, if don't wanna use this, remember can server list endpoint page , populate html using ng-repeat , send post requests either script relative path or script name , handle paths @ backend, takeaway. sorry couldn't post frontend

python - how to configure django to run migration files in a specific order -

i have project requires me insert initial data database on migration. works fine except need tell django insert specific data linked migration file before running another. for example, lets have 2 migration files, , b, , each attached models modela , modelb respectively. migration works fine, b, automatically generating sql statement requires me use modela.objects.get(id=id) while generating statements, error modela.doesnotexist , means migration hasn't been saved. is there way can ensure data inserted migration has been saved before proceeding run migration b? as @tom-dalton mentioned way go through dependencies. you can see example of dependency in migration file here in docs . they written in following format: from django.db import migrations, models class migration(migrations.migration): dependencies = [("your_app_name", "migration_file_name")] operations = [ # migration operations here ] you can find migratio

java - How can I combine these two Regex statements into one with String.repalceAll() -

i have string, "36635,36635,36635,36635 36635 36635 36635 36635-36635-36635" by end of like 36635 36635 36635 36635 36635 36635 36635 36635 36635 36635 i've managed achieve below code. string original = "36635,36635,36635,36635 36635 36635 36635 36635-36635-36635"; string justspaces = original.replaceall("[^0-9]", " "); string onespacemax = justspaces.replaceall(" {2,}", " "); system.out.printf("original: %s \n justspaces: %s \n onespacemax: %s", original, justspaces, onespacemax); output original: 36635,36635,36635,36635 36635 36635 36635 36635-36635-36635 justspaces: 36635 36635 36635 36635 36635 36635 36635 36635 36635 36635 onespacemax: 36635 36635 36635 36635 36635 36635 36635 36635 36635 36635 how can combine 2 regex statements? i've attempted using or | operator no luck. use: original = original.replaceall("\\d+", " "); \\d+

jquery - Bootstrap sub-nav open on nav hover -

i have menu , submenu. achieved hover on menu opens submenu when mouse moves submenu, gets closed. i have added jsfiddle html/js have made. know missing something, cant find it. jsfiddle: https://jsfiddle.net/64r4s8ok/2/ here js script: $(".opensubmenuonhover").hover( function () { var thisdiv = $(this).attr("data-target") $(thisdiv).collapse("show"); //$(thisdiv).show("slow");//("show"); }, function () { var thisdiv = $(this).attr("data-target") $(thisdiv).collapse("hide"); //$(thisdiv).hide();//("hide"); } ); regards you omit second handler .opensubmenuonhover won't close if hover-out. then apply handler hover-out event of container. close if hover-out entire menu. like this: $(".opensubmenuonhover").hover( function () { var thisdiv = $(this).attr("data-target"); $(this

android - I am making a simple login check application -

when trying run application through android device gets error as error in http connection org.apache.http.conn.httphostconnectexception: connection http://192.168.0.105 refused. i using same network computer , device. in mainactivity have httpclient httpclient = new defaulthttpclient(); httppost httppost = new httppost("http://"+ip+"//zeditsho_app/login.php"); httppost.setentity(new urlencodedformentity(namevaluepairs)); httpresponse response = httpclient.execute(httppost); httpentity entity = response.getentity(); and ipconfig activity public class ipconfigactivity { public static string ip="192.168.0.105"; } could me sort out this?

maven - How to pack a jar in root directory of a war -

i have war , want put 1 jar inside war (root directory), not inside lib. tried in <jarmodule> "bundledir". didn't work. excepted structure below a.war --- meta_inf ----web_inf ----b.jar

c - XML to postscript using xsltproc -

i'm trying produce postscript file xml document. can produce plain text or html output using xsltproc . xsltproc --output output.txt xslfile.xsl input.xml is there way produce postscript file command line or programmatically using c? one possibility achieve converting xml-file xsl-fo , use apache-fop transform postscript-file with fop -xml input.xml -xsl xml2fo.xsl -ps output.ps at moment couldn't find simple xsl-file on net task, depends on output anyway. creating basic xslt transformation should not hard. edit: completeness: possible output-formats of apache-fop are -pdf outfile input rendered pdf (outfile req'd) -pdfa1b outfile input rendered pdf/a-1b compliant pdf (outfile req'd, same "-pdf outfile -pdfprofile pdf/a-1b") -awt input displayed on screen -rtf outfile input rendered rtf (outfile req'd) -pcl outfile input rendered pcl (outfile req'd) -ps outfile inp

android - AutoCompleteTextView Not Working Properly on adding data from Database -

i have autocompletetextview works fine when define string statically this.. private string names[] = {"hassan", "usman", "kristen stewart"}; then this.. arrayadapter<string> adapter = new arrayadapter<string> (this, android.r.layout.select_dialog_item, names); //getting instance of autocompletetextview catgnames.setthreshold(0);//will start working 0 character catgnames.setadapter(adapter);//setting adapter data autocompletetextview but when try load data sqlite , drop down suggestion doesn't work. i'm doing this.. categories = new string[100] int =0; databasehandler db = new databasehandler(this); list<entries> entries1 = db.getcategories(); (entries cn : entries1) { log.i("", cn.getcategories()); names[i] = cn.getcategories(); i++; } and after define adapter.. arrayadapter<string> adapter = new arrayadapter<string>

c# - Entity Framework 6 Mixed Stored Procedure and SQL Query Generation -

reading ef documentation on codeplex understand it's not possible use both mixture of stored procedure , sql query generation persisting domain model changes. however, there numerous reasons why find frustrating doesn't allow me use mixture of both when predecessor - linq 2 sql, allowed me this. i have complicated scenario persisting domain model multiple tables in database, whereby want use stored procedure insertion. reason why don't want use stored procedure updates there isn't clean way run update on columns affected - parsing values update sproc have update fields record (unless select old values again comparison or include fields in update statement predicate clause - kind of messy both ways). problem due triggers being attached table in individual fields checked updates, more of legacy system issue - won't go down road of subjective matter of using triggers being design. passing fields update sproc if haven't changed unnecessary , can contrib

java - Eventually , is enum a class? -

this question has answer here: what differences between java enum , class private constructor? [duplicate] 5 answers if write enum below , public enum states{ } ide generating .class file states.class in target, same if have written class named - states so here , .class file tells me existence of java byte code enum type or mean enum type of java class type? yes enum type of java class. values of enum possible instances of class.

java - Android Studio libgx project throw Exception, when "compile 'com.google.android.gms:play-services:8.4.0'" add in my project? -

Image
i create libgdx project in android studio. , want add admob banner in project. add lines in build.grandle(project: myapplication): project(":android") { apply plugin: "android" configurations { natives } dependencies { /*some codes...*/ compile 'com.android.support:appcompat-v7:23.1.1' compile 'com.google.android.gms:play-services:8.4.0' } } and error: unexpected top-level exception: error:execution failed task ':android:transformclasseswithdexfordebug'. com.android.build.api.transform.transformexception: com.android.ide.common.process.processexception: org.gradle.process.internal.execexception: process 'command 'c:\program files\java\jdk1.7.0_79\bin\java.exe'' finished non-zero exit value 2 normally, when created android studio project , put need code line project admob, works. dont fix problem lingdx project. try adding lines build.grad

powershell - Matching string of pattern and size -

i want search text file 2 strings. output printed if first string greater 8 characters. here command trying run: get-content -path .\std_server*.out | select-string '((if "cpu=" -gt 8)|application=")' | out-file -width 1024 .\test.txt so want search file std_server*.out both values cpu , application, want print these values if value cpu greater 8 characters. how do that? currently, have basic version works '(cpu=|application=")' , prints out values of cpu, , want application printed out when cpu unreasonably high value (cpu > 8). thanks in advance. that nested logic if won't work have seen. need quantifier characters match after cpu= in order define conditional match there. could measure match post processing might create more headache since have work around application=" matches well. presumably file have string @ start of line , nothing else follows them? ensure correct matches idea use anchors. also mi

javascript - User Name display as after login -

i want display logging user name. below given code working perfect same page working. want home.php display. login.php if($check_user>0) { $_session['user_name']=$username; echo "<script>window.open('home.php','_self')</script>"; } home page coding <?php echo($_session['username']); ?> but code undefined index error showing. how can call session username in home page you have undefined index because setting $_session['user_name'] , try read $_session['username'] . change home page code to: <?php echo($_session['user_name']); ?>

Subclass of parse.com object in javascript properties after query -

i'm using parse.com backend project , creating web page using javascript. i'm extending pfobject follow: var match = parse.object.extend("match"); on match object have couple properties, let first 1 "player1" my question how can make when try property of match object succeeds ie: var matchquery = new parse.query("match"); matchquery.find({ success: function (results) { _.each(results, function (element, index, list) { // var test = element.player1 <<<< here player1 undefined }) }, error: function (error) { alert("error: " + error.code + " " + error.message); } }); thanks tips! setting values on backbone object works regular js. value retained long object in memory, no longer. match.memoryonlyattribute = "i'll gone soon"; if match released , queried again, memoryonlyattribute null, have observed. to va

javascript - Send email after successful user registration using meteor js -

i want add email functionality application. have added email package , followed steps according documentation provided i want when user registers itself, email should sent after successful registration. here tried: server/smtp.js: meteor.startup(function () { smtp = { username: 'abc@gmail.com', // eg: server@gentlenode.com password: 'abc123', // eg: 3eep1gtizk5eziohfervu server: 'smtp.gmail.com', // eg: mail.gandi.net port: 25 } process.env.mail_url = 'smtp://' + encodeuricomponent(smtp.username) + ':' + encodeuricomponent(smtp.password) + '@' + encodeuricomponent(smtp.server) + ':' + smtp.port; }); here server/emp_details.js have called methods. following code placed inside meteor.methods() : sendemail: function (to, from, subject, text) { check([to, from, subject, text], [string]); // let other method calls same client start running, // without waiting email sending com

objective c - App crashes after adding Realm framework in objectiveC -

i had added realm.framework project following how add parent path realmswift.framework in “framework search paths” section? link. though had followed steps given in above link, still app crashes error dyld: library not loaded: @rpath/realm.framework/realm referenced from: /users/softence-one/library/developer/coresimulator/devices/b602ce3a-bf0a-434f-96ff-ba749b4a7d70/data/containers/bundle/application/e8937185-3ebc-4314-a5e8-31cef89a40a5/cityguide.app/cityguide reason: image not found so please suggest me link install realm.framework correctly in objective c. in advance this issue caused not adding framework "embedded binaries" section of project's settings. see these instructions in realm's docs steps in objective-c installation.

java - Wrong Time Unit -

i need may load @ first bacground (setcontentview(r.layout.activity_logo); ) after (6 second) text in textview4. program make wrong. after start application, app wait 6 second , next build setcontentview(r.layout.activity_logo); , write textview4 why? thanks protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_logo); try { timeunit.seconds.sleep(6); textview textview4 = (textview) findviewbyid(r.id.textview4); textview4.settext("alalaalalalalalal"); } catch (interruptedexception e) { e.printstacktrace(); } } protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_logo); handler mhandler = new handler(); mhandler.postdelayed(new runnable() { @override public void run() { textview textview4 = (textview)

c# - Xamarin - Databinding in a ViewCell -

how controls in xamarin forms viewcell bound for example, when add following databinding label, part of view of viewcell, binds bindingcontext of viewcell (i presume). how logic implemented? textproperty property of label query viewcell's datacontext? lbl.setbinding(label.textproperty, new binding(path: "time", stringformat: "{0:dd mmm}")); the answer can found here: https://blog.xamarin.com/introduction-to-data-binding/ while bindingcontext property of each target object can individually set, isn’t necessary. bindingcontext special property that’s inherited children. therefore, when bindingcontext on contentpage set detailsviewmodel, of children of contentpage have same bindingcontext, , can bind public properties of detailsviewmodel

visual studio - How to debug fluent APIs? -

fluent apis awesome. give concise , readable code. severe pain when works not expected. are there ways see intermediate results of method calls chain in vs? may add-ins? since vs 2012 is possible see returned results of methods in chain. see autos window.

ruby on rails - How to add pagination inside a bootstrap modal -

i have user's list , when click on 'show activities' shows list of user activities in modal partial file _user_activities.html.haml . activities list paginated view. want add pagination activities alone inside modal window. how this? using will_paginate , makes page reload. how achieve this? users/index.html.haml %table %thead %th name %th actions %tbody - @users.each |user| %tr %td= user.name %td %i.icon-play %div.modal.hide = render 'user_activities', user: user = will_paginate users :javascript $('i').click(function() { $(this).next(.modal).modal('show'); }); users/_user_activities.html.haml %table %thead %th name %td type %tbody - user.activities.eadch |activity| %tr %td= activity.name %td= activity.type = will_paginate user.activities one way achieve ajax type pagination kaminary gem. can set pagination kam

javascript - Form validation when using flux -

i using flux in application use backbone.view view layer. generally there store instance whole page, store save data(or state) of application, , view listener change event of store , when store trigger change event, view re-render accordingly. so far good, meet problems when use form, when use try submit form or blur event triggered element, want validate input in server , display errors possible, have done: when user hit submit button or value changed element,i dispatch action like: dispatch({type:"validate",value:"value"}); the store respond action , send request server when response back,i update store , trigger change event: store.validate_response=response; store.trigger("change"); the view(form in example) re-render itself. i can display errors can not keep value of element since elements in form re-rendered means display origin value rather value user typed. i have thought save typed values when dispatch validate action th

ios - userInterfaceIdiom returning wrong values on real devices -

my app rejected because there problem on ipad ui of app. have fixed before getting rejected checking if device ipad make minor adjustments ui measures. problem when call: uidevice.currentdevice().userinterfaceidiom //returns .unspecified traitcollection.userinterfaceidiom //returns -1 on real ipad .unspecified. why this? in order fix have created custom method works on real ipad public extension uidevice { func isipaddevice() -> bool { let identifier = deviceidentifier() return identifier.lowercasestring.containsstring("ipad") } private func deviceidentifier() -> string { var systeminfo = utsname() uname(&systeminfo) let machinemirror = mirror(reflecting: systeminfo.machine) let identifier = machinemirror.children.reduce("") { identifier, element in guard let value = element.value as? int8 value != 0 else { return identifier } return identifier + string(unicodescalar(uint8(value))) } re

ibm bluemix - IBM Containers: cf ic cpi ( copy command ) fails -

new ibm containers, working through ibm docs, page; https://www.ng.bluemix.net/docs/containers/container_images_adding_ov.html#container_images_copying states: copy image docker hub, bluemix, or private repository. can add copied image private repository, without downloading computer first, running cpi command. with example: cf ic cpi training/sinatra registry.ng.bluemix.net/my_namespace/my_sinatra:new i running on mac, inside docker command window, docker images repository tag image id created virtual size timdet/docker-whale latest a5bb741c4ac2 22 hours ago 274.3 mb hello-world latest 0a6ba66e537a 3 months ago 960 b gives me images both local & on private dockerhub { timdet} and cf ic images repository tag image id created virtual size registry.eu-gb.bluemix.net/ibmnode latest 0482321da78d 6 days ago 433.1 mb registry.eu-gb.bluemix

.net - How do I add members to classes in a Class Diagram? -

i discovered existence of class diagrams. @ first did think productive tool, realized amount of time takes add property class inside class diagram 4+ mouse clicks embarrassing compared writing code ("property foo bar" in vb). i looking keyboard shortcuts add possible members of class :properties, fields, methods , on. you can assign own keyboard shortcuts many class diagram commands. go tools - options , environment - keyboard . type diagram show commands containing field. see available commands , can define shortcuts them.

sql - how to valiate Millions of data? -

how validate scenario? scenario 1: source file flat file contains millions of data. data source file loaded target table in data base. now question how validate if data loaded in target table correctly?? note: can’t use xls validate have millions of records in it. there lots of ways 1 can validate data. of depends on 3 things: how time have validation? what processing capabilities? is data on qa or production sql server? if in qa , have lots of processing power, can basic checks: where there warnings or errors during data load? count total number of items in database vs. raw file count total number of null records in database check total number of columns vs. raw file check length of variables. expected? are character columns unexpectedly truncated? are numeric columns out correct number of significant digits? are dates reasonable? example, if expected dates 2004, 1970? how many duplicates there? check if data in columns make sense. few question

iOS : Zxing QR Code Reader in ipad not working in landscape orientation -

Image
i working on landscape only ipad app , trying integrate zxing qr code scanner library project. able integrate library, , run without compiler errors. issues even though application landscape, zxing camera view showing portrait. i not able scan using library. don't know whether camera layer showing in different orientation reason it. my project setup ipad landscape application target sdk : ios 6.1 deployment target : ios 6.0 or above zxing version : 2.1 testing on : ipad 2, ios 6.1 my code well, code simple, calling zxingwidgetcontroller homeviewcontroller , implemented delegate methods.. delegates never getting fired. homeviewcontroller.h @interface homeviewcontroller : uiviewcontroller<zxingdelegate>{ } @end homeviewcontroller.m -(void) opencamerascanner{ zxingwidgetcontroller *ctrller = [[zxingwidgetcontroller alloc] initwithdelegate:self showcancel:yes onedmode:no]; ctrlle

memory management - Read array of unknown size from keyboard -

i want insert unknown number of values in array (no matter order). first read how many values inserted, allocate allocatable array, , read values, in following code program try implicit none integer :: n real, dimension(:), allocatable :: x write (*,*) "how many values?" read (*,*) n allocate(x(n)) write (*,*) "insert values" read (*,*) x end program what if want insert values without declaring how many before allocating array? think should use while cycle insert values in ascending order, till descending value insert, indicating sequence ended. think part of code following, index = 1 write(*,*) x read(*,*) x(index) exit = .false. while (exit.eqv..false.) index = index + 1 read(*,*) x(index) if (x(index)>x(index-1)) exit = .true. index = index - 1 end if end how declare array x ? i tried following solution, building on concept "a lot of memory allocation , reallocation" expressed @high performance mar

Two sets of double quotes batch file error -

why following batch script fail? because there 2 sets of double quotes? how work?? set income-code="test (bob, bob2)" if "%income-code%"=="null" ( set apcinvoice=%apcinvoice%, ) else ( set apcinvoice=%apcinvoice%%income-code%, ) two things. first , variable income-code has quotes in it. try short demonstration: @echo off set test1="this string spaces" set "test2=this string spaces" echo %test1% echo %test2% second , comparing literal string "null". there no null value in batch. please see post more details: what proper way test if variable empty in batch file... want compare empty string or use 1 of methods in question above if you're working more complex. if "%income-code%"=="" ( ... )

c# - How can I add a button in the center of a RepositoryItem in a column of a devexpress datagrid? -

i want add button image in middle of cell in column of devexpress datagrid. the click event should triggered when pressing button , not entire cell. how can add button in center of editor? have tried using repositoryitembuttonedit? assign necessary gridcolumn.columnedit property.

shell - How to include data from a variable in an interactive MySQL command? -

i'm trying write shell script dumps tables user specified table prefix. following part of script: variable=vardata mysql -u user -p -n information_schema -e "select table_name tables table_schema = 'dbname' , table_name 'test_$variable%'" accessing variable can't work this, because of hard quotes in sql statement, how else can it? tried mysql variables @var, doesn't seem work operator. you can try like variable=vardata sql_stmt="select table_name tables table_schema = 'dbname' , table_name 'test_"$variable"%'" mysql -u user -p -n information_schema -e "$sql_stmt" hope works updated : per comment j.doe

TCP/IP unacknowledged data storage -

we have windows 2003 server accessed ~100 clients connected through gb network , ~400 clients connected outside through t1 (1.5mbis/s) line internal network. clients ask server data size of 300 - 400kb. the server shows constant network load of ~1.6mbis/s , users have poor response time. my assumption on packet takes long time on t1 line until acknowledge received , "buffer" of unacknowledged data full local users must wait free slot in buffer. is possible reason our problem? , buffer reside (nic / tcp-stack / ...)?

ios - Update Application Badge With WatchKit and Widget (Today Extension)? -

in app update application badge after events using code works: [[uiapplication sharedapplication] schedulelocalnotification:localnotification]; however [uiapplication sharedapplication] cannot called watchkit or widget. there way widget update application badge other way? i tried using background fetch this. badge gets updated when explicitly "simulate background fetch" xcode. on actual device background fetch never gets called? idea command call background fetch? - (void)application:(uiapplication *)application performfetchwithcompletionhandler:(void (^)(uibackgroundfetchresult))completionhandler { // background fetch [[globalnotifications sharedinstance] setapplicationbadge]; completionhandler(uibackgroundfetchresultnewdata); } thanks insight on this. you correct schedulelocalnotification can called ios main app. watch app, if using watchos 2 can tell ios app schedule notification in background using watchconnectivity. recommend using wcse

c# - Floating controls in dynamic width container in XAML -

i new xaml , trying @ runtime add dynamic number of buttons container scales current window width , height. buttons should centered , placed beside each other , if there not enough space on 1 line, button wide moved above other buttons , on, resulting in "floating" behavior known html. if there enough buttons scale containers height larger window should possible scroll in container, part dont think problem "float" behavior cannot figure out how do. have tried available panels none seem suit purpose , thinking creating custom control positions child controls in way want, there must way can achived using standard controls? i developing in uwp universal app both desktop , mobile. thanks input problem :) maybe achieve want combination of relativepanel , couple of visualstates , visual state triggers such adaptivetrigger or windowsstatetriggers library. these define different visual states, each representing different layout of buttons , define tri

html - Align text in the middle, inline with icon -

can't seem piece of text align check icon, please , thanks <div class="col-md-12" style="background: #d9232a; padding: 20px;"> <div><i class="fa fa-check-square fa-2x"></i><p style="display: inline;"> sculptured</p></br></div> <div><i class="fa fa-check-square fa-2x"></i><p style="display: inline;"> 40mm triple glazing</p></br></div> <div><i class="fa fa-check-square fa-2x"></i><p style="display: inline;"> pas 23 & 24 approved</p></br></div> <div><i class="fa fa-check-square fa-2x"></i><p style="display: inline;"> highly security options</p></br></div> </div> the default alignment of inline elements baseline need reset vertica

Perform Query in Siebel using SWE api and CURL -

i'm try perform query in oracle siebel using swe api . used this approach these steps: logging app navigate screen want query invoke newquery method perform query all goes until step 4. documentation says invoke executequery method , specify value indicate search criteria. in following example, query record name called ip_webserver : http://localhost/smc_enu/start.swe?swecmd=invokemethod&sweapplet=smc+opportunity+list+applet&sweview=smc+opportunity+view&sweneedcontext=false&swereqrowid=0&swebid=-1&swemethod=executequery&swesetmarkup=xml& name=ip_webserver so tried approach, building url , adding @ end field want query , value need. abstract of list want query <list> <rs_header> <column required="false" id="501" name="contactnumber" text_based="true" html_type="text" read_only="false" list_editable="y" number_based="false&q

javascript - ngHide directive only works with ngRoute module after page refresh -

when login on app, want login , signup button disappear nav using ng-hide directive if login successful , token received server, store in cookies. nav part of index.html file. because using angular routing, when login successful, index.html not loaded again instead render home page through ng-view directive. the problem have refresh page ng-hide work. assuming because ng-hide part of index.html page, not reloaded. hoping there bette solution refreshing page every time logs in. here of relevant code. html <!-- navigation --> <nav class="navbar navbar-custom navbar-fixed-top" role="navigation"> <div class="container"> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-main-collapse"> <i class="fa fa-bars"></i> </button&g

Alternatives to android.widget.Gallery (not the Gallery app) -

apology if has been asked before, i've tried googling topic without result. i'm trying find replacement gallery widget google has decided deprecate. far have following candidates: viewpager. unfortunately (as far know), can display 1 view @ time. know has posted workaround here: https://gist.github.com/devunwired/8cbe094bb7a783e37ad1 . i'm having problem approach. on phone, 3 images shown (horizontally). left & right static, while middle 1 scrollable (like viewpager should do). i.e. left & right image doesnt scroll scroll viewpager. have turn down solution. gridview. seems good, seems gridview designed scrollable horizontally & vertically. want 1 row, , scroll horizontally. far know, gallery not designed in mind. horizontalscrollview. 1 google has suggested in javadocs (apart viewpager). seems 1 use, but... if understand correctly, using approach contents going instantiated front. there no lazy loading.. so i'm puzzled right here. seems best sol

sql server - Low Performance when using EF Code First and MS SQL Express Edition -

i have huge performance proble ef code first , sql express. if use clustured , nonclustured indexes, methods works slowly. how can optimize database , can ef codes? suggestions way coding? actually of pages has 100000 (one hundered thousand) row data. oof pages calls 1 row table have 600000 ( yes 6 hundered thousand) row data. use indexes slowness keeps going. shrinking harms indexes dont want use other optimization technique perfect me. for entityframework if don't need change tracking if not going update select data , update dbcontext, can use asnotracking() tell ef not track entity in manner ef not fuzzy change tracking management on entity when retrieved database. check following article: https://msdn.microsoft.com/en-ca/data/jj556203.aspx

android - How to Populate Facebook Audience native ads within RecyclerView -

i want implement native ads facebook audience within recyclerview. ads should positioned @ particular positions in recyclerview, let start @ position 2, every 5th position recyclerviw. have have adapterclass implement recyclerview , fragment responsible showing items user. adapterclass public class adapterboxoffice extends recyclerview.adapter<adapterboxoffice.viewholderboxoffice> { private layoutinflater layoutinflater; private arraylist<movie> mlistmovies = new arraylist<>(); private volleysingleton volleysingleton; private imageloader imageloader; private dateformat dateformat = new simpledateformat("yyy-mm-dd"); private int previousposition=0; private linearlayout nativeadcontainer; private linearlayout adview; private adchoicesview adchoicesview; private nativead nativead; adapterview.onitemclicklistener monitemclicklistener; private arraylist<movie> filteredproductresults = new arraylist<movie>(); public adapterboxoffice(contex