Posts

Showing posts from February, 2012

javascript - Ajax call url in an external js file -

i have web page (written in php / codeigniter) uses javascript code. i tried move javascript code external file better manage code. in document ready event load external file $.getscript('<?php echo base_url();?>assets/js/offerta_editscontirow.js'); one piece of code, putted in external js file, not work; instead works correctly if put code inside main php file. $.ajax({ datatype: 'json', url: '<?php echo site_url("offerta/applica_sconti");?>', cache: false, data: data, success: function (data, status, xhr) { ........ it not work because not elaborate php code, , in query string find "php echo site_url("offerta/applica_sconti");?>:" so, there way have works? may pass parameter external js file while loading it, , pass url used in ajax call? other method? kind regards, matt try window.my_url = 'some value&#

css - bootstrap modal footer issue -

i have minor css issue bootstrap footer found in modal. there line appears going across top. appears caused footer. had issue header well, removed , noticed in footer. can take peak see going on? <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.0/jquery.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> <div class="container"> <!-- trigger modal button --> <button type="button" class="btn btn-info btn-lg" data-toggle="modal" data-target="#mymodal">get started</button> <!-- modal --> <div class="modal fade" id="mymodal" role="dialog"> <div class="m

java - How to recreate this progress bar based JFrame? -

Image
i'm wanting create jframe , found perfect frame. want recreate this: the code frame looks this: progressbar = new jprogressbar(); statuslbl = new jlabel(); statuslbl1 = new jlabel(); percentlbl = new jlabel(); setdefaultcloseoperation(windowconstants.exit_on_close); settitle("auto-updater"); addwindowlistener(new windowadapter() { public void windowclosing(windowevent evt) { formwindowclosing(evt); } }); statuslbl.settext("status:"); statuslbl1.settext("n/a"); percentlbl.settext("0%"); grouplayout layout = new grouplayout(getcontentpane()); getcontentpane().setlayout(layout); layout.sethorizontalgroup(layout.createparallelgroup(grouplayout.alignment.leading).addgroup( layout.createsequentialgroup() .addcontainergap() .addgroup(layout.createparallelgroup(grouplayout.alignment.leading) .addgroup(layout.createsequentialgroup() .addcomponent(statuslbl).addpreferredgap(layoutstyle.componentp

c++ - CTabView syncronize after removeview -

Image
i have been struggling problem weeks. have mdi app, explore style. in right side, have ctabview, has 5 clistviews , 1 cformview. depending on choose in leftview (ctreeview), should remove (or add) formview ctabview. the ctabview re-arranged drag , drop (you drag ctestformview first tab), , stored in order. here link have sample project simulates problem: explore sample project in left view, have: as select "without test-form-view" item, ctestformview removed ctabview, using ctabview::removeview. to reproduce that, can following simple steps: go "with test-form-view" drag ctestformview first tab select, let's say, cexplorelistview4 select "without test-form-view" item in left view the "ctestformview" has disappeared ctabview, , first tab selected. right-click on cexplorelistview1, , see context menu of cexplorelistview 4 , not context menu of cexplorelistview 1 . if select treeitem leftview ("with-test-fo

javascript - google analytics code working on firefox but not on chrome -

i m new google analytics , bind click event google analytics on click of tag call ga(create ) , ga(send). but code work in on firefox, not on chrome? when use same site on firefox gave me result in analytics on chrome not showing result. thanks in advance. :) without more information, see hard know issue, things should consider: 1) append click event on document load. prevent errors if element not loaded. 2) create analytics instances after instead of doing on click. creating instance not send data tracked , ensure it's ready when send click event. 3) ensure there no other scripts causing issues. if 1 script faulty execution paused. check console errors. this seems work me. try code ua , check realtime section on analytics. // load analytics. (function(i,s,o,g,r,a,m){i['googleanalyticsobject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new date();a=s.createelement(o), m=s.getelementsbytagname(o)[0];a.async=1;

amazon web services - S3 hosting over CloudFront is serving application/octet-stream instead of HTML -

issue: s3 static hosting url serving right html page none of other url working fine. instead, download index.html file on web browser. request here because i've tried solutions found in research. domain: http://amber.fidento.com (via cloudflare) s3 static web hosting url: http://amber.fidento.com.s3-website-us-east-1.amazonaws.com cloudfront distribution url: d35jbnkk7p2igl.cloudfront.net using curl -i on each of above urls, application/octet-stream on output of 1st , 3rd url , text/html on 2nd. additional info: cors configuration: <allowedorigin>*</allowedorigin> <allowedmethod>get</allowedmethod> <maxageseconds>3000</maxageseconds> <allowedheader>authorization</allowedheader> bucket policy: { "version": "2012-10-17", "statement": [ { "sid": "publicreadgetobject", "effect": "allow", "pr

Javascript Disable Div and Pop A Loading Icon -

when click button, upload button, want have screen disabled , pop loading icon users have no access forms buttons , , know files being uploaded @ moment. any ideas on how ? in advance. a simple idea can have simple div having spinner , div should have 100% height , width check snippet. .spinftw { border-radius: 100%; display: inline-block; height: 30px; width: 30px; top: 50%; position: absolute; -webkit-animation: loader infinite 2s; -moz-animation: loader infinite 2s; animation: loader infinite 2s; box-shadow: 25px 25px #3498db, -25px 25px #c0392b, -25px -25px #f1c40f, 25px -25px #27ae60; background-size: contain; } @-webkit-keyframes loader { 0%, 100% { box-shadow: 25px 25px #3

android - use one fragment with different data in viewPager doesn't work -

this viewpager private class viewpageradapter extends fragmentpageradapter{ private final list<fragment> mfragmentlist = new arraylist<>(); private final list<string> mfragmenttitlelist = new arraylist<>(); viewpageradapter(fragmentmanager fm) { super(fm); } @override public fragment getitem(int position) { return mfragmentlist.get(position); } @override public int getcount() { return mfragmentlist.size(); } void addfragment(fragment fragment, string title){ mfragmentlist.add(fragment); mfragmenttitlelist.add(title); } @override public charsequence getpagetitle(int position){ return mfragmenttitlelist.get(position); } } and in main activity, public void setupviewpager() { viewpageradapter adapter = new viewpageradapter(getsupportfragmentmanager());

Compare elements of two arrays php -

so have 2 arrays: $badwords = array('bad-word', 'some-racist-term', 'nasty', 'bad-language'); $inputphrases = array('this-is-sentence-with-bad-word', 'nothing-bad-here', 'more-clean-stuff', 'this-is-nasty', 'this-contains-some-racist-term', 'one-more-clean', 'clean-clean', 'contains-bad-language'); i need compare elements of input phrases array bad words array , output new array phrases without bad words this: $outputarray = array('nothing-bad-here', 'more-clean-stuff','one-more-clean', 'clean-clean'); i tried doing 2 foreach loops gives me opposite result, aka outputs phrases bad words. here code tried outputs opposite result: function letscompare($inputphrases, $badwords) { foreach ($inputphrases $inputphrase) { foreach ($badwords $badword) { if (strpos(strtolower(str_replace('-', '', $inputphrase)), s

How can an out of date implementation gracefully process a new version of an OpenType font? -

you'll find below following text in section version numbers of ms opentype font file specification : implementations reading tables must include code check version numbers that, if , when format , therefore version number changes, older implementations handle newer versions gracefully. suppose 1 has written code read opentype font file version 1 , later on, code used process same font file, version 2. can't imagine how "gracefully" succeed, unless above statement means 1 has update code final version of font file, before processing it. you mistaking "graceful" "still parses font file". idea of spec there version numbers every parser explicitly checks version number, continues parsing versions knows how parse, , reports , deterministically behaves on versions not know with. graceful: start reading table read version number table struct check version number branch parsing function known version number report inabi

Difference between getCarrierName and getDisplayName in SubscriptionInfo on Android -

i have been trying figure out difference between getcarriername , getdisplayname in subscription info class. description android documentation doesn't lot. getdisplayname - name displayed user identifies subscription getcarriername - name displayed user identifies subscription provider name i think 1 of them home network , other current network (home or roaming). wasn't able distinguish 1 which. guess getcarriername returns home network , getdisplayname returns current network not sure.

tsql - Stored Proc /Table Index Improvement -

i'm looking comments on stored proc using in our application. gets called lot , think there room improvement. i'm looking see if adding index team , opp sp. we running on azure db. the schema for table following: create table [dbo].[teamhistorymatchups] ( [id] uniqueidentifier default (newid()) not null, [team] nvarchar (100) not null, [opp] nvarchar (100) not null, [result] int not null, [matchresulttime] datetime2 (7) default (getdate()) not null, primary key clustered ([id] asc) ); and here sp: create procedure [dbo].[up_getteampercentagev2] @team nvarchar(100), @opp nvarchar(100) begin set nocount on declare @totalresult int, @teamresult int --total matchups set @totalresult = (select count(*) teamhistorymatchups (team = @team or opp = @team) , (team = @opp or opp = @opp) , result = 1) set @teamresult = (select count(*) teamhistorymatchups team = @team , opp = @o

discord.net - C# Discord Bot opening then immediately shutting down -

whenever run discord bot code see terminal pop split second closes shows no errors @ all. output log mean didn't seem had errors put i'll post anyways incase needs it: https://pastebin.com/51bcdqwu here code i'm using run bot: using discord; using system; using system.collections.generic; using system.linq; using system.text; using system.threading.tasks; namespace discordbot { public class discordbot { discordclient client; public discordbot() { client = new discordclient(input => { input.loglevel = logseverity.info; input.loghandler = log; }); client.executeandwait(async () => { await client.connect("mzaymju1otm4mzaymzc3otg0.c9g5tq.x2iwvs6rbesn79soc9i9anuuzgi", tokentype.bot); }); } private void log(object sender, logmessageeventargs e) { console.writeline(e.message)

c# - Unable to cast object of type 'demo.Class1' to type 'demo.Class2' -

my object cannot converted other object please help it shows error: unable cast object of type 'demo.class1' type 'demo.class2'. public class class1 { public int a; public string b; public void hello() { console.writeline("abc"); } } public class class2 : class1 { public string d; } class program { static void main(string[] args) { class1 c = new class1(); c.a = 1; c.b = "a"; class2 c2 = (class2)c; } } please help the class 2 subtype of class 1. means can cast class2 objects class1 type not other way around. to clarify less abstract names: class1 animal , class2 dog. can dog animal, animal not dog.

Install rword2vec R package from github -

i new r programmer, , use rword2vec package described here : https://github.com/mukul13/rword2vec i find package interesting . new r used, don't know how use it, install it. when try install on windows pc, message : install_github("mukul13/rword2vec") error in curl::curl_fetch_disk(url, x$path, handle = handle) : couldn't resolve host name > thank help bests,

string - how to implement jaccard coefficient in java? -

assume have 2 strings this. query1: "ideas of march" query2: "ceaser died in march" function(j) = (query1 intersection query2)/ (query1 union query2) i looking @ accuracy respect number of tokens(words), irrespective position. query1 intersection query2 = 1 {march} query1 union query2 = 6 {ideas, of, march,ceaser, died, in} in context function(j) should return 1/6. is there anyway can find intersection count , union count of 2 sentences? example, in here, public double calculatesimilarity(string onecontent, string othercontent) { double numerator = intersection(onecontent,othercontet); double denominator = union(onecontent,othercontet); return denominator.size() > 0 ? (double)numerator.size()/(double)denominator.size() : 0; } is these available function in java intersection count , union count without using external libraries google guava? as interested in size of union/intersection, can calculate

java - How to find mode of an array, if one exists. If more than one mode, return NaN -

this question has answer here: write mode method in java find occurring element in array 13 answers as title states, need find mode of array. however, there few stipulations this: 1) if no mode exists (i.e. each element appears once, or equal times) return double.nan 2) if more 1 mode exists (i.e. {1,2,2,3,4,5,5,6} give 2 modes, 2 , 5) return double.nan basically, should return element of array if mode of array, , appears @ least once more other elements. other time, should return double.nan my current code returns mode. however, if 2 numbers appear equally, returns latter of 2 mode, not nan . also, doesn't return nan if no mode exists. any appreciated. here have far: public double mode(){ double[] holder = new double[data.length]; double tempmax = 0, permmax = 0, location = 0, arraymode = 0; (int = 0; < data.length; ++i) {

mongodb - How do I formulate find() based on multiple _ids? -

i trying retrieve 2 objects based on 2 object _ids. as demonstrated in code below, session.get(); function retrieves 2 _id , use in query. var selectedid = session.get('selecteditemidset'); selectedid = selectedid.tostring(); selectedid = selectedid.split(","); alert(selectedid); the alert above pops out 2 _ids : lzjka8s3wynwhakze, ikrbcdutthrwkecuv console.log("selectedid is: ",...selectedid); the above console() function yeilds: selectedid is: lzjka8s3wynwhakze ikrbcdutthrwkecuv buylist.find({_id:{ "$in": selectedid} }).fetch(); the query above returns 1 object, namely object _id: "lzjka8s3wynwhakze" , not 2 objects expected results. just clarify, expected result should 2 objects _ids: lzjka8s3wynwhakze, ikrbcdutthrwkecuv kindly point out doing wrong here?

php - Simple SQL Update Statement Syntax -

attempting update record within mysql database php. php noob i'm assuming i'm missing obvious. my new code (update-task.php) - submits , redirects record not updated. <?php $data = array( 'id' => $_post['id'], 'taskname' => $_post['taskname'], 'clientname' => $_post['clientname'], 'assignedto' => $_post['assignedto'], 'duedate' => $_post['duedate'], 'timelogged' => $_post['timelogged'], 'notes' => $_post['notes'], 'urgent' => $_post['urgent'] ); require('mysql.php'); $db = new mysql; $db->connect('localhost', 'my_user', 'my_pass;', 'my_db'); $db->query("update `my_table` set taskname='" . mysql_real_escape_string($data['taskname']) . "', clientname='" . mysql_real_escape_string($data['clientn

drop down menu - vue.js select v-model value not in $(element).val() -

i'm trying load form values cache on route load if navigates 1 route don't lose settings. checkboxes , text inputs working correctly. selects seem have issue. here's element: <select id="client" name="client[]" multiple="" v-model="chosen_clients"> <option v-for="client in clients" v-bind:client="client" :value="client.id">@{{ client.name }}</option> </select> first, check cache , update address bar: beforecreate: function(){ if(sessionstorage.getitem('invoiceable')){ router.push({ path: '/invoiceable?'+sessionstorage.getitem('invoiceable')}); } }, then bind data address bar: data: function(){ return { chosen_clients: this.$route.query['client[]'] ? (array.isarray(this.$route.query['client[]']) ? this.$route.query['client[]'] : [this.$route.query['client[]']]) : [], } }, lat

ios - UIApplication has no member shared -

im'm building app ios system swift language. have add project, core data. i have created 'coredatacontroller' this code of it: import foundation import coredata import uikit class coredatacontroller { static let shared = coredatacontroller() private var context: nsmanagedobjectcontext private init() { let application = uiapplication.shared.delegate as! appdelegate self.context = application.persistentcontainer.viewcontext } } at line uiapplication.shared.delegate ..... have error type 'uiapplication' has no member shared this appdelegade file import uikit import coredata @uiapplicationmain class appdelegate: uiresponder, uiapplicationdelegate { var window: uiwindow? func application(application: uiapplication, didfinishlaunchingwithoptions launchoptions: [nsobject: anyobject]?) -> bool { // override point customization after application launch. return true } func appli

excel - Hide Cells Based on Dropdown, Keeps activating when not selected -

i created vba object hide , activate cells based on if particular value selected. contained within first column. however, whenever continue edit other column once input information hides on me. the full codes below. it's same thing repeated 5 times over. thanks! private sub worksheet_change(byval target range) if target.column = 1 , target.row = 3 , target.value = "cashback" application.rows("4:7").select application.selection.entirerow.hidden = false else application.rows("4:7").select application.selection.entirerow.hidden = true end if if target.column = 1 , target.row = 3 , target.value = "content" application.rows("8:25").select application.selection.entirerow.hidden = false else application.rows("8:25").select application.selection.entirerow.hidden = true end if if target.column = 1 , t

ejb 3.1 - Error with hibernate search in ejbModule -

for final project, plan implement hibernate search in ejb module. since call remote client index database, have exeption below: caused by: org.hibernate.service.unknownserviceexception: unknown service requested [org.hibernate.search.hcore.impl.searchfactoryreference] please find below codes : 1. ejb session: import javax.annotation.postconstruct; import javax.ejb.localbean; import javax.ejb.stateless; import org.apache.lucene.search.query; import org.hibernate.session; import org.hibernate.sessionfactory; import org.hibernate.transaction; import org.hibernate.cfg.configuration; import org.hibernate.search.fulltextsession; import org.hibernate.search.search; import org.hibernate.search.query.dsl.querybuilder; /** * session bean implementation class hibernateindexer */ @stateless(name="hind") @localbean public class hibernateindexer implements hibernateindexerremote, hibernateindexerlocal { protected configuration config; protected sessionfactory sessio

shape - Tensorflow : Check failed: NDIMS == dims() (2 vs. 1) -

i following error after building graph of nn. when try execute : loss, _ = self._sess.run([self.loss_op, self.train_op], feed_dict=feed_dict) i error : f tensorflow/core/framework/tensor_shape.cc:36] check failed: ndims == dims() (2 vs. 1) asking tensor of 2 dimensions tensor of 1 dimensions i don't succeed know part of graph error related ... because, normaly graph build, shapes should correct ... not ? have idea ? thanks in advance

AM acronym meaning in directshow -

what meaning of directshow ubiquitous am acronym ? examples the com interface i am streamconfig ( msdn ) the am _media_type structure ( msdn ) am stands activemovie, 1 of previous names technology. directshow known internally quartz during development. first release activemovie 1.0 , released in july 1996. provided activex control media playback supported playback of mpeg 1,avi , quicktime videos audio files. there sdk provides tools , information developing filters , applications. however, second release year later, microsoft renamed directshow provide more consistent naming scheme along re-organisation of directx, activeanimation , activemovie development groups... if happen render video-enabled media file in graphedit sdk tool, popup window holding video feed still has title "activemovie window".

codeigniter - is this approach good to define environment with dotenv - PHP -

i'm using phpdotent , defined environment in end of index.php in codeigniter. works fine , wonder if approach good? or not require_once basepath . 'dotenv/autoloader.php'; $dotenv = new dotenv\dotenv(__dir__); $dotenv->load(); $en = getenv('app_env'); switch ($en) { case 'development': define('environment', 'development'); error_reporting(e_all); break; case 'testing': case 'production': define('environment', 'production'); error_reporting(0); break; default: exit('the application environment not set correctly.'); }

python - Selecting multiple slices from a numpy array at once -

i'm looking way select multiple slices numpy array @ once. have 1d data array , want extract 3 portions of below: data_extractions = [] start_index in range(0, 3): data_extractions.append(data[start_index: start_index + 5]) afterwards data_extractions be: data_extractions = [ data[0:5], data[1:6], data[2:7] ] is there way perform above operation without loop? sort of indexing scheme in numpy let me select multiple slices array , return them many arrays, in n+1 dimensional array? i thought maybe can replicate data , select span each row, code below throws indexerror replicated_data = np.vstack([data] * 3) data_extractions = replicated_data[[range(3)], [slice(0, 5), slice(1, 6), slice(2, 7)] you can use the indexes select rows want appropriate shape. example: data = np.random.normal(size=(100,2,2,2)) # creating array of row-indexes indexes = np.array([np.arange(0,5), np.arange(1,6), np.arange(2,7)]) # data[indexes] return element of

cross domain - Mapbox: How to solve CORS issue in map.addSource() -

i'm trying mapbox examples , notably this one . when example tries geojson points following code: map.addsource("earthquakes", { type: "geojson", // point geojson data. example visualizes m1.0+ earthquakes // 12/22/15 1/21/16 logged usgs' earthquake hazards program. data: "https://www.mapbox.com/mapbox-gl-js/assets/earthquakes.geojson", cluster: true, clustermaxzoom: 15, // max zoom cluster points on clusterradius: 20 // use small cluster radius heatmap }); i following error: blocking cross-origin request: "same origin" policy not allow view remote resource located @ https://www.mapbox.com/mapbox-gl-js/assets/earthquakes.geojson . reason: cors "access-control-allow-origin" header missing. i saw similar problems add in http header how here? this mapbox. server saying origin querying not allowed policy (check headers in options request). because policy isn't supporti

sql server 2014 - Calculate stock trading position for buy and take profit in ms sql -

i'm developing trading diary. there many positions having multiple buy , take profit transactions. here's sample: the initial position size 50 @20 usd one week later, sell 15 @22 usd another 2 weeks later sell again 15 @23 usd one week later, pullback comes price buy 25 @21 usd one week later, sell again 20 @23 usd another 4 weeks later sell 25 shares @25 usd one business rule following: actual p/l calculation, "last buy point" must used long have shares in place. in case, can deduct 2 x 15 shares (330 usd + 345 usd) initial 50 shares (1k usd). after buying 25 shares (after pullback), first have deduct 20 remaining shares (460 usd) initial position (50 shares 1k usd). last sell point of 25 shares (625 usd) have use second buy point of 25 shares @21 usd (525 usd). any appreciated. krgds sascha

redis - Rails ActiveJob - how to stop job from being enqueued in before_enqueue -

i running rails 4.2.8 , want make job run under conditions. doing check in code calling job cleaner contain logic in job class. has done that? class myjob < applicationjob before_enqueue |job| # check , stop job being enqueued under conditions end def perform(args*) # code here end end i using sidekiq 4.2.10 background job adapter. raise exception before_enqueue . info dhh himself: https://groups.google.com/forum/#!topic/rubyonrails-core/mhd4t90g0g4 this intent. never liked how returning false in filter stops execution. there many side effects, @stuff = model.something_returning_false , accidentally halts callback chain. in aj, we're instead going explicit approach requires raise exception, if want stop execution. we'll changing callbacks elsewhere move away "false means halt" in rails 5.0. before_* indeed intended same writing code before execution, in such way can abstracted , mixed in. can write before_* callbacks

Is it possible to find common words in specific Lucene documents? -

for example: doc1 = "i got new apple iphone 8"; doc2 = "have seen new apple iphone 8?"; doc3 = "the apple iphone 8 out"; doc4 = "another doc without common words"; find_commons(["doc1", "doc2", "doc3", "doc4"]); results: {{"doc1", "doc2", "doc3"}, {"apple", "iphone"}} or similar other question: there better library/system achieve using lucene's data? yes, can use termvector retrieve information. first, need make sure termvectors stored in index, e.g.: private static document createdocument(string title, string content) { document doc = new document(); doc.add(new stringfield("title", title, field.store.yes)); fieldtype type = new fieldtype(); type.settokenized(true); type.setstoretermvectors(true); type.setstored(false); type.setindexoptions(indexoptions.docs_and_freqs_and_positions_and_

eclipse neon gcc c++ linker no libraries panel in ubuntu -

i want use eclipse c++ program in opengl, use visual studio in windows, want transfer ubuntu. following tutorial, know need add libraries, cannot find gcc c++ linker libraries panel in eclipse neon, strange, can find in indigo, tutorial used. in neon, cannot find it. pictures follow. eclipse indigo have libraries panel in gcc c++ linker , eclipse neon have no libraries panel . ------ added 2 hours later ----- i found reason... because use fatabulous system theme, hides panel because of high contrast (i guess), , there. after switching default ambiance theme, see panel.

php - Passing phone number to Javascript function -

im attempting pass phone number button on html page, problem each time page loads id of button (may change) cant capture id ( dont think ). the problem lies in seems pass integer, misses off 0 @ start. there anyway pass via string, believe resolve issue. $phone_details[] array of details.. <script> function shownumber(id) { alert(id); } </script> html <input type='button' value='".$phone_details[1]." ".$phone_details[2]."' onclick='shownumber(".$phone_details[0].")'> you loading php, aren't you? missing additional quotes: <input type='button' value='".$phone_details[1]." ".$phone_details[2]."' onclick='shownumber(\"".$phone_details[0]."\")'> see added \", ensure sending "0123" (string) instead of 0123 (number) , therefore keep leading 0. you can test simple alerts. first 1 without quotes, sec

Continue an SSIS task when one of many servers is down -

the purpose of ssis package grab data 1 centralized server , multicast data several servers. i have 1 central server , 5 destinations. i truncate each destination server's tables, send each table destinations using multicast. each data flow object updates 1 table on each server. i need stress there no for-loops. data flow relatively linear. these destination servers have unreliable internet connections, need plan if @ least 1 destination offline. i've tried disable error messages, seen here http://agilebi.com/jwelch/2008/06/29/continuing-a-loop-after-an-error/ i've tried setting max error count high number. however every time try execute, package stops entirely , complains 1 of connections broken (i broke on purpose test). how can force package continue, despite @ least 1 bad connection? thanks put each server in 1 data flow task. when connect 1 data flow other, instead of using success/failure precedence constraint, set completion. word on

QT Creator CMakeLists.txt c++ link errors -

note: have updated original post simplify, clarify, , reflect things have tried, including adopting suggestions comments. i running qt creator 4.2.1 , trying compile c++ project defined cmakelists.txt. program compiles fine command line cmake . && make . work qt creator ide. i have 2 ubuntu machines. 1 process works fine, 1 fails. on machine fails, if open cmakelists.txt project in qt , try compile, fails compile many linker errors. how can fix this? here things have tried uninstall , reinstall qt creator uninstall , reinstall build-essential including various lib paths in may makefile enabling , disabling system environment variables in qt project changing qt kit use clang. works, understand why gcc isn't working. i looking hard environmental differences can't figure out causing problem. main.cpp : #include <iostream> int main(int argc, char *argv[]) { std::cout << "hello, qt!" << std::endl; } cmakelists.txt

php - using a selection list display data submitted to show columns from data -

using php & mysqli: trying use select list , when user hits submit button using php trying display colums data when user selects specific selection: //database set information connect sqli: $servername = "*******"; $username = "********"; $password = "******"; $dbname = "********"; `// create connection` `$conn = new mysqli($servername, $username, $password, $dbname);` `// check connection` `if ($conn->connect_error) {` `die("connection failed: " . $conn->connect_error); }` `//to value of selected option select tag: if(isset($_post['submit'])){ $selected_val = $_post['selection']; // storing selected value in variable echo " have selected :" .$selected_val; // displaying selected value }` `//a string submitted:` `$selection = $_post['selection'];` `$selection = intval($_post['selection']);` `//selecting data database:` `$sql = "select * teams team

sql server - Data Flow SSIS - Common destination table, different structure flat files -

i have multiple flat files(.csv) source in folder.each file has varying number of columns may or may not intersect other files. however, columns in source file present in destination table contains super set of these columns. my requirement loop through each of these files , dynamically map columns available in file destination table(header names of csv file match column names in table). structure of file 1: id, name, age, email structure of file 2: id, name, age, address, country structure of file 3: id, name, age, address structure of destination table: id, name, age, address, country, email i want populate table columns data available , null what's not every record. how can achieve using ssis? you can adding 1 flat file connection manager add 1 column data type dt_wstr , length of 4000 (assuming it's name column0 ) in dataflow task add script component after flat file source in mark column0 input column , add 6 output columns (id, name, age,

swift - Adding a certain amount of values from an Array to a Collection View -

i have array of uiimages add collection view 40 cells. want use integer choose amount of uiimages taken array , add default uiimage remaining cells. (if integer 7 want take 7 uiimages array , use default uiimage @ remaining 33 cells) this how add image image cells. cell.imageview?.image = imagearray[indexpath.row] in cellforitem(at:) : if indexpath.item >= 7 { cell.imageview?.image = defaultimage } else { cell.imageview?.image = imagearray[indexpath.item] } you can replace 7 property of uicollectionview subclass , check that.

function - Counting parameters in Javascript -

what docs @ mozilla says: console.log((function(...args) {}).length); // 0, rest parameter not counted console.log((function(a, b = 1, c) {}).length); // 1, parameters before first 1 // default value counted so how ever able count parameters in such cases ? https://developer.mozilla.org/en-us/docs/web/javascript/reference/global_objects/function/length there 2 separate things going on here parameters defined , arguments passed . for defined function, can access number of parameters defined in definition of function fn.length : function talk(greeting, delay) { // code here } console.log(talk.length); // shows 2 because there 2 defined parameters in // function definition separately, within function, can see how many arguments passed function given invocation of function using arguments.length . suppose had function written accept optional callback last argument: function talk(greeting, delay, callback) {

mysql - order by from 2 column from different tables -

i trying pull items sales on pos system. i have few tables need join , order/group by. hope can explained. table `items`: +---------+--------+ | item_id | name | +---------+--------+ | 33 | thing1 | | 34 | thing2 | | 54 | thing3 | | 67 | thing4 | +---------+--------+ table `kits`: +-------------+------+ | item_kit_id | name | +-------------+------+ | 1 | kit1 | | 2 | kit2 | +-------------+------+ table `sales`: +---------+-------------+---------+ | sale_id | sale_date | total | +---------+-------------+---------+ | 1 | 2016-06-11 | 100.00 | | 2 | 2016-06-12 | 145.00 | +---------+-------------+---------+ table `sale_items`: +-----+---------+----------+---------+ | id | sale_id | line_num | item_id | +-----+---------+----------+---------+ | 1 | 1 | 1 | 33 | | 2 | 1 | 3 | 54 | | 3 | 2 | 1 | 34 | | 4 | 2 | 2 | 67 | +-----+---------+----

C# "var" argument in method without using generics (templates) -

i have set of simple function identical except passed data types. data types basic types. i tried use "var" expected compiler not know how handle functions internal types. do need use generics (templates) here? or there other built in featured c# not aware of? thanks in advance help! sean protected bool checkpropertychanged(ref bool attribute, bool newvalue) { bool propertychanged = false; if (attribute != newvalue) { propertychanged = true; attribute = newvalue; } return propertychanged; } protected bool checkpropertychanged(ref string attribute, string newvalue) { bool propertychanged = false; if (attribute != newvalue) { propertychanged = true; attribute = newvalue; } return propertychanged; } i used solution below found attribute not being modified when using generics, regardless of how called method. reverted original code of having separate methods , revisit... didn't take t

How to increase the speed of transfer of data from android to arduino in bluetooth? -

i'm trying use android app processing of path finding algorithm robot using bluetooth. currently, takes 1 or 2 seconds transfer complete, there output in arduino. there way minimise make transfer-output instant? this kind of delay causing problems such stopping instantly when obstacle detected. there better way of doing this? in advance! you didn't mention device using. assume connected bluetooth chip set uart port(as in arduino uno), in case slowest part in whole communication serial interface between arduino , bluetooth chip set. check baud rate using , can increase further. think default 9600 around 960 bytes per second. set maximum baud rate supported device , bluetooth chip.