Posts

Showing posts from May, 2013

c# - Enums: Retrieve enum value from enumeration name string -

this question has answer here: how should convert string enum in c#? 19 answers the enum: public enum enumname { gary = 1, dave = 2 } the input: string inputvalue = "gary"; what best way retrieve value enum string? i.e. return value 1. you can use enum.parse convert string enum, or enum.tryparse if less sure of input. (enumname)enum.parse(typeof(enumname), inputvalue) you can convert enum underlying type, default int if unspecified, casting. : (int)enum.parse(typeof(enumname), inputvalue)

How to pass a 2 dimensional array as a function argument in Go? -

so want able pass matrix function in argument in golang. different size each time - e.g., 4x4 matrix, 3x2 matrix, etc. if try running test code below against source code error message like: how pass 2 dimensional array function? i'm new go , come dynamic language background (python, ruby). cannot use mat[:][:] (type [][3]int) type [][]int in argument zeroreplacematrix source code func replacematrix(mat [][]int, rows, cols, a, b int) { } test code func testreplacematrix(t *testing.t) { var mat [3][3]int //some code got := replacematrix(mat[:][:], 3, 3, 0, 1) } the easiest way use slices. unlike arrays passed reference,not value. example: package main import "fmt" type matrix [][]float64 func main() { onematrix := matrix{{1, 2}, {2, 3}} twomatrix := matrix{{1, 2,3}, {2, 3,4}, {5, 6,7}} print (onematrix) print (twomatrix) } func print(x matrix) { _, := range x { _, j := range { fmt.printf(&

ruby - Chef, File does not exists after force the creation -

i have following logic in recipe creates file if it's missing , tries insert lines in it. file "/root/myfile" owner 'root' group 'root' mode '400' action :create_if_missing end file = chef::util::fileedit.new('/root/myfile') data_bag('my_databag').each |user| # ... lines using chef resources user, group, etc. if node.chef_environment != "my_env" line = "something write in myfile" chef::log.info("-----> #{line}") file.insert_line_if_no_match(/#{line}/, line) end end file.write_file the recipe fails in case myfile doesn't exist despite i'm forcing creation of file before instruction causes exception. here error: argumenterror ------------- file '/root/.testfile' not exist relevant file content: ---------------------- 18: 19>> file = chef::util::fileedit.new('/root/.testfile') 20: can me understand why doesn't work? on a

java - Using TYPE_SHORT_GRAY for bufferedImage -

i have scenario where, i need process image signed 16-bit, create bufferedimage using type_ushort_gray . as mentioned signed java doesn't support type_short_gray . also when use, databufffer d = bi.getraster().getdatabuffer(); //bi buffered image d instance of databufferushort. but expect instance of databuffershort. how can create bufferedimage of type_short_gray (signed short). am new this. in advance. to create bufferedimage using signed short backing, need create databuffer / raster yourself. there's no type_short_gray constant. try like: int w = 1600; int h = 900; // create signed 16 bit data buffer, , compatible sample model databuffer databuffer = new databuffershort(w * h); samplemodel samplemodel = new componentsamplemodel(databuffer.type_short, w, h, 1, w, new int[] {0}); // create raster sample model , data buffer writableraster raster = raster.createwritableraster(samplemodel, databuffer, null); // create 16 bit signed gray c

c# - Migration failed for upgrading data solution to VS2013 -

when try open datasolution in vs2013, tries migrate because error these projects either not supported or need project behavior imacting modifications open in version of visual studio. i can one-way upgrade unfortunately fails error message the application project type based on not found. visual studio needs make non-functional changes project in order enable project open in visual studio 2013, visual studio 2012, , visual studio 2010 sp1 without impacting project behavior. has encountered error before , knows how fix it?

javascript - Is a function return value possible as an array key? -

i made lazy utility function wanted pass arrays key getting syntax errors, possible pass function inside array it's key? function encloseattrselector(attr, value) { return '[' + attr + '="' + value + '"]'; } .. example (typically more 1 pair): var data = { encloseattrselector('name', 'username'): row.first().text() }; in es6 es2015 (the newest official standard language) yes, in real-life contexts no. can this: var data = {}; data[encloseattrselector('name', 'username')] = row.first().text(); the new es2015 syntax is: var data = { [encloseattrselector('name', 'username')] : row.first().text() }; that is, square brackets around property name in object initializer expression. inside square brackets can expression.

maintainscrollpositionon - Document is scrolling back to the top -

the document contains fixed top navigation bar. when button (provided ajax response) clicked document scrolling top. fixed navigation bar covering upper portion of div equal height of fixed navigation bar can me find out solution? of coding done using native html, css , javascript.

windows - why net use delete command returns question mark -

a filemaker script calls 'net use delete x:' command, return value '?'. knows mean? i suppose, using "send event" run "net use delete". more cmd usage filemaker. command should disconnect shared resource on network. '?' mean error filemaker not recognise. if should, ignore it. if not have check if connected resource , if network resource called correct name when disconnect. check permissions. best way debug make sure can run same commands in cmd.

c# - Error connect to exchange online using of Office365 a/c whencreated property get-mailbox cmdlet -

error : winrm client cannot complete operation within time spe cified. check if machine name valid , reachable on network , firewall exception windows remote management service enabled. error number: -2144108250 ps1 code: param ( [parameter(mandatory=$true)][system.management.automation.pscredential]$credentials ) $session = new-pssession -configurationname microsoft.exchange -connectionuri https://outlook.office365.com/powershell-liveid/ -credential $credentials -authentication basic –allowredirection import pssession $session get-mailbox c# code: pscredential credential; private runspace runspace; private string username = configurationmanager.appsettings["office365username"]; private string password = configurationmanager.appsettings["office365password"]; internal pshelper() { //create object of pscredentials class credential = new pscredential(this.username, createsecurepassword(this.password)); initialsessionstate sessionstate =

What changed in Ruby? -

the following spec passes fine in ruby 2.1.5 fails in 2.2.0 , can't tell that's about: # job.rb class job < activerecord::base validates :link, :url => true end # job_spec.rb require 'rails_helper' describe job describe "#create" ["blah", "http://", " "].each |bad_link| { should_not allow_value(bad_link).for(:link) } end end end fail log looks this: 1) job#create should not allow link set "http://" failure/error: should_not allow_value(bad_link).for(:link) expected errors when link set "http://", got no errors # ./spec/models/job_spec.rb:14:in `block (4 levels) in <top (required)>' i find way spec pass ruby 2.2.0 include validates_url gem in project!! does know about? maybe solution isn't ideal, works. replace validates_url gem validates gem . has urlvalidator (written me), tested. gem 'validates&

c# - How do you write .Net plugins for NSClient++ -

i've been trying find examples or documentation writing .net plugins nsclient++ . can direct me working sample application or documentation? i found source code csharpsampleplugin on github. since don't use cmake, made new vs2013 project , added 3 dll's referenced in cmake setup project ( google.protocolbuffers.dll , nscp.core.dll , , nscp.protobuf.dll ). found dlls in nsclient++ installation dir. however seems code in sampleplugin.cs doesn't work current dlls. error on line: response.addlines(plugin.queryresponsemessage.types.response.types.line.createbuilder().setmessage("hello c#").build()); ... saying: error 2 'plugin.queryresponsemessage.types.response' not contain definition 'types' c:\vs_projects\nsclienthelpers\nsclientplugin\sampleplugin.cs 45 74 nsclientplugin error 1 'plugin.queryresponsemessage.types.response.builder' not contain definition 'addlines' , no extension method 'addlines

javascript - Exporting HTML table with < to Excel using XML -

i using this method export html tables excel. of colums in data have < characters. cause error when try open file in excel. there way ignore these characters or automatically replace them? eg: <tr> <td>assume a>b</td> </tr> ps: have html data < character. pulling new page, has button export excel (using xml format). i not aware of solution problem mentioned you. workaround can write small data sanitation script using perl/sed sanitize data. details of such script might taken here .

asp.net mvc 3 - How to get Max(ID) from Student and Create in MVC -

i using 1 mvc example in id incremental in database. create record like: in case id in student table not incremental, need max(id) student table. [httppost] [validateantiforgerytoken] public actionresult create([bind(include = "id,lastname,firstmidname,enrollmentdate,countryid,account_code")] student student) { if (modelstate.isvalid) { db.students.add(student); db.savechanges(); return redirecttoaction("index"); } return view(student); } i want remove "id" include , want max(id) student table through linq , save table. please me thanks. me please

sql server - SSISDB - Deploy project using T-SQL -

i trying deploy ssis project ssisdb using t-sql. in case of error while deploying, error messaged got logged catalog.operation_messages view. now if execute same deploy statement in explicit sql transaction , if error occurs @ time of deployment not able find error logged catalog.operation_message. ex. begin begin try begin tran tran1 declare @folder_id bigint exec ssisdb.catalog.create_folder @folder_name='test1', @folder_id=@folder_id output select @folder_id exec ssisdb.catalog.set_folder_description @folder_name='test1', @folder_description='test1' --deploy declare @projectbinary varbinary(max) declare @operation_id bigint set @projectbinary = (select * openrowset(bulk 'c:\test\myproject.ispac', single_blob) binarydata) exec ssisdb.catalog.deploy_project @folder_name = 'test1', @project_name = 'abc', @project_stream = @projectbinary, @operation_id = @operation_id out commit tran tran1 end try begin catch select error_m

oauth - How does GetExternalLoginInfoAsync() work? (MVC5) -

i have simple question, time of googling didn't give me answer. i'm using mvc 5 project , using owin oauth features facebook login. i'm using recommended way first creating challange result: return new challengeresult(provider, url.action("externallogincallback", "account", new { returnurl = returnurl })); and in callback function capturing var logininfo = await authenticationmanager.getexternallogininfoasync(); now question is, method (getexternallogininfoasync) works? need access info (logininfo) provided callback later on, should write db, etc or there better way?

Stop NatTable from going into edit mode when an editable cell is left-mouse-clicked -

nattable's default behavior when editable cell left-mouse-clicked launch cell's editor. users left-click toss focus table, , use arrow keys navigate around inside of it. given table's default behavior, first need dismiss edit operation via enter, escape, etc. before can move cell selection. i'd alter behavior left-mouse-click selects cell clicked, not instigate edit. the editing triggers configured in org.eclipse.nebula.widgets.nattable.edit.config.defaulteditbindings class, used org.eclipse.nebula.widgets.nattable.grid.layer.config.defaultgridlayerconfiguration . all have register different grid layer configuration uses different edit bindings. example: gridlayer gridlayer = new gridlayer(bodylayer, columnheaderlayer, rowheaderlayer, cornerlayerstack, false) { @override protected void init(boolean usedefaultconfiguration) { super.init(usedefaultconfiguration); addconfiguration(new defaultgridlayerc

numbers - How can I have all the integers in a string that has a combination of alphanumeric characters using RegEx -

for example have: 1|2|3,4|5|6,7|8|10; how can output this: a: 1 2 3 b: 4 5 6 c: 7 8 10 and how can this: array = {1,2,3} array b = {4,5,6} array c = {7,8,10} var reg = /(\d+)\|(\d+)\|(\d+)[,;]/g; var str = "1|2|3,4|5|6,7|8|10;"; var index = 0; str.replace(reg,function myfun(g,g1,g2,g3){ var ch = string.fromcharcode(65 + (index++)); return ch+": "+g1+" "+g2+" "+g3+"\n"; }); the second case should update myfun return string: "array "+ch+" = {"+g1+","+g2+","+g3+"}\n";

javascript - Methods for most performant dashed rectangle -

i have rectangle, stroke 1px dashed line typical of selection objects see in image editors. i researching methods, , wondering performant? should draw recntangle go through , clear gaps? should use dashedline here draw 4 dashed lines? https://stackoverflow.com/a/4577326/1828637 any other methods? thanks using context.setlinedash(segments); valid method supported major browsers. read more here: https://developer.mozilla.org/en-us/docs/web/api/canvasrenderingcontext2d/setlinedash

javascript - Velocity JS Lag -

i have been using parallax time , have been using css animations , transforms , etc in order results want. after reading stuff velocity , thought giving try. the problem animations having kind of delay. because i'm not applying velocity correctly, have researched , seems i'm doing correct. $ability.velocity({ translatex: '-50px', opacity: '0' }); $(document).on('scroll', function(){ var wscroll = $(this).scrolltop(); if(wscroll > $('.ability-self').offset().top - $(window).height()/1.2){ $ability.velocity({ translatex: "0", opacity: '1' }); } else{ $ability.velocity({ translatex: '-70px', opacity: 0 }); } the problem animation happens 1 or 2 seconds after scroll after element. have checked if css attribute might interfering, didn't find relevant one. is js bad? assuming use of velocity correct, code causing lot of stress browser. should first cache layout values

php - mysql query AND with OR not work -

in query want write logic , operation or . query not work. select * `data` `city`='mycity' , performdate='4' , (curtime() >= `valid_from` or curtime() <= `valid_to`) , perform_type='ptype' i think (curtime() >= `valid_from` or curtime() <= `valid_to`) this logic not work untested --- $time = curtime(); select * data city = 'mycity' , performdate = '4' , perform_type = 'ptype' , ($time >= 'valid_from' or $time <= 'valid to'); source: http://www.techonthenet.com/mysql/and_or.php

c# - Deploy config files along with exes and dlls on windows CE device -

Image
currently deploying windows ce application on windows ce platform vs 2008. running fine. my problem want deploy config files along exes , dlls. when deploy, exes , dlls deployed not config files. properties each config files "content" , "copy always". please how can deploy config files well? in solution explorer, right-click config file want deploy , select properties. in properties window, select ' copy always ' in ' copy output directory ' in deployment project, make sure include folder you've saved config files. this link explains how add items deployment note : if using publish solution explorer, select build action none , copy output directory do not copy

xmpp - Cannot connect to local openfire server from C# -

Image
i've setup openfire server in vm, , accessible internet(i've done port-forwarding point ip of vm). i can chat using spark openfire working perfectly. now trying connect c# app server , getting error. code : private void button1_click(object sender, system.eventargs e) { try { using (var client = new xmppclient("192.168.0.109", "pbc92", "12345")) { try { client.connect(); client.statuschanged += client_statuschanged; } catch (exception ex) { messagebox.show(ex.tostring()); } } } catch (exception ex) { messagebox.show(ex.tostring()); } } private void client_statuschanged(object sender, s22.xmpp.im.statuseventargs e) { messagebox.show(e.jid.tostring()); } the error :

How to play sound in ear speaker in xamarin android? -

i'm doing cross platform app in visual studio, want know how play sound in ear speaker, mobile ringing sound while make call, can 1 me this? update trying sip calling. have used android.net.sip. can able call sip numbers before pick call end user ring sound cant ringing in mobile. its having functions cant able hear ring sound //called when ringing response received invite request sent. public override void onringingback(sipaudiocall call) { base.onringingback(call); } for tried play ring sound using media player, use loud speaker, want play ring sound in ear speaker or can can able play ring sound using above functions. can 1 me this? no need restart phone. close running apps , try audio. it'll normal, through main speaker. i've observed 1 thing. while music coming through ear speaker make call, automatically pauses playing audio, , in call put on loud speaker , go music player (don't disconnect call, let go in speaker mode) , turn on music,

amazon web services - Building zip file with Visual Studio -

i using visual studio 2013 develop website. website on github, , have server continuous integration set teamcity. i trying website automatically deploy aws when change on github. have teamcity hooked up, aws cli having issues, need compile solution in teamcity zip file can deploy aws using workaround. i've tried editing project files msbuild fix...i managed zip file output. however, ran problems general compilation. what wondering is, since can publish website package visual studio, possible compile if publishing using build commands teamcity (or command line) result compiled project , website files needed run site in zip file? you can create zipped artifact in teamcity. build project set artifacts build this: outputfolder\*.dll=>myzipfile.zip outputfolder\*.whatever=>myzipfile.zip etc obviously you'll need change outputfolder files output build , patterns macth files want

How can i store iOS remote notification when app in state background or killed, and without tap the notification? -

i want save notifications server.is way request server messages? you may use silent notification feature lets app simple operations (e.g. purchase sync or file sync) without bothering user or having user open app.

iphone - My iOS images appear opaque when I run the app -

i'm using full screen images in app, , when see them on xcode fine, when run on simulator, ipad mini or iphone 6 opaque. why be? you should check opaque property on uiimageview (assuming that's you're using) additionally, debugging aid, i'd re-export images using standard settings

android - ButtonView with different background -

i have designed rounded corners button. button_selector.xml: <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" > <corners android:radius="10dp"/> </shape> in layout: <button android:background="@drawable/button_selector" .../> on every click color of should button changes : in activity, inside onclicklistener(): btn1.setbackgroundcolor(getanswercolor(choicearray[0])); but if this, not getting rounder corners. how rounder corners? please suggest. btn1.setbackgroundresource(r.drawable.button_selector); gradientdrawable drawablegradient = (gradientdrawable) btn1.getbackground(); drawablegradient .setcolor(color.red);

ios - App crashes with dyld when using private cocoapod -

i'm trying make pod framework similar how google has done using googlemaps there frameworks folder , resource folder, under pods/aboutui framework called aboutui. have managed using podspec file below pod::spec.new |s| s.name = 'aboutui' s.version = '0.1.2' s.summary = 'aboutui customers customize.' s.author = 'bob' s.license = {:file=>'license',:type => 'bsd'} s.source = {:http => 'http://localhost/aboutui_0.1.2.zip'} s.platform = :ios, '8.0' s.homepage = 'https://some.url.com' s.resource = 'aboutui.framework/resources.bundle' s.preserve_paths = 'aboutui.framework' s.vendored_frameworks = 'aboutui.framework' end but error below when trying run app uses aboutui pod... dyld: library not loaded: @rpath/aboutui.framework/aboutui referenced from: /private/var/mobile/containers/bundle/application/e4498bb8-

php - Output escaped data in laravel 5.1 -

i inserting escaped data in database using core php. $collect = $conn->real_escape_string($value); $sql = "insert data (collect) values ('$collect')"; if ($conn->query($sql) === true) { echo ' : new record created '; } else { echo "error: " . $sql . "<br>" . $conn->error; } records created successfully. when output data same database using laravel 5.1, shows weird characters â€Å“ , †instead of "". outputting data in .blade.php file. @foreach ($data $d) {{ $d->collect }}<br /> @endforeach if output data using core php output perfect. in core php outputting data this. $sql = "select collect data"; $result = $conn->query($sql); if ($result->num_rows > 0) { // output data of each row while($row = $result->fetch_assoc()) { echo " collect: ".$row["collect"]."<br>"; } } else { echo "0 results";

java - Observables or ViewTreeObserver -

is there better way of subscribing see if flag has been tripped or layout changed other using code below? layout.getviewtreeobserver().addongloballayoutlistener(new viewtreeobserver.ongloballayoutlistener() { @override public void ongloballayout() { .... } });

Pentaho Kettle Connect to SAP -

can provide step step instructions connect kettle sap (ecc). i need know steps need implement create connection , connect either table using rfc_read_table , connect rfc the wiki of pentaho kettle recommends jco connector: http://wiki.pentaho.com/display/eai/sap+input download connector , read documentation. there many guides available. once have grasp understanding of technology, discuss integration sap team - there many other options more suitable integration rfc_read_table via jco.

mysql - OFFSET...FETCH not working on PATSTAT Online -

i updating queries mysql t-sql patstat online has moved over. the following worked fine in mysql, returning 700,000 rows starting @ row 700,001, ordered appln_id: select * tls201_appln order appln_id limit 700000, 700000 however, equivalent (i thought) in t-sql returns rows: select * tls201_appln order appln_id offset 700000 rows fetch next 700000 rows what missing? any pointers appreciated! your syntax correct. code should retrieve rows 700001 1400000, ordered appln_id. offset-fetch new sql server 2012 , thing can think of code being run on earlier version. in case expect syntax error, not familiar patstat online.

c++ - stopping an io_service object and boost::asio::io_service::work -

boost::asio::io_service m_io_service; boost::asio::io_service::work m_work(m_io_service); m_io_service.run() m_io_service.stop(); m_io_service.reset(); m_io_service.run(); //work object still used here or should recreate m_work object? if stop io_service object, start again, need rebind work object ? the canonical way have optional<asio::io_service::work> m_work(asio::io_service::work(m_io_service)); or shared_ptr<asio::io_service::work> m_work = make_shared<asio::io_service::work>(m_io_service); so can, in both cases, signal "shutdown service using m_work.reset(); and, no don't think need rebind work object. work objects not actual async operations. it's more refcount/lock

css - ASP.net Update Panel is losing all styles and jquery binded plugins -

Image
upon updatepanel refresh of asp.net css styles , jquery plugins such chosen dropdown getting lost. we have used updatepanel in many places. so way of global approach solve if have come across problem note: loading pages in iframe security issues. problem? please find reference images: on first load: on updatepanel refresh:

General python function with many interval cases that returns specific values depending on interval -

i having problems writing function in python based on input x outputs y depending on in interval input x in. of code looks this def getpowerlimit(x): if 0.009 <= x <= 380.2: return -39 elif 380.2 < x <= 389.8: return -94 elif 389.8 < x <= 390.2: return -39 elif 390.2 < x <= 399.8: return -60 elif 399.8 < x <= 410.2: return -39 and needs proceed differing intervals around 12000. each differing return values means have alot of different cases. can not best approach problem wondering if there different , quicker way solve problem. as suggested dlask's comment in question, can make use of bisect library: boundaries = [0.009, 380.2, 389.8, 390.2, 399.8, 410.2] values = [none, -39, -94, -39, -60, -39, none] # need import

c# - Using Ghostscript.Net on an ASP.NET Azure Website -

i using ghostscript.net in order convert pdf page jpg. works fine when run locally, when publish azure website error: " this managed library running under 32-bit process , requires 32-bit ghostscript native library installation on machine! download proper ghostscript native library please visit: http://www.ghostscript.com/download/gsdnld.html " obviously can't install ghostscript on server azure website running on, don't have access that. there way can include ghostscript library in publishing profile, , have ghostscript.net read that? alternatively, there any package allow me convert pdf page jpg thumbnail on asp.net server without using ghostscript @ all? have tried ghostscriptsharp , had no luck either. you try install native ghostscript library local machine , get gsdll32.dll (or gsdll64.dll if running in x64 bit environment) can deploy server along other dlls. take @ example how tell ghostscript.net search native ghostscript library dll

java - Android: getMenuInflater().inflate throws android.widget.ShareActionProvider cannot be cast to android.support.v4.view.ActionProvider -

i'm developing android app , having trouble implementing share button on template "master / detail flow" when create menu on itemdetailactivity extends appcompatactivity (however, i've tried extending actionbaractivity) following error java.lang.classcastexception: android.widget.shareactionprovider cannot cast android.support.v4.view.actionprovider in line: getmenuinflater().inflate(r.menu.menu_ficha, menu); here code: java public class itemdetailactivity extends appcompatactivity { shareactionprovider mshareactionprovider; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_item_detail); // show button in action bar. getsupportactionbar().setdisplayhomeasupenabled(true); if (savedinstancestate == null) { // create detail fragment , add activity // using fragment transaction. bundle arguments = new bundle(); arguments.p

java - HashMap key that is made up of multiple tokens and has non-null value mapping returns null -

i creating currency exchange application csv data , have hit road block. storing main currency exchange rate table in linkedhashmap of following type: linkedhashmap[string,linkedhashmap[string,double]] it store data [country, [year,rate]]. when print console confirm map being populated properly, receive confirmation of full keyset , proper value mappings. additionally, application runs smoothly country names consisting of 1 token. however, countries more 1 token in names return null though map populated key , correct corresponding value. for example, printing getexchangerates() return k-v pairs including following: australia={1960=0.8929, 1961=0.8929, 1962=0.8929, 1963=0.8929, 1964=0.8929, 1965=0.8929...}, czech republic={1990=21.145, 1991=27.92, 1992=28.37, 1993=29.153, 1994=28.785, 1995=26.541...}, new zealand={1960=0.7143, 1961=0.7155, 1962=0.7192, 1963=0.7192, 1964=0.7192, 1965=0.7192...} printing getexchangerates().get("australia") return linkedhashmap

javamail - The message content in a line is becomes 2 lines when reading from InputStream -

i using android javamail. parse inputstream of content myself. use inputstreamreader reader = new inputstreamreader(messages[i].getinputstream()); int value; stringbuilder out = new stringbuilder(); while((value = reader.read()) != -1) { out.append((char) value); } reader.close(); log.i(tag, out.tostring()); the original string content : <body lang=3d"zh-tw" link=3d"#0563c1" vlink=3d"#954f72" style=3d"text-justify-trim:punctuation"> but when in printout result <body lang=3d"zh-tw" link=3d"#0563c1" vlink=3d"#954f72" style=3d"text-justi= fy-trim:punctuation"> there "=" in line , breaks 2 line. "=" seems indicate line not ended yet. how did happen? if line ends =, how can differentiate? bill, can work work around problems broken imap servers according https://tools.ietf.org/html/rfc3501#section-6.4.5 arguments: sequence set me

vi - Vim help tags listing duplicates -

for reason, vim main vim file has duplicate entries of local plugins. brevity, i'll list repeats, , names of files being repeated: gist.vim vundle.txt ultisnips.txt dash.txt nerd_commenter.txt nerd_tree.txt syntastic.txt xml-plugin.txt vim-pandoc vim-pandoc-devel ctrlp.txt vimux.txt fugitive.txt surround.txt quickfixsigns.txt gist.vim cached_file_contents funcref tiny-cmd tlib.txt snipmate.txt easymotion.txt vimwiki.txt supertab.txt minibufexpl.txt command-t.txt gundo.txt pytest.txt makegreen.txt ropevim.txt command-t.txt ctrlp.txt dash.txt gist.vim gundo.txt minibufexpl.txt nerd_commenter.txt nerd_tree.txt pytest.txt quickfixsigns.txt ropevim.txt supertab.txt syntastic.txt tlib.txt ultisnips.txt cached_file_contents funcref tiny-cmd easymotion.txt fugitive.txt makegreen.txt vim-pandoc vim-pandoc-devel snipmate.txt surround.txt vimux.txt vimwiki.txt xml-plugin.txt vundle.txt i'm not sure causes this, welcome.

python - SQLAlchemy .all() only returning first result on multi-join -

howdie do, so i'm joing 5 tables using following query: order = db.session.query(trailer, trip, trippallet, waveorder, package)\ .join(trip, trailer.trailer_id == trip.trailer_id)\ .join(trippallet, trip.trip_id == trippallet.trip_id)\ .join(waveorder, trippallet.pallet_id == waveorder.pallet_id)\ .join(package, waveorder.order_id == package.order_id)\ .filter(trailer.trailer_id == '555555').all() now, 5 tables follows: **trailer table** trailer_id 555555 **trip table** trip_id trailer_id 523462462 555555 **trip pallet table** trip_id pallet_id 523462462 1052 523462462 1054 **wave order table** pallet_id order_id 1052 123456 1052 123457 1054 324567 1054 797453 **package table** order_id tracking 123456 abckdf 123457 dvniuo 324567 dnklin 797453 adfnln so give overview, trailer contains

google play - How to determine which android market was used to download my app -

i plan distribute app not on google play, on several other markets, such opera mobile store, yandex store, amazon app store. "rate" button need link store page. possible find out market used download app? of course can compile invididual apks every market want make 1 universal apk. different iap apis solved openiab library, stuck problem linking market. generally if use advertising distribute app can use tools of google: in short, need insert googgle analitics app (if not use of course), , use tool called: campaign measurement then sign receiver of installment : <receiver android:name=".system.refferreceiver" android:exported="true"> <intent-filter> <action android:name="com.android.vending.install_referrer" /> </intent-filter> </receiver> and handle logic inside receiver: public class refferreceiver extends broadcastreceiver { @override

Activate FileStream on SQL Server 2012 only with code (query) -

i'm desperately trying activate filestream queries. following msdn procedure ok, enable without using sql server configuration manager or sql server management studio. on several website read query enough activate feature (this query done in msdn procedure after configuration in sql server configuration manager ) : exec sp_configure 'filestream_access_level', 2; go reconfigure go the message l option de configuration filestream access level est passée de 2 à 2. pour installer, exécutez l'instruction reconfigure." gave if check service's proprieties filestream steal disabled, if execute reconfigure again. if try open connection base featuring filestream columns message confirming filestream not enabled. i tried query : use master go exec sp_configure 'show advanced options' go exec sp_configure filestream_access_level, 3 go exec sp_filestream_configure @enable_level = 3 , @share_name = n'fs'; go reconfigure override go without

sql server - Msg 195, Level 15, State 10, Line 6 'Datetime' is not a recognized built-in function name -

i getting error while running query declare @currentdate datetime set @currentdate = getdate() select count(id) dbo.tbllstofclientholidays datetime(@currentdate) = convert(varchar(10),getdate(clientholdiday),10) select count(id) dbo.tbllstofclientholidays convert(varchar(10),clientholdiday,10) = convert(varchar(10),@currentdate,10)

Java DocumentBuilder - wrong indentation in XML file -

i try write simple xml file in java using documentbuilder. expected xml file this: <outer> <inner> <element name="web"/> <element name="web"/> <element name="web"/> </inner> </outer> but generates this: <outer> <inner> <element name="web"/> <element name="web"/> <element name="web"/> </inner> </outer> why third element not have same indentation other 2 elements? note: read xml file again simulate method in project, read xml file, add 1 element , save xml file. here code: import org.w3c.dom.document; import org.w3c.dom.element; import org.xml.sax.saxexception; import javax.xml.parsers.documentbuilder; import javax.xml.parsers.documentbuilderfactory; import javax.xml.parsers.parserconfigurationexception; import javax.xml.transform.*; import javax.xml.transf

RMI - remote object , rmiregistry -

is true every remote object must registered in rmiregistry ? can 1 object rmiregistry , call method on , result reference ( not serialized copy ) remote object , isn't registred in rmiregistry ? is true every remote object must registered in rmiregistry? no. can 1 object rmiregistry , call method on , result reference ( not serialized copy ) remote object , isn't registred in rmiregistry ? yes. remote methods can return remote objects. registry bootstrap mechanism started, i.e. provide initial stub. after can like.

apache - Server settings for Ubuntu, ZF2 with AssetManager -

up until have been using zf2 on centos environment cpanel. decided move ubuntu , far has been simple setup server. i having small permission problem struggling resolve. i using assetmanage needs able write images , files public folder. unfortunately, cant seem correct permissions work. i have gone far setting 777 permissions public folder makes no difference. i have changed owner of public to: www-data user apache using, , not either. what problem user/group using load files server conflicting www-data user needing perform various tasks on server. is there standard setup should looking @ in terms of this? setup: ubuntu: 14.4 zf2 i have found great tutorials setup ubuntu environment. here are: basic installation enhanced installation lamp stack all working now!

java - Why an object is removed after using removeAll method -

i have executed program. after removing object list reflects list. public class testing { public static void main(string args[]) { arraylist a1 = new arraylist<>(); a1.add("a"); a1.add("e"); a1.add("f"); arraylist a2 = new arraylist<>(); a2.add("a"); a2.add("x"); a2.add("y"); a1.removeall(a2); iterator<string> = a1.iterator(); while (it.hasnext()) { system.out.println(it.next()); } } and output i'm getting is: e,f why 'a' removed ? because called a1.removeall(a2) perhaps? http://docs.oracle.com/javase/7/docs/api/java/util/list.html#removeall%28java.util.collection%29 removes list of elements contained in specified collection (optional operation). so, in other words, every element that's in a2 , in a1 removed a1 .

algorithm - How to calculate smallest multiple formed only of the digit 1? -

i given number k in range 1 10000. problem find smallest multiple can written digit 1 (known repunit ). k=3 solution 111 because 3 divides 111, 3 not divide 1 or 11. k=7, solution 111111 (six ones). how calculate solution k? i understand need use remainders since solution can big (or suppose use biginteger class) if you're guaranteed solution (at least n , multiples of 5 , there no solution. haven't given thought others, think rest should have solution): (a + b) % c = ((a % c) + (b % c)) % c (a * b) % c = ((a % c) * (b % c)) % c where % modulo operator: a % b = remainder of division of b . means can take modulos between additions , multiplications, solve problem. using this, can use following algorithm, linear in number of digits of result , uses o(1) memory: number_of_ones = 1 remainder = 1 % n while remainder != 0: ++number_of_ones # here add 1 result, # store result's value mod n. # when 0, our solution. remainder = (remainder * 10

Javascript typedarrays sizing recomendations -

i'm using float32arrays store data. imagine a,b numbers , imagine millions of points. i'm going have buffer collection , question is, more buffers lower bytes-size or less buffers greater bytes-size? best ? 1mb, 4kb, 1kb? some ideas file operations ? same ajax operations ? what best size thinking in memory management done web browsers? there standard blocks ? thanks , excuse me if i'm asking begginer questions...

javascript - Why Worker is not defined in js -

i wrote 3 files test webworker, webworker.html <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>document</title> </head> <body> <table id="table"></table> <script> // var worker = new worker('webworker3.1.js'); var worker = new worker('webworker3.1.js'); worker.postmessage(''); worker.onmessage = function(event){ console.log(event.data); if(event.data != ''){ var j, k, tr, td, intarray = event.data.split(';'), table = document.getelementbyid('table'); for(var = 0; < intarray.length; i++){ j = parseint(i / 10, 0); k = % 10; if(k == 0){ tr = document.createelement('tr');

Why RDDs is not listed in the spark UI/storage page -

i newbie spark. i installed spark 1.3.1 on mac, , played using spark-shell, here did: scala> val lfile = sc.textfile("/users/jackzhang/downloads/prodpart.txt"); scala> val count = lfile.filter(line => line.contains("xyz_cow")) scala> count.count output res27: long = 1 i tried run scala> count.cache it did not work either. my understanding should count rdd materialized in memory (or disk), because run count.count , , count action per spark documentation , , should able see http://localhost:4040/storage , wrong? as makoton mentioned, https://forums.databricks.com/questions/117/why-is-my-rdd-not-showing-up-in-the-storage-tab-of.html answered question. to see rdd in "storage" tab, here did after reading post: scala> val cachecount = count.cache scala> cachecount.collect after that, can see rdd in tab, however, tried update rdd name, running: scala> cachecount.setname("test") scala> c

c - Core dumped when a function pointer is assigned with a funtion that has the same name in another file -

i abstract problem following scenario: 3 files:a.h,a.c,b.c,and code below: a.c #include "a.h" #include <stdio.h> int (*call2)(); int call1(int (*cb)()){ call2=cb; printf("success!"); return 1; } a.h int call1(); b.c #include <stdio.h> #include "a.h" int call2(){return 0;}; int main(){ call1(call2); } then compiling these files gcc a.c b.c -o b warings: /usr/bin/ld: warning: alignment 1 of symbol `call2' in /tmp/cc0wbcyh.o smaller 8 in /tmp/ccudjees.o /usr/bin/ld: warning: size of symbol `call2' changed 8 in /tmp/ccudjees.o 11 in /tmp/cc0wbcyh.o /usr/bin/ld: warning: type of symbol `call2' changed 1 2 in /tmp/cc0wbcyh.o then run './b' segmentation fault (core dumped) my ideas: apparently, line call2=cb; has caused corrupt.that means,assigning function function pointer has same name wrong operation.i think reason relates how gcc compiler store function pointer , function.but not

python - Reading text file for specfic keyword included inside brackets '{' -

i read text file below. has geometry names --> " hvac,outlet,inlet,lamelle,duct , wall" in case 6, may vary depending on different simulation of cfd process. i extract geometry names , corresponding 'type'. in case geometry , types " hvac,outlet,inlet,lamelle,duct , wall" , "wall , patch" respectively. should use parse using xml or search string after '{\n' , '}\n' keyword . geometry { hvac { type wall; ingroups 1(wall); nfaces 904403; startface 38432281; } outlet { type patch; nfaces 8228; startface 39336684; } inlet { type patch; nfaces 347; startface 39344912; } lamelle { type wall; ingroups 1(wall); nfaces 204538; startface 39345259; }

javascript - Preselected option by ng-init doesn't work in ngOptions | AngularJS -

i have object product = {id: "759", name: "somename", category_id: "139", cartridge_type: 2 ...} in angular controller. why preselected option in ngoptions doesn't work? select renders empty option if product.cartridge_type null . html <select class="form-control" id="cartridge_type" name="cartridge_type" ng-init="product.cartridge_type=product.cartridge_type||cartridgetypescope[0]" ng-model="product.cartridge_type" ng-options="cartridge_type.id cartridge_type.name cartridge_type in cartridgetypescope"> <option value="">select type</option> </select> js $http.get('someapipath').success(function(data) { $scope.product = data[0]; console.log( $scope.product ); }); $scope.cartridgetypescope = [ { id: 0, name : '-' }, { id: 1, name

javascript - Closure Compiler: Avoid "missing return statement" warning when a return is guaranteed -

this function return "foobar" : /** * @return {string} */ function foobar() { var x = true; if (x) { return 'foobar'; } } when compiled command: java -jar compiler-20150609.jar --js test.js --warning_level verbose this warning raised: test.js:4: warning - missing return statement. function expected return string. function foobar() { ^ similarly, function return string: /** * @param {boolean} bool * @return {string} */ function convertbooltostring(bool) { var boolstring = bool ? 'true' : 'false'; switch (boolstring) { case 'true': return 'yes'; case 'false': return 'no'; } } again, compiler raises warning "missing return statement. function expected return string." i know warnings can suppressed adding @suppress {missingreturn} , i'd know if there's better solution. there "hint" can provide