text:
Q: Lazy rendering print pages on iOS I need to print custom UI in a cross-platform application. On Windows, the work flow is like:

*

*Choose what to print

*Open the Windows Print dialog/print preview. This only queries for print pages as they are needed.

*Begin printing and report progress as each page prints.

I am trying to replicate this workflow on iOS, but it seems that all the print pages need to be print-ready before opening the iOS print dialog (UIPrintInteractionController). This is a big problem because the user may be printing a lot of pages, and each page can take awhile to prepare for printing. Therefore it takes too long to prepare and open the UIPrintInteractionController.
Is there any way on iOS to have it lazily query for the print pages one (or even a few) at a time as they are being previewed or printed? Or do they all have to be prepared ahead of presenting the UIPrintInteractionController?
EDIT: It's a major problem when printing many pages because it can easily run out of memory holding that many UIImages in memory at the same time.
I tried using the PrintItems property with UIImages, as well as a UIPrintPageRenderer. I am using Xamarin.iOS so pardon the C# syntax, but you get the idea. An answer in Swift or Objective C would be fine. Here is my sample pseudo-code:
//Version 1

public void ShowPrintUI_UsingPrintingItems()
{
    UIPrintInfo printOptions = UIPrintInfo.PrintInfo;
    InitializePrintOptions(printOptions);
    _printer.PrintInfo = printOptions;

    var printRect = new CGRect(new CGPoint(), _printer.PrintPaper.PaperSize);

    //Each of these is horribly slow.
    //Can I have it render only when the page is actually needed (being previewed or printed) ?
    for (uint i = 0; i < numPrintPages; i++)
    {
        _printPages[i] = RenderPrintPage(i, printRect);
    }

    _printer.PrintingItems = _printPages;

    _printer.Present(true, (handler, completed, error) =>
    {
        //Clean up, etc.
    });
}

//Version 2
public void ShowPrintUI_UsingPageRenderer()
{

    UIPrintInfo printOptions = UIPrintInfo.PrintInfo;
    InitializePrintOptions(printOptions);
    _printer.PrintInfo = printOptions;

    //This still draws every page in the range and is just as slow
    _printer.PrintPageRenderer = new MyRenderer();

    _printer.Present(true, (handler, completed, error) =>
    {
        //Clean up, etc.
    });
}

private class MyRenderer : UIPrintPageRenderer
{
    public MyRenderer(IIosPrintCallback callback)
    {
        _callback = callback;
    }

    public override void DrawPage(nint index, CGRect pageRect)
    {
        DrawPrintPage(i, printRect);
    }

    public override nint NumberOfPages => _numPrintPages;
}


text:
Q: Hibernate collection fetching optimally I have the following structure
Store
    Rebate
        RebateMetadata
        RebateCommission
So, the relation is like this -
Store -> Rebate is a one to many relation
Rebate -> RebateMetadata   is a one-to-one mapping
Rebate -> RebateCommission is a one-to-one mapping
My Query is to load all stores. And with it, load all Rebates and metadatas and commissions.
The HQL I am using is:
Select store from Store as store;
I am expecting the whole graph to be loaded in as less SQLs as possible. To prevent the n+1 selects issue, I use subselect fetching between Store->Rebate.
However, to fetch RebateMetadata and RebateCommission, I see multiple individual selects(with joins) being fired. What should I do to minimize this?
Moreover, I have the 2nd level cache turned ON, but QueryCache turned OFF.

A: You could try a fetch join. It usually takes me a while to get it right, try something like:
select store from Store as store
 left join fetch store.rebate rebate
 inner join fetch rebate.metadata
 inner join fetch rebate.commission

edit: updated in accordance with the second to last example I linked in the hibernate docs. This has more of a chance of being correct.
That probably won't work but it's the general idea. Alternatively you could try using batch-size (annotation @BatchSize) on the property to make sure that properties like this are loaded, say, 50 items at a time (using a SELECT...IN query).

redpajama_set_name: RedPajamaStackExchange


text:
Q: SQL Function Constraint for Denormalized Data How do I create a function constraint for denormalized data?
-- graduation_class table
graduation_class_id | graduation_year_id
123                         1
456                         2

-- user table
user_id |   graduation_class_id |   graduation_year_id
555             123                     1
556             123                     3  <--- bad data
557             456                     2

A graduation class can only be assigned to a sign graduation year.  The combination of the two is unique in the graduation_class table.
I want to create a function constraint on the graduation_year_id column on the user table to make sure the graduation_year_id is in sync with the proper id from the graduation_class table so that the record 556 in the user table will never happen.
** Please assume normalization is NOT a solution to this, or I wouldn't be asking this question! :) **

A: Instead of function create a composite primary key and a foreign key to fix your problem
Make the graduation_class_id ,graduation_year_id in graduation_class as composite primary key
ALTER TABLE graduation_class
ADD PRIMARY KEY (graduation_class_id ,graduation_year_id)

Now add foreign key in the user table
ALTER TABLE user
ADD FOREIGN KEY (graduation_class_id ,graduation_year_id)
REFERENCES graduation_class(graduation_class_id ,graduation_year_id)

This will ensure you to add only the row added to user table is already present in graduation_class table

A: As mentioned by other answers, this schema is not ideal, but if you need to maintain data integrity in this schema before having the opportunity to clean things up, a function constraint will do this for you. First, we will create a function that takes in the graduation_class_id and graduation_year_id as parameters, and returns a bit value:
create function dbo.fn_check_graduation_year_id
    (
    @graduation_class_id int,
    @graduation_year_id int
    )
    returns bit
as
    begin
        declare @return bit = 1
        if @graduation_year_id != (select top 1 graduation_year_id
                                   from graduation_class
                                   where graduation_class_id = @graduation_class_id)
            set @return = 0
        return @return
    end

This function will return true if the graduation_year_id matches the value on the graduation_class table given the graduation_class_id value. Next, we will add the constraint to your user table, making sure the result of the check function returns true:
alter table [user] with nocheck add constraint ck_graduation_year_id
    check (dbo.fn_check_graduation_year_id(graduation_class_id,graduation_year_id) = 1)

A: Like this:
alter table user
drop column graduation_year_id

If you need it, select it by joining to the graduation_year table


text:
Q: flutter app crash when there is low or no network connection I have this IconButton which when I press it updates a field on my cloud Firestore DB.I do not get any problem if there is a healthy internet connection, how ever is there is no network or low signal I get a timed out error and this causes the app to crash. I have have wraped the function in a try{} catch{} block but still that doesn't help.
 onPressed: (){
                 try{
                  Firestore.instance.runTransaction((Transaction thistransaction)async{
                  DocumentSnapshot docSnapshot = await thistransaction
                  .get(snapshotDocuments[index].reference);
                  await thistransaction.update(docSnapshot.reference,
                   {'voteUpBool':!docSnapshot['voteUpBool']});

                  });
                }
                 catch(err){
                    print(err.toString());
                  }
                 },

A: you have to check internet or wifi available or not for that just add connectivity: ^0.3.1 dependency with latest version and follow the below code.
import 'dart:io';
...
try {
   final result = await InternetAddress.lookup('google.com');
   if (result.isNotEmpty && result[0].rawAddress.isNotEmpty) {
       print('connected');
   }
 } on SocketException catch (_) {
    print('not connected');
 }


text:
Q: Vue-bootstrap nested checkboxes I want to have sidebar that would represent filter and in there I would have checkboxes that would represent what should be shown to user. I found this: https://bootstrap-vue.js.org/docs/components/form-checkbox/#indeterminate-tri-state-support
But this only goes one level deep and I would need to go two levels. An example of what I am trying to achieve:
Select All
    -Breakfest
        -Eggs
        -Bacon
        -Sandwich
    -Lunch
        -Salad
        -Chicken
        -Fish
    -Dinner
        -Pancakes
        -Tacos
        -Beef

Now I want something like example in documentation from link but that goes one level deeper.

A: It should be simple to adopt this to Bootstrap Vue since Bootstrap Vue only abstracts HTML. I just added the first filter, you should get the idea.
HTML

  <input type="checkbox" v-model="all">Select all

  <input type="checkbox" v-model="filters.breakfast.breakfast" class="indent">Breakfast

  <input type="checkbox" v-model="filters.breakfast.eggs" class="double-indent">Eggs

  All: {{ all }}

  Breakfast: {{ filters.breakfast.breakfast }}

  Eggs: {{ filters.breakfast.eggs }}

JavaScript
You may use a loop at 'filters.breakfast.breakfast' (). I'd use Lodash for this because the properties mustn't be known.
new Vue({
  el: '#app',
  data: () =>  ({
    all: false,
    filters: {
        breakfast: {
          breakfast: false,
          eggs: false
      }
    }
  }),

  watch: {
    all () {
      this.filters.breakfast.breakfast = !this.filters.breakfast.breakfast
    },

    'filters.breakfast.breakfast' () {
        this.filters.breakfast.eggs = !this.filters.breakfast.eggs
    }
  }
})

CSS
.indent {
  margin-left: 1em;
}

.double-indent {
  margin-left: 2em;
}

Preview: http://jsfiddle.net/xv3y04j2/

A: Basically, I created three batches of tri-state groupings (tri-state +3 choices each), and then created another tri-state checkbox at the top that changes it's state based on the number of choices selected in each of the three groupings.


text:
Q: NullPointerException when creating an SSL-Socket In my app I'm communicating with an webservice over SSL. Because I use a multipart entity which is not supported by android by default I included the following libraries:

*

*httpclient-4.1.1.jar

*httpcore-4.1.jar

*httpmime-4.1.1.jar

The server uses a certificate signed by an authority supported by android. This works on most devices though. Today one of my users (Android 2.2 Motorola Defy) sent me a log which contains the following:
W/System.err( 2328): Caused by: java.lang.NullPointerException
W/System.err( 2328): at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketFactoryImpl.createSocket(OpenSSLSocketFactoryImpl.java:83)
W/System.err( 2328): at org.apache.http.conn.ssl.SSLSocketFactory.createSocket(SSLSocketFactory.java:375)
W/System.err( 2328): at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:168)
W/System.err( 2328): at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:164)
W/System.err( 2328): at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:119)
W/System.err( 2328): at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:352)
W/System.err( 2328): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:555)
W/System.err( 2328): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:487)
W/System.err( 2328): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:465)
W/System.err( 2328): at my.api.Client.sendRequest(Client.java)
...

I can't reproduce this on my devices and I have no clue why this happens. I looked into the source code of OpenSSLSocketFactoryImpl and the only point where the NullPointerException can come from is because sslParameters is null. Do you have any idea what I can do in my code to work around this exception?
If you don't know how to solve the problem but have an idea what to ask the user who sent the log to me, please also place an answer.
I already asked him whether his browser shows error messages when he tries to access a website over https. I will append the reply here as soon as I received it.

A: The traceback isn't an exact match but if your user is using a proxy server you might want to see if your version of HttpClient has the fix for this bug: http://code.google.com/p/android/issues/detail?id=5255


text:
Q: Allowing multiple columns to be viewed at same time with VBA I am working on a spreadsheet for my company that allows loan officers to view information for each investor we work with.
I am currently using this code -
  Private Sub CheckBox4_Click()
    [j:j].EntireColumn.Hidden = CheckBox4
    [k:m].EntireColumn.Hidden = False
    [n:bc].EntireColumn.Hidden = CheckBox4

The above code represents one investor we work with. It closes the column(s) before, and the column(s) after and allows the column to be looked at to stay visible.
What I am after is how do I allow for multiple columns to be viewed at the same time using the code above.
Any help would be appreciated.
Thank you.
Dave


text:
Q: Starting multiple gui (WinForms) threads so they can work separetly from one main gui in C#? I've one MainForm window and from that user can press 3 buttons. Each of the button starts new Form in which user can do anything he likes (like time consuming database calls etc). So i decided to put each of the forms in it's own threads:
   private Thread subThreadForRaportyKlienta;
   private Thread subThreadForGeneratorPrzelewow;
   private Thread subThreadForRaporty;
   private void pokazOplatyGlobalne() {
           ZarzadzajOplatamiGlobalneDzp varGui = new ZarzadzajOplatamiGlobalneDzp();
           varGui.ShowDialog();
    }
    private void pokazRaportyKlienta() {
          RaportyDzpKlient varGui = new RaportyDzpKlient();
           varGui.ShowDialog();
    }
    private void pokazRaportyWewnetrzne() {
       RaportyDzp varGui = new RaportyDzp();
        varGui.ShowDialog();
    }
    private void pokazGeneratorPrzelewow() {
        ZarzadzajPrzelewamiDzp varGui = new ZarzadzajPrzelewamiDzp();
        varGui.ShowDialog();
    }
    private void toolStripMenuGeneratorPrzelewow_Click(object sender, EventArgs e) {
        if (subThreadForGeneratorPrzelewow == null || subThreadForGeneratorPrzelewow.IsAlive == false) {
            subThreadForGeneratorPrzelewow = new Thread(pokazGeneratorPrzelewow);
            subThreadForGeneratorPrzelewow.Start();
        } else {

        }

    }
    private void toolStripMenuGeneratorRaportow_Click(object sender, EventArgs e) {
        if (subThreadForRaporty == null || subThreadForRaporty.IsAlive == false) {
            subThreadForRaporty = new Thread(pokazRaportyWewnetrzne);
            subThreadForRaporty.Start();
        } else {

        }
    }
    private void toolStripMenuGeneratorRaportowDlaKlienta_Click(object sender, EventArgs e)
    {
        if (subThreadForRaportyKlienta == null || subThreadForRaportyKlienta.IsAlive == false) {
            subThreadForRaportyKlienta = new Thread(pokazRaportyKlienta);
            subThreadForRaportyKlienta.Start();
        } else {

        }
    }

I've got couple of questions and i hope someone could explain them:

*

*When i use Show() instead of ShowDialog() the windows just blink for a second and never shows. What's the actual difference between those two and why it happens?

*When i use ShowDialog everything seems normal but i noticed not everything gets filled properly in one of the gui's (one listView stays blank even thou there are 3 simple add items in Form_Load(). I noticed this only in one GUI even thou on first sight everything works fine in two other gui's and i can execute multiple tasks inside those Forms updating those forms in background too (from inside the forms methods). Why would this one be diffrent?

*What would be proper way of doing this? Tasks performed in each of those Forms can be time consuming and i would like to give user possibility to jump between those 4 windows without problem so he can execute what he likes.

A: The difference is with Modal and Modeless Windows Forms.

Modeless forms let you shift the
  focus between the form and another
  form without having to close the
  initial form

Show() method is used for this purpose

A: Show() shows the new form, then returns.  If this is all the thread is doing than the thread will exit, and that will destroy the form.
ShowDialog() shows the form, and then begins running a message pump, until the form is hidden or destroyed, ShowDialog() doesn't return, so your thread keeps running.
If You mean for these forms to each behave like a separate application window. then you could  also use Application.Run() after form.Show() to run a message pump for the form on that thread.  The drawback to doing it this way, is that when any one of your forms is closed, it might end up taking down the whole process because of the way WM_QUIT is handled.
But other than the way you would deal with closing down your application, Form.ShowDialog() is very much like Form.Show() followed by Application.Run().  The conditions that cause the message pump to exit are a bit different between these to, so you would choose one or the other mostly based on how you want to your application to handle closing one of your forms.

A: You should put the time-consuming tasks in their own BackgroundWorker threads. Keep all of the forms in the main thread.
http://msdn.microsoft.com/en-us/library/system.componentmodel.backgroundworker.aspx

A: 1: Show() is not blocking, that is it shows the window and then returns. Afterwards, the varGui variable goes out of scope and is finalized by the garbage collector => disappears.
2: You'd need to show the updating code to get a definite answer, but as you can only update the contents of a form when running in the thread that created the form. Doing it otherwise is unreliable, so is the usual culprit when form updates don't work. In a method of a form class, call:
if (InvokeRequired) {
   .Invoke(..); // call back this same method on the right thread
} else {
 // dowork
}

to manage the UI.
3: The proper way is what Jake wrote: use one thread for all GUI stuff and BackgroundWorker threads for, well, background work.


text:
Q: How to convert row data into column? My query is
select distinct b.Emp_Name,a.emp_id,a.date,a.status,b.Emp_F_H,b.Emp_Gender,b.Emp_DOJ,c.Dept_Disc
from dbo.Attendance_Details a
inner join dbo.Employee_Master b on a.emp_id=b.emp_id
inner join dbo.Department_Details c
  on b.Dept_Id=c.dept_id
    and a.Fromdate='2011-09-01 00:00:00.000'
    and a.todate='2011-09-30 00:00:00.000'
order by b.emp_name

I want Output like
emp_name emp_id  emp_f_h doj      emp_gender  dept 1 2 3 4 5..upto 31 column for status
kamal    emp_1  b.singh  1/1/2011  male      hr   p A P P P...upto 31
ramesh emp_2  singh  1/1/2011  male          Fc   p A P P P...upto 31....

so how i dynamicaly generate 31 colum For single emp id to status column plz help me

A: Try this article
Crosstab Pivot-table Workbench
http://www.simple-talk.com/sql/t-sql-programming/crosstab-pivot-table-workbench/


text:
Q: Upgrade PC to Use as CentOS Server? Currently I have Some Sites and One Mobile App
Hosted in Godaddy.com Shared Business Hosting Established Plan:
4 Virtually Allocated CPU Core
16GB RAM
240GB Storage
Everything works fine but i want to turn my own PC into CentOS Server taking advantage of My Fiber Optic High Speed Internet Connection which currenlty have so i need to upgrade my PC to match the Basic Specifications base on current Hosting Specifications Also make a count that i need USE 20TB HDD include One Samsung 970 PRO SSD 1TB - M.2 NVMe So i need a Recommendation to Upgrade the PC Base on those Specifications ( Preferable that this Specifications can be used as NAS System too ).
My Current Computer Specifications:
ASUS Maximus VIII Hero (Intel Z170)Intel® Core™ i7-6700K Processor (8M Cache, up to 4.20 GHz)Memory X 4:* Kingston HyperX Predator 32GB Kit 3000MHz DDR4 (2 x 16GB)

*

*G-Skill Ripjaws V F4-3200C16D-16GVRB DDR4 (2 x 8GB)
NVIDIA Quadro P2000 5GB GDDR5Hard Disk X 5:* Samsung SSD 840 EVO 1TB

*Seagate ST3000DM001-1CH166 3TB

*Seagate ST2000DM001-1CH164 2TB

*Western Digital Black WD3003FZEX-00Z4Sa0 3TB

*Western Digital Red 8TB NAS Hard Disk Drive WD80EFZX
Corsair AX760 ATXObsidian Series™ 650D Mid-Tower Case


text:
Q: Looping through a table rows with comparisons using VUgen I have a table I need to compare each of the values within to an existing parameter.
I have this Xpath here: //*[@id="maincontent"]/messages/div/div[1]/div[1]/table/tbody/tr[1]/td[4]/div/span
and would like to insert an increment variable from the loop to go through the /tr/ in the table only.
Here is what i have so far:
var i;
var max = 10;

var xpathleft = `*[@id="maincontent"]/messages/div/div[1]/div[1]/table/tbody/tr[`;
var xpathright = `]/td[4]/div/span`;

for (i = 1; i < max, i++)
    {
    var currentXpath = string.concat(xpathleft, i, xpathright);
}

if (currentXpath.innerHTML == PartnerIDs)
    {
    lr_log_message("Match Found!");
}

This is currently sitting in an Evaluate Javascript step in TruClient/VUgen and is giving me Syntax Error: Unexpected Token )
The element here doesn't have any ID I can reference and looks like this: Partner ID
and has been difficult to pull the needed Partner ID text within code.

A: Some of your JavaScript syntax is incorrect.
Try this:
var i;
var max = 10;

var xpathleft = `*[@id="maincontent"]/messages/div/div[1]/div[1]/table/tbody/tr[`;
var xpathright = `]/td[4]/div/span`;

for (i = 1; i < max; i++){
    var currentXpath = `${xpathleft}${i}${xpathright}`;

   if (currentXpath.innerHTML == PartnerIDs) {
       lr_log_message("Match Found!");
   }
}


text:
Q: Bluetooth adapter not found HP 250 g2 Ubuntu 14.04 lts On boot there are two messages -
Bluetooth: error in firmware loading err = -110, len = 440, size = 4076

and
Bluetooth : Loading patch file failed

and in the bluetooth settings it says "no bluetooth adapters found"
I tried this from other's posts
sudo lshw -class network
  *-network
       description: Ethernet interface
       product: RTL8101E/RTL8102E PCI Express Fast Ethernet controller
       vendor: Realtek Semiconductor Co., Ltd.
       physical id: 0
       bus info: pci@0000:01:00.0
       logical name: eth0
       version: 07
       serial: fc:15:b4:04:50:d8
       size: 10Mbit/s
       capacity: 100Mbit/s
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress msix vpd bus_master cap_list ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=r8169 driverversion=2.3LK-NAPI duplex=half firmware=rtl8106e-1_0.0.1 06/29/12 latency=0 link=no multicast=yes port=MII speed=10Mbit/s
       resources: irq:43 ioport:3000(size=256) memory:c2600000-c2600fff memory:c2400000-c2403fff
  *-network
       description: Wireless interface
       product: QCA9565 / AR9565 Wireless Network Adapter
       vendor: Qualcomm Atheros
       physical id: 0
       bus info: pci@0000:02:00.0
       logical name: wlan0
       version: 01
       serial: 28:e3:47:0c:03:8c
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress bus_master cap_list rom ethernet physical wireless
       configuration: broadcast=yes driver=ath9k driverversion=3.13.0-24-generic firmware=N/A ip=192.168.0.5 latency=0 link=yes multicast=yes wireless=IEEE 802.11bgn
       resources: irq:18 memory:c2500000-c257ffff memory:afb00000-afb0ffff

lspci
00:00.0 Host bridge: Intel Corporation 3rd Gen Core processor DRAM Controller (rev 09)
00:02.0 VGA compatible controller: Intel Corporation 3rd Gen Core processor Graphics Controller (rev 09)
00:14.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB xHCI Host Controller (rev 04)
00:16.0 Communication controller: Intel Corporation 7 Series/C210 Series Chipset Family MEI Controller #1 (rev 04)
00:1a.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #2 (rev 04)
00:1b.0 Audio device: Intel Corporation 7 Series/C210 Series Chipset Family High Definition Audio Controller (rev 04)
00:1c.0 PCI bridge: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 1 (rev c4)
00:1c.2 PCI bridge: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 3 (rev c4)
00:1c.3 PCI bridge: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 4 (rev c4)
00:1d.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #1 (rev 04)
00:1f.0 ISA bridge: Intel Corporation HM76 Express Chipset LPC Controller (rev 04)
00:1f.2 SATA controller: Intel Corporation 7 Series Chipset Family 6-port SATA Controller [AHCI mode] (rev 04)
00:1f.3 SMBus: Intel Corporation 7 Series/C210 Series Chipset Family SMBus Controller (rev 04)
01:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8101E/RTL8102E PCI Express Fast Ethernet controller (rev 07)
02:00.0 Network controller: Qualcomm Atheros QCA9565 / AR9565 Wireless Network Adapter (rev 01)
03:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. RTS5229 PCI Express Card Reader (rev 01)

rfkill list
0: phy0: Wireless LAN

    Soft blocked: no
    Hard blocked: no

Here are results from lspci etc when bluetooth worked again recently after a reinstall... again not working now.
dee@Ted:~$ sudo lshw -class network
[sudo] password for dee:
  *-network
       description: Ethernet interface
       product: RTL8101E/RTL8102E PCI Express Fast Ethernet controller
       vendor: Realtek Semiconductor Co., Ltd.
       physical id: 0
       bus info: pci@0000:01:00.0
       logical name: eth0
       version: 07
       serial: fc:15:b4:04:50:d8
       size: 10Mbit/s
       capacity: 100Mbit/s
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress msix vpd bus_master cap_list ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=r8169 driverversion=2.3LK-NAPI duplex=half firmware=rtl8106e-1_0.0.1 06/29/12 latency=0 link=no multicast=yes port=MII speed=10Mbit/s
       resources: irq:42 ioport:3000(size=256) memory:c2600000-c2600fff memory:c2400000-c2403fff
  *-network
       description: Wireless interface
       product: QCA9565 / AR9565 Wireless Network Adapter
       vendor: Qualcomm Atheros
       physical id: 0
       bus info: pci@0000:02:00.0
       logical name: wlan0
       version: 01
       serial: 28:e3:47:0c:03:8c
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress bus_master cap_list rom ethernet physical wireless
       configuration: broadcast=yes driver=ath9k driverversion=3.13.0-24-generic firmware=N/A ip=192.168.0.5 latency=0 link=yes multicast=yes wireless=IEEE 802.11bgn
       resources: irq:18 memory:c2500000-c257ffff memory:afb00000-afb0ffff

dmesg
[    1.340354] scsi0 : ahci
[    1.340434] scsi1 : ahci
[    1.340499] scsi2 : ahci
[    1.340558] scsi3 : ahci
[    1.340615] scsi4 : ahci
[    1.340669] scsi5 : ahci
[    1.340703] ata1: SATA max UDMA/133 abar m2048@0xc2717000 port 0xc2717100 irq 43
[    1.340705] ata2: DUMMY
[    1.340708] ata3: SATA max UDMA/133 abar m2048@0xc2717000 port 0xc2717200 irq 43
[    1.340709] ata4: DUMMY
[    1.340710] ata5: DUMMY
[    1.340711] ata6: DUMMY
[    1.496003] usb 1-1: new high-speed USB device number 2 using ehci-pci
[    1.628521] usb 1-1: New USB device found, idVendor=8087, idProduct=0024
[    1.628524] usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[    1.628748] hub 1-1:1.0: USB hub found
[    1.628828] hub 1-1:1.0: 6 ports detected
[    1.660105] ata1: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
[    1.663546] ata1.00: ATA-8: TOSHIBA MQ01ABF050, AM002C, max UDMA/100
[    1.663552] ata1.00: 976773168 sectors, multi 16: LBA48 NCQ (depth 31/32), AA
[    1.668556] ata1.00: configured for UDMA/100
[    1.668775] scsi 0:0:0:0: Direct-Access     ATA      TOSHIBA MQ01ABF0 AM00 PQ: 0 ANSI: 5
[    1.668918] sd 0:0:0:0: Attached scsi generic sg0 type 0
[    1.668925] sd 0:0:0:0: [sda] 976773168 512-byte logical blocks: (500 GB/465 GiB)
[    1.668929] sd 0:0:0:0: [sda] 4096-byte physical blocks
[    1.669027] sd 0:0:0:0: [sda] Write Protect is off
[    1.669031] sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00
[    1.669111] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[    1.740199] usb 2-1: new high-speed USB device number 2 using ehci-pci
[    1.802611]  sda: sda1 sda2 sda3
[    1.803233] sd 0:0:0:0: [sda] Attached SCSI disk
[    1.872677] usb 2-1: New USB device found, idVendor=8087, idProduct=0024
[    1.872694] usb 2-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[    1.872926] hub 2-1:1.0: USB hub found
[    1.873051] hub 2-1:1.0: 6 ports detected
[    1.988384] ata3: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
[    1.990373] ata3.00: ATAPI: hp       DVDRAM GU90N, U900, max UDMA/100
[    1.992501] ata3.00: configured for UDMA/100
[    1.996466] scsi 2:0:0:0: CD-ROM            hp       DVDRAM GU90N     U900 PQ: 0 ANSI: 5
[    1.999677] sr0: scsi3-mmc drive: 24x/24x writer dvd-ram cd/rw xa/form2 cdda tray
[    1.999680] cdrom: Uniform CD-ROM driver Revision: 3.20
[    1.999831] sr 2:0:0:0: Attached scsi CD-ROM sr0
[    1.999989] sr 2:0:0:0: Attached scsi generic sg1 type 5
[    2.040463] usb 3-3: new high-speed USB device number 2 using xhci_hcd
[    2.113889] usb 3-3: New USB device found, idVendor=0bda, idProduct=5776
[    2.113893] usb 3-3: New USB device strings: Mfr=3, Product=1, SerialNumber=2
[    2.113895] usb 3-3: Product: HP Truevision HD
[    2.113898] usb 3-3: Manufacturer: DDTPN019I5XGZ0
[    2.113899] usb 3-3: SerialNumber: 200901010001
[    2.124496] tsc: Refined TSC clocksource calibration: 2394.560 MHz
[    2.212507] psmouse serio1: synaptics: Touchpad model: 1, fw: 7.5, id: 0x1c0b1, caps: 0xf00133/0x240000/0xa2400, board id: 2665, fw id: 1458825
[    2.248856] input: SynPS/2 Synaptics TouchPad as /devices/platform/i8042/serio1/input/input5
[    2.284669] usb 3-4: new full-speed USB device number 3 using xhci_hcd
[    2.301993] usb 3-4: New USB device found, idVendor=0cf3, idProduct=3121
[    2.301996] usb 3-4: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[    2.826375] EXT4-fs (sda2): INFO: recovery required on readonly filesystem
[    2.826378] EXT4-fs (sda2): write access will be enabled during recovery
[    3.125430] Switched to clocksource tsc
[    3.159141] EXT4-fs (sda2): orphan cleanup on readonly fs
[    3.159285] EXT4-fs (sda2): 5 orphan inodes deleted
[    3.159287] EXT4-fs (sda2): recovery complete
[    3.339753] EXT4-fs (sda2): mounted filesystem with ordered data mode. Opts: (null)
[    3.782520] random: nonblocking pool is initialized
[   12.226764] Adding 4083708k swap on /dev/sda3.  Priority:-1 extents:1 across:4083708k FS
[   12.353946] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[   12.391756] systemd-udevd[307]: starting version 204
[   12.535266] lp: driver loaded but no devices found
[   12.550689] ppdev: user-space parallel port driver
[   12.560025] wmi: Mapper loaded
[   12.571573] [drm] Initialized drm 1.1.0 20060810
[   12.573796] mei_me 0000:00:16.0: irq 44 for MSI/MSI-X
[   12.589978] [drm] Memory usable by graphics device = 2048M
[   12.589983] checking generic (b0000000 408000) vs hw (b0000000 10000000)
[   12.589985] fb: conflicting fb hw usage inteldrmfb vs EFI VGA - removing generic driver
[   12.590010] Console: switching to colour dummy device 80x25
[   12.595850] Bluetooth: Core ver 2.17
[   12.595872] NET: Registered protocol family 31
[   12.595874] Bluetooth: HCI device and connection manager initialized
[   12.595882] Bluetooth: HCI socket layer initialized
[   12.595885] Bluetooth: L2CAP socket layer initialized
[   12.595889] Bluetooth: SCO socket layer initialized
[   12.597851] usbcore: registered new interface driver btusb
[   12.608654] cfg80211: Calling CRDA to update world regulatory domain
[   12.648717] ath: phy0: WB335 1-ANT card detected
[   12.648722] ath: phy0: Set BT/WLAN RX diversity capability
[   12.657771] ath: phy0: Enable LNA combining
[   12.657860] i915 0000:00:02.0: irq 45 for MSI/MSI-X
[   12.657876] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[   12.657878] [drm] Driver supports precise vblank timestamp query.
[   12.658016] vgaarb: device changed decodes: PCI:0000:00:02.0,olddecodes=io+mem,decodes=io+mem:owns=io+mem
[   12.659582] ath: phy0: ASPM enabled: 0x43
[   12.659586] ath: EEPROM regdomain: 0x6a
[   12.659587] ath: EEPROM indicates we should expect a direct regpair map
[   12.659590] ath: Country alpha2 being used: 00
[   12.659591] ath: Regpair used: 0x6a
[   12.669305] ieee80211 phy0: Selected rate control algorithm 'minstrel_ht'
[   12.670529] ieee80211 phy0: Atheros AR9565 Rev:1 mem=0xffffc90010800000, irq=18
[   12.705099] kvm: disabled by bios
[   12.708927] fbcon: inteldrmfb (fb0) is primary device
[   12.863649] intel_rapl: domain uncore energy ctr 231228:231228 not working, skip
[   12.879766] usbcore: registered new interface driver ath3k
[   12.879795] usb 3-4: USB disconnect, device number 3
[   12.884698] input: HP WMI hotkeys as /devices/virtual/input/input6
[   12.935958] type=1400 audit(1401132430.151:2): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/sbin/dhclient" pid=389 comm="apparmor_parser"
[   12.935962] type=1400 audit(1401132430.151:3): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/NetworkManager/nm-dhcp-client.action" pid=389 comm="apparmor_parser"
[   12.935965] type=1400 audit(1401132430.151:4): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/connman/scripts/dhclient-script" pid=389 comm="apparmor_parser"
[   12.936370] type=1400 audit(1401132430.151:5): apparmor="STATUS" operation="profile_replace" profile="unconfined" name="/sbin/dhclient" pid=366 comm="apparmor_parser"
[   12.936377] type=1400 audit(1401132430.151:6): apparmor="STATUS" operation="profile_replace" profile="unconfined" name="/usr/lib/NetworkManager/nm-dhcp-client.action" pid=366 comm="apparmor_parser"
[   12.936381] type=1400 audit(1401132430.151:7): apparmor="STATUS" operation="profile_replace" profile="unconfined" name="/usr/lib/connman/scripts/dhclient-script" pid=366 comm="apparmor_parser"
[   12.936388] type=1400 audit(1401132430.151:8): apparmor="STATUS" operation="profile_replace" profile="unconfined" name="/usr/lib/NetworkManager/nm-dhcp-client.action" pid=389 comm="apparmor_parser"
[   12.936391] type=1400 audit(1401132430.151:9): apparmor="STATUS" operation="profile_replace" profile="unconfined" name="/usr/lib/connman/scripts/dhclient-script" pid=389 comm="apparmor_parser"
[   12.936603] type=1400 audit(1401132430.151:10): apparmor="STATUS" operation="profile_replace" profile="unconfined" name="/usr/lib/connman/scripts/dhclient-script" pid=389 comm="apparmor_parser"
[   12.936901] type=1400 audit(1401132430.151:11): apparmor="STATUS" operation="profile_replace" profile="unconfined" name="/usr/lib/NetworkManager/nm-dhcp-client.action" pid=366 comm="apparmor_parser"
[   13.003378] Linux video capture interface: v2.00
[   13.011016] uvcvideo: Found UVC 1.00 device HP Truevision HD (0bda:5776)
[   13.016106] input: HP Truevision HD as /devices/pci0000:00/0000:00:14.0/usb3/3-3/3-3:1.0/input/input7
[   13.016243] usbcore: registered new interface driver uvcvideo
[   13.016244] USB Video Class driver (1.1.1)
[   13.082190] cfg80211: World regulatory domain updated:
[   13.082191] cfg80211:   (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
[   13.082193] cfg80211:   (2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[   13.082194] cfg80211:   (2457000 KHz - 2482000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[   13.082195] cfg80211:   (2474000 KHz - 2494000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)
[   13.082196] cfg80211:   (5170000 KHz - 5250000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[   13.082198] cfg80211:   (5735000 KHz - 5835000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[   13.149846] usb 3-4: new full-speed USB device number 4 using xhci_hcd
[   13.498188] Console: switching to colour frame buffer device 170x48
[   13.500727] i915 0000:00:02.0: fb0: inteldrmfb frame buffer device
[   13.500728] i915 0000:00:02.0: registered panic notifier
[   13.515337] ACPI: Video Device [GFX0] (multi-head: yes  rom: no  post: no)
[   13.516546] acpi device:40: registered as cooling_device5
[   13.517720] input: Video Bus as /devices/LNXSYSTM:00/device:00/PNP0A08:00/LNXVIDEO:00/input/input8
[   13.518867] [drm] Initialized i915 1.6.0 20080730 for 0000:00:02.0 on minor 0
[   13.519112] ACPI Warning: 0x0000000000000428-0x000000000000042f SystemIO conflicts with Region \PMIO 1 (20131115/utaddress-251)
[   13.519119] ACPI: If an ACPI driver is available for this device, you should use it instead of the native driver
[   13.519124] ACPI Warning: 0x0000000000000530-0x000000000000053f SystemIO conflicts with Region \GPIO 1 (20131115/utaddress-251)
[   13.519128] ACPI: If an ACPI driver is available for this device, you should use it instead of the native driver
[   13.519130] ACPI Warning: 0x0000000000000500-0x000000000000052f SystemIO conflicts with Region \GPIO 1 (20131115/utaddress-251)
[   13.519134] ACPI: If an ACPI driver is available for this device, you should use it instead of the native driver
[   13.519136] lpc_ich: Resource conflict(s) found affecting gpio_ich
[   13.519343] snd_hda_intel 0000:00:1b.0: irq 46 for MSI/MSI-X
[   13.538216] SKU: Nid=0x1d sku_cfg=0x40f41905
[   13.538220] SKU: port_connectivity=0x1
[   13.538221] SKU: enable_pcbeep=0x1
[   13.538223] SKU: check_sum=0x00000004
[   13.538224] SKU: customization=0x00000019
[   13.538225] SKU: external_amp=0x0
[   13.538226] SKU: platform_type=0x1
[   13.538227] SKU: swap=0x0
[   13.538229] SKU: override=0x1
[   13.538442] autoconfig: line_outs=1 (0x14/0x0/0x0/0x0/0x0) type:speaker
[   13.538445]    speaker_outs=0 (0x0/0x0/0x0/0x0/0x0)
[   13.538447]    hp_outs=1 (0x21/0x0/0x0/0x0/0x0)
[   13.538449]    mono: mono_out=0x0
[   13.538450]    inputs:
[   13.538452]      Mic=0x19
[   13.538454]      Internal Mic=0x12
[   13.538456] realtek: No valid SSID, checking pincfg 0x40f41905 for NID 0x1d
[   13.538458] realtek: Enabling init ASM_ID=0x1905 CODEC_ID=10ec0282
[   13.551178] input: HDA Intel PCH HDMI/DP,pcm=3 as /devices/pci0000:00/0000:00:1b.0/sound/card0/input11
[   13.551285] input: HDA Intel PCH Headphone as /devices/pci0000:00/0000:00:1b.0/sound/card0/input10
[   13.551376] input: HDA Intel PCH Mic as /devices/pci0000:00/0000:00:1b.0/sound/card0/input9
[   13.838794] [drm] Enabling RC6 states: RC6 on, RC6p on, RC6pp off
[   13.953842] EXT4-fs (sda2): re-mounted. Opts: errors=remount-ro
[   14.520813] init: failsafe main process (637) killed by TERM signal
[   14.945214] Bluetooth: RFCOMM TTY layer initialized
[   14.945227] Bluetooth: RFCOMM socket layer initialized
[   14.945232] Bluetooth: RFCOMM ver 1.11
[   14.947897] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[   14.947900] Bluetooth: BNEP filters: protocol multicast
[   14.947910] Bluetooth: BNEP socket layer initialized
[   15.551606] init: avahi-cups-reload main process (776) terminated with status 1
[   16.738088] r8169 0000:01:00.0 eth0: link down
[   16.738138] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[   16.738449] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[   16.752740] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[   16.759687] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[   18.154149] xhci_hcd 0000:00:14.0: Timeout while waiting for address device command
[   18.154180] ------------[ cut here ]------------
[   18.154189] WARNING: CPU: 3 PID: 0 at /build/buildd/linux-3.13.0/drivers/usb/host/xhci-ring.c:1572 handle_cmd_completion+0xe2a/0xe40()
[   18.154190] Modules linked in: bnep rfcomm nls_iso8859_1 snd_hda_codec_hdmi snd_hda_codec_realtek uvcvideo videobuf2_vmalloc videobuf2_memops videobuf2_core videodev hp_wmi sparse_keymap snd_hda_intel snd_hda_codec snd_hwdep snd_pcm intel_rapl x86_pkg_temp_thermal intel_powerclamp coretemp kvm snd_page_alloc crct10dif_pclmul snd_seq_midi snd_seq_midi_event crc32_pclmul snd_rawmidi ghash_clmulni_intel cryptd snd_seq arc4 joydev serio_raw ath9k ath9k_common ath9k_hw ath snd_seq_device snd_timer rtsx_pci_ms mac80211 lpc_ich snd memstick cfg80211 ath3k btusb bluetooth soundcore i915 drm_kms_helper mei_me mei drm i2c_algo_bit wmi parport_pc ppdev video lp parport mac_hid rtsx_pci_sdmmc psmouse ahci r8169 libahci rtsx_pci mii
[   18.154235] CPU: 3 PID: 0 Comm: swapper/3 Not tainted 3.13.0-24-generic #47-Ubuntu
[   18.154237] Hardware name: Hewlett-Packard HP 250 G2 Notebook PC/218F, BIOS F.0C 01/08/2013
[   18.154239]  0000000000000009 ffff88014f2c3da8 ffffffff81715ac4 0000000000000000
[   18.154242]  ffff88014f2c3de0 ffffffff810676bd ffff880145297430 0000000000000003
[   18.154244]  ffff8801452970e0 00000001452970e0 ffff880145188000 ffff88014f2c3df0
[   18.154247] Call Trace: 0
[   18.154280]  [<ffffffff810bf87d>] handle_irq_event+0x3d/0x60
[   18.154283]  [<ffffffff810c2257>] handle_edge_irq+0x77/0x130
[   18.154286]  [<ffffffff81015cde>] handle_irq+0x1e/0x30
[   18.154290]  [<ffffffff817287cd>] do_IRQ+0x4d/0xc0
[   18.154293]  [<ffffffff8171df6d>] common_interrupt+0x6d/0x6d
[   18.154294]  <EOI>  [<ffffffff815c95e2>] ? cpuidle_enter_state+0x52/0xc0
[   18.154300]  [<ffffffff815c9709>] cpuidle_idle_call+0xb9/0x1f0
[   18.154303]  [<ffffffff8101ceae>] arch_cpu_idle+0xe/0x30
[   18.154306]  [<ffffffff810beb85>] cpu_startup_entry+0xc5/0x290
[   18.154309]  [<ffffffff81040fc8>] start_secondary+0x218/0x2c0
[   18.154311] ---[ end trace a7a9af493000c6d0 ]---
[   18.235052] init: plymouth-upstart-bridge main process ended, respawning
[   18.244533] init: plymouth-upstart-bridge main process ended, respawning
[   18.358357] usb 3-4: Device not responding to set address.
[   18.559641] wlan0: authenticate with 20:0c:c8:8b:26:10
[   18.562445] usb 3-4: device not accepting address 4, error -71
[   18.580402] wlan0: send auth to 20:0c:c8:8b:26:10 (try 1/3)
[   18.582645] wlan0: authenticated
[   18.586524] wlan0: associate with 20:0c:c8:8b:26:10 (try 1/3)
[   18.591115] wlan0: RX AssocResp from 20:0c:c8:8b:26:10 (capab=0x411 status=0 aid=2)
[   18.591180] wlan0: associated
[   18.591194] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
[   18.591452] cfg80211: Calling CRDA for country: GB
[   18.594156] ath: EEPROM regdomain: 0x833a
[   18.594160] ath: EEPROM indicates we should expect a country code
[   18.594161] ath: doing EEPROM country->regdmn map search
[   18.594163] ath: country maps to regdmn code: 0x37
[   18.594164] ath: Country alpha2 being used: GB
[   18.594165] ath: Regpair used: 0x37
[   18.594166] ath: regdomain 0x833a dynamically updated by country IE
[   18.594187] cfg80211: Regulatory domain changed to country: GB
[   18.594188] cfg80211:   (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
[   18.594190] cfg80211:   (2402000 KHz - 2482000 KHz @ 40000 KHz), (N/A, 2000 mBm)
[   18.594191] cfg80211:   (5170000 KHz - 5250000 KHz @ 40000 KHz), (N/A, 2000 mBm)
[   18.594192] cfg80211:   (5250000 KHz - 5330000 KHz @ 40000 KHz), (N/A, 2000 mBm)
[   18.594194] cfg80211:   (5490000 KHz - 5710000 KHz @ 40000 KHz), (N/A, 2700 mBm)
[   18.594195] cfg80211:   (57240000 KHz - 65880000 KHz @ 2160000 KHz), (N/A, 4000 mBm)
[   18.629528] wlan0: deauthenticating from 20:0c:c8:8b:26:10 by local choice (reason=2)
[   18.638171] cfg80211: Calling CRDA to update world regulatory domain
[   18.638222] wlan0: authenticate with 20:0c:c8:8b:26:10
[   18.653708] wlan0: send auth to 20:0c:c8:8b:26:10 (try 1/3)
[   18.653873] cfg80211: World regulatory domain updated:
[   18.653877] cfg80211:   (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
[   18.653880] cfg80211:   (2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[   18.653883] cfg80211:   (2457000 KHz - 2482000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[   18.653885] cfg80211:   (2474000 KHz - 2494000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)
[   18.653886] cfg80211:   (5170000 KHz - 5250000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[   18.653888] cfg80211:   (5735000 KHz - 5835000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[   18.655987] wlan0: authenticated
[   18.658557] wlan0: associate with 20:0c:c8:8b:26:10 (try 1/3)
[   18.667784] wlan0: RX AssocResp from 20:0c:c8:8b:26:10 (capab=0x411 status=0 aid=2)
[   18.667834] wlan0: associated
[   18.667887] cfg80211: Calling CRDA for country: GB
[   18.670393] ath: EEPROM regdomain: 0x833a
[   18.670396] ath: EEPROM indicates we should expect a country code
[   18.670398] ath: doing EEPROM country->regdmn map search
[   18.670399] ath: country maps to regdmn code: 0x37
[   18.670400] ath: Country alpha2 being used: GB
[   18.670401] ath: Regpair used: 0x37
[   18.670403] ath: regdomain 0x833a dynamically updated by country IE
[   18.670424] cfg80211: Regulatory domain changed to country: GB
[   18.670425] cfg80211:   (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
[   18.670426] cfg80211:   (2402000 KHz - 2482000 KHz @ 40000 KHz), (N/A, 2000 mBm)
[   18.670427] cfg80211:   (5170000 KHz - 5250000 KHz @ 40000 KHz), (N/A, 2000 mBm)
[   18.670429] cfg80211:   (5250000 KHz - 5330000 KHz @ 40000 KHz), (N/A, 2000 mBm)
[   18.670430] cfg80211:   (5490000 KHz - 5710000 KHz @ 40000 KHz), (N/A, 2700 mBm)
[   18.670431] cfg80211:   (57240000 KHz - 65880000 KHz @ 2160000 KHz), (N/A, 4000 mBm)
[   18.674582] usb 3-4: new full-speed USB device number 5 using xhci_hcd
[   18.692000] usb 3-4: New USB device found, idVendor=0cf3, idProduct=3121
[   18.692005] usb 3-4: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[   95.322810] cfg80211: Calling CRDA to update world regulatory domain
[   95.331089] cfg80211: World regulatory domain updated:
[   95.331096] cfg80211:   (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
[   95.331100] cfg80211:   (2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[   95.331103] cfg80211:   (2457000 KHz - 2482000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[   95.331106] cfg80211:   (2474000 KHz - 2494000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)
[   95.331108] cfg80211:   (5170000 KHz - 5250000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[   95.331111] cfg80211:   (5735000 KHz - 5835000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)

[  112.130948] wlan0: authenticate with 20:0c:c8:8b:26:10
[  112.155159] wlan0: send auth to 20:0c:c8:8b:26:10 (try 1/3)
[  112.747968] wlan0: authenticated
[  112.750559] wlan0: associate with 20:0c:c8:8b:26:10 (try 1/3)
[  113.161405] wlan0: associate with 20:0c:c8:8b:26:10 (try 2/3)
[  113.923564] wlan0: associate with 20:0c:c8:8b:26:10 (try 3/3)
[  114.166216] wlan0: association with 20:0c:c8:8b:26:10 timed out
[  115.522610] wlan0: authenticate with 20:0c:c8:8b:26:10
[  115.543234] wlan0: send auth to 20:0c:c8:8b:26:10 (try 1/3)
[  131.424574] cfg80211:   (2402000 KHz - 2482000 KHz @ 40000 KHz), (N/A, 2000 mBm)
[  131.424578] cfg80211:   (5170000 KHz - 5250000 KHz @ 40000 KHz), (N/A, 2000 mBm)
[  131.424581] cfg80211:   (5250000 KHz - 5330000 KHz @ 40000 KHz), (N/A, 2000 mBm)
[  131.424585] cfg80211:   (5490000 KHz - 5710000 KHz @ 40000 KHz), (N/A, 2700 mBm)
[  131.424589] cfg80211:   (57240000 KHz - 65880000 KHz @ 2160000 KHz), (N/A, 4000 mBm)

A: A possible solution to this issue is that you may have bluetooth disabled in the BIOS, or EFI. If that is not the issue; what you should do is determine if this is a hardware failure by booting up another distribution or operating system in which you can test whether Bluetooth works in that instance. If it happens that this is not a hardware failure, then you should report a bug in Launchpad
https://help.ubuntu.com/community/ReportingBugs
Which is a great help to the open source community.

A: I have similar Bluetooth hardware.  A Lenovo G50-70 with an Atheros Bluetooth card in it, running Kubuntu 14.04. From lsusb:
Bus 002 Device 007: ID 0cf3:3004 Atheros Communications, Inc.

I was also getting the failure to load error=-110 as well.
What I have found is the /lib/firmware/ath3k-1.fw shipped with kubuntu is not working.  The file shipped has a MD5 sum of 1211fa34c09e10ba48381586b7c3883d  ath3k-1.fw.
The file you need has the MD5 sum 24cfee59a24f336dfae838a0de6445a0  ath3k-1.fw
and can be extracted from linux-firmware_1.79_all.deb.
That solved my problem four or five months ago.  Wanting to use Bluetooth again today and its both broken and these steps don't fix it anymore.  I think its a new kernel since I fixed it the first time, I am now on:
3.13.0-43-generic #72-Ubuntu SMP Mon Dec 8 19:35:06 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

I know its a new kernel from when I fixed it, but what I mean is I think that change is what killed Bluetooth again.
So, after two days of hair pulling, going over my steps again and again, I installed a BIOS update, original was from Dec 2013, new one is from Aug 2014 (I think, its either the 11th of Aug, or the 8th of Nov... your choice!)  I logged in ready to resume the battle, and lo and behold, the funky B logo is in my program bar, and clicking on it brings up a list of BT devices in my area!  Turns out it also kills my WiFi connection though, which did not happen last time I fixed things!


text:
Q: Removing GOF in texreg with fixest library's feols regression object in R I am using feols from the fixest library in R and then texreg / htmlreg to create tables. I would like to exclude several Goodness of Fit measures from my table (AIC, BIC, loglikelihood, etc), but texreg interprets my regression as an object form the broom package:
1: In doTryCatch(return(expr), name, parentenv, handler) :
  texreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: within.r.squaredtexreg used the broom package to extract the following GOF measures, but could not cast them to numeric type: pseudo.r.squared

According to the documentation, "extract.broom" unfortunately does not have any arguments with which I can exclude GOF's. Any idea how I could proceed?

A: fixest and feols should be supported natively by texreg. If they aren't, it would be helpful to provide a minimal self-contained example to reproduce the problem.

A: According to the source code, there must be missing outputs in the model statistics, which in your case are within.r.squared and pseudo.r.squared. I would check the model outputs from feols before using texreg and see if any of them are missing.


text:
Q: Using a variable sized range of data in mmult excel I have been trying to re-use a formula I have working with a table with a standard data range. The range in question is auto-populated so it can't be turned in to a table.
The formula I have looks like this -
=LET(
staff, $Y$3:$AB$999,
employee, $Y$3:$Y$999,
role, $Z$3:$Z$999,
discipline, $AA$3:$AA$999,
endDate, $AB$3:$AB$999,
rowCt, MIN(IF(Y3:Y1000="",ROW(Y3:Y1000)-ROW(Y3)+1))-1,
roleSelection, $I$11,
employeeSelection, $I$8,
disciplineSelection, $I$14,
mmult_1, MMULT(SEQUENCE(1,rowCt,1,0),TRANSPOSE(endDate>TRANSPOSE(endDate))*(employee=TRANSPOSE(employee))*(1)),
mmult_2, MMULT((TRANSPOSE(employee)= employee)+0,SEQUENCE(rowCt,1,1,0)),
roleCondition, IF(ISBLANK(roleSelection),1,(role=roleSelection)),
employeeCondition, IF(ISBLANK(employeeSelection),1,( employee=employeeSelection)),
disciplineCondition, IF(ISBLANK(disciplineSelection),1,(discipline=disciplineSelection)),

AvailabilityCalc,FILTER(staff,roleCondition*employeeCondition*disciplineCondition*(TRANSPOSE(mmult_1)-mmult_2+1=0)),

IFERROR(SORT(INDEX(AvailabilityCalc,SEQUENCE(ROWS(AvailabilityCalc)),{1,2,3,4}),1),"")
)

The data currently lives in Y3:AB14 and if I switch this in to the above:
staff, $Y$3:$AB$14,
employee, $Y$3:$Y$14,
role, $Z$3:$Z$14,
discipline, $AA$3:$AA$14,
endDate, $AB$3:$AB$14,

for the various LET definitions it works fine. However, switching the 14 to 999 as above, no data is returned. Does anyone know what I'd need to change for this to work?
I also tried constructing the ranges based on the row amount defined by rowCt, to do this I shifted the rowCt to the first LET entry and switched in the following:
rowCt, MIN(IF(Y3:Y1000="",ROW(Y3:Y1000)-ROW(Y3)+1))-1,
staff, OFFSET($Y$3,0,0,28,rowCt),
employee, OFFSET($Y$3,0,0,25,rowCt),
role, OFFSET($Z$3,0,0,26,rowCt),
discipline, OFFSET($AA$3,0,0,27,rowCt),
endDate, OFFSET($AB$3,0,0,28,rowCt),

Unfortunately this gave me a circular ref.
Edit 1 :
Messed up my offsets, fixed with the following -
staff, OFFSET($Y$3,0,0,rowCt,4),
employee, OFFSET($Y$3,0,0,rowCt),
role, OFFSET($Z$3,0,0,rowCt),
discipline, OFFSET($AA$3,0,0,rowCt),
endDate, OFFSET($AB$3,0,0,rowCt),


text:
Q: iOS prevents video recording in the event of low battery My video recording app encounters a problem in the even of low battery on my device. It works perfectly until the battery level drops down to 20% or below. Is there any way to avoid this, and continue the video recording process?

A: Apple doesn't allow you to disable the "Low Battery" alert.  Make a suggestion to Apple and if they get enough feedback about this, they will think about adding an API.


text:
Q: Magnific Popup - lightbox issue, plus mfp-hide seems to do nothing This is my first time using stackoverflow so please be patient with me, heh.
I'm a relative newbie when it comes to HTML, CSS and JS, but I gotta use them for work every now and then. Today I've applied Magnific Popup to a site I'm working on. I'm specifically trying to use the "Open with fade-zoom animation" example, and modify it to fit my needs of course. The popup is working, indeed, but the div for the popup box itself isn't hiding, despite having mfp-hide as its class. It's weird because the Dreamweaver preview does hide it, but Chrome does not (I'm on latest version of Chrome for Windows, if it helps.) Also, the lightbox that the Magnific Popup site displays behind every popup is nowhere to be seen.
Here's a jsfiddle with my code. The posting interface says I need to post my code here so here it goes:
Here's my HTML:

        CLICK HERE TO DISPLAY DIALOG

DIALOG TITLE

Dialog text

My JS (located inside a script block right before my  tag)
$(document).ready(function() {
    $('.popup-with-zoom-anim').magnificPopup({
        type: 'inline',
        fixedContentPos: false,
        fixedBgPos: true,
        overflowY: 'auto',
        closeBtnInside: true,
        preloader: false,
        midClick: true,
        removalDelay: 300,
        mainClass: 'my-mfp-zoom-in'
    });
});

And just in case, my CSS (located inside a style block right over the script block with the JS)
/* Styles for dialog window */
#dialog {
background: white;
padding: 20px 30px;
text-align: left;
max-width: 700px;
position: relative;
box-shadow: 1px 1px 10px 5px rgba(0,0,0,0.25);
left: 50%;
right: 50%;
z-index: 999;
top: 100px
}

/**
* Fade-zoom animation
*/

/* start state */
.my-mfp-zoom-in .zoom-anim-dialog {
display:block;
opacity: 0;

-webkit-transition: all 0.2s ease-in-out;
-moz-transition: all 0.2s ease-in-out;
-o-transition: all 0.2s ease-in-out;
transition: all 0.2s ease-in-out;

-webkit-transform: scale(0.8);
-moz-transform: scale(0.8);
-ms-transform: scale(0.8);
-o-transform: scale(0.8);
transform: scale(0.8);
}

/* animate in */
.my-mfp-zoom-in.mfp-ready .zoom-anim-dialog {
opacity: 1;

-webkit-transform: scale(1);
-moz-transform: scale(1);
-ms-transform: scale(1);
-o-transform: scale(1);
transform: scale(1);
}

/* animate out */
.my-mfp-zoom-in.mfp-removing .zoom-anim-dialog {
-webkit-transform: scale(0.8);
-moz-transform: scale(0.8);
-ms-transform: scale(0.8);
-o-transform: scale(0.8);
transform: scale(0.8);

opacity: 0;
}

/* Dark overlay, start state */
.my-mfp-zoom-in.mfp-bg {
opacity: 0;
-webkit-transition: opacity 0.3s ease-out;
-moz-transition: opacity 0.3s ease-out;
-o-transition: opacity 0.3s ease-out;
transition: opacity 0.3s ease-out;
}
/* animate in */
.my-mfp-zoom-in.mfp-ready.mfp-bg {
opacity: 0.8;
}
/* animate out */
.my-mfp-zoom-in.mfp-removing.mfp-bg {
opacity: 0;
}

That's all I've got. I'm sorry if this question's been answered already, I have not been able to find it. Let me know if there's anything else I can provide to help solve the problem. And thanks in advance for reading. Cheers.

A: I had a similar issue where the mfp-hide class did nothing. It was caused by not properly including Magnific Popup's css. Check to see if this is your root cause too. You can include the following:
<link href="https://cdnjs.cloudflare.com/ajax/libs/magnific-popup.js/1.0.1/magnific-popup.min.css" rel="stylesheet">


text:
Q: Cauchy in $(\mathbb{R},d) \implies$ Cauchy in $(\mathbb{R},|\cdot|)$ Consider $\mathbb{R}$ with the metric $d$ such that $d(x,y) = \min\{1,|x − y|\}$ for all $x,y \in \mathbb{R}$.
Prove that if $(x_n)_{n=1}^{\infty}$ is a Cauchy sequence in $(\mathbb{R},d)$, then $(x_n)_{n=1}^{\infty}$ is a Cauchy sequence in $\mathbb{R}$ with the standard metric.

My thoughts:
Since $(x_n)_{n=1}^{\infty}$ is a Cauchy sequence in $(\mathbb{R},d)$ then given any $\epsilon>0$, there exists $N\in\mathbb{N}$ such that for all $n,m>N$ we have $d(x_n,x_m)=\min\{1,|x_n-x_m|\}=|x_n-x_m|<\epsilon$, since if $d(x_n,x_m)=1$ then $x_n,x_m$ would never be arbitrarily close. Hence the result.
Obviously this is a trvial solution, so I've no doubt misunderstood something! Any advice would be appreciated.

A: You have the right idea, but your argument lacks formalism. A formal argument would go like this:
Let $\epsilon>0$. Let $\delta=\min\{\epsilon,1/2\}$. Since $(x_n)$ is Cauchy in $(\mathbb R,d)$, we know that there exists $N$ so that if $n,m\geq N$, then $$d(x_n,x_m)<\delta.$$ Since $\delta\leq 1/2<1$, we know that $$d(x_n,x_m)=|x_n-x_m|.$$ This means that $$|x_n-x_m|<\delta\leq\epsilon.$$

A: Note that $d(x,y) < 1$ iff $|x-y| < 1$.
Furthermore, if $d(x,y) < 1$ or $|x-y| <1$ then $d(x,y)=|x-y|$.
Suppose $x_n$ is $d$-Cauchy and let $\epsilon>0$. Let $\epsilon' = \min(\epsilon, {1 \over 2})$ and choose $N$ such that
$n,m \ge N$ we have $d(x_n,x_m) < \epsilon'$ Then $|x_n-x_m| = d(x_n,x_m) < \epsilon' \le \epsilon$. Hence $x_n$ is $|\cdot|$-Cauchy.

A: If $x_n$ is a Cauchy sequence in $\mathbb{R}$ then for any $\epsilon >0$ there is some $N_{\epsilon} \in \mathbb{N}$ (that will, in general, depend on $\epsilon$)  such that for all $n,m > N$, $d(x_n,x_m) < \epsilon$. Pick $\epsilon =1/2$, then for all $n,m > N_{1/2} $ we have $d(x_n , x_m) <1/2$ and hence $d(x_n,x_m) = |x_n - x_m|$. Hence the Cauchy property of a sequence holds in the new metric if and only if it holds in the standard one.


text:
Q: Using Spring Webflow and Dijit it looks like I can only add one Decoration per element (field)? Using Spring Webflow and Dijit it looks like I can only add one Decoration per element (field)?
I am working on a Spring Webflow project and I was loading a list of schools once the user selects a Borough from a dropdown.  The form was working great until I added a dijit.form.Select widgettype to it.  Please look at the code below.
Can I use both?
The Issue I am having is on the Spring MVC side the bean now has the value "borough" in the borough field and NOT the value the user entered!
<form:select path="borough" id="borough" >
<form:option value="UNKNOWN" label="Unknown" />
<form:option value="X" label="Bronx" />
<form:option value="K" label="Brooklyn" />
<form:option value="M" label="Manhattan" />
<form:option value="Q" label="Queens" />
<form:option value="R" label="Staten Island" />
<form:option value="O" label="All Other Schools" />
</form:select>
<script type="text/javascript">
            Spring.addDecoration(new Spring.ElementDecoration({
            elementId : "borough",
            widgetType : "dijit.form.Select",
            widgetAttrs : {
                                promptMessage : "Enter Borough",
                                required : true }}));

            Spring.addDecoration(new Spring.AjaxEventDecoration({
            elementId: "borough",
            event: "onChange",
            formId:"member",
            params: {fragments:"body", _eventId: "loadSchools"}}));
</script>

A: I fixed the issue.  I removed the Spring.AjaxEventDecoration call and changed the Spring.ElementDecoration to the following:
 <script type="text/javascript">
                            Spring.addDecoration(new Spring.ElementDecoration({
                                elementId : "sex",
                                widgetType : "dijit.form.Select",
                                widgetAttrs : {
                                promptMessage : "Enter Sex",
                                required : true,
                                onChange : function() {
                                    Spring.remoting.submitForm(
                                        'submit',
                                        'customer',
                                        {_eventId: 'sexchange', fragments:'contents'}
                                     );
                                     return false;
                                } }}));

                        </script>

I am not 100% clear on why the Ajax call did not work but I have my project working with this code now!


text:
Q: Scrape Renewal Pricing From Go Daddy' pricing list https://www.godaddy.com/domains/popups/chart.aspx
I am wanting to scrape the renew pricing for the general TLDs for the popular domains.
I am looking for the source code but not seeing the price numbers.... Where are these variables found?

A: Prices are generated dynamically after the page's load... here's the link of prices of the default table
https://www.godaddy.com/domains/controls/jsoncontent/generalpricing.aspx?tab=general&widthreduction=160&hidelinks=true&TargetDivId=tabgj_new&regt=new&_=1380620289373
It returns a json file that could be parsed using json_decode()
To see what's dynamically changing while interacting with the page, In chrome, launch the developper tools then Network tab from the top and XHR tab from the bottom...
In that tab you'll see all dynamic communications between the website and the server
Edit:
Here's a working example:
// includes Simple HTML DOM Parser
require_once "php/lib/simplehtmldom_1_5/simple_html_dom.php";

$url = "https://www.godaddy.com/domains/controls/jsoncontent/generalpricing.aspx?tab=general&widthreduction=160&hidelinks=true&TargetDivId=tabgj_new&regt=new&_=1380620289373";

// Download json file and converts it into a PHP variable
$jsonData = json_decode(file_get_contents($url));

// get html data from the json object
$htmlData = $jsonData->Html;

/*
 * Parse the HTML DOM using Simple HTML DOM Parser
 */

//Create a DOM object
$html = new simple_html_dom();
// Load HTML from a string
$html->load($htmlData);

// Print results
foreach($html->find("table tr") as $index => $row) {

    switch ($index) {

        case '0':   // Print table header
            foreach($row->find("th") as $col) {
                echo $col->plaintext;
                echo " | ";
            }
            echo "
---
";
            break;

        default:    // Print all rows
            foreach($row->find("td") as $col) {
                echo $col->plaintext;
                echo " | ";
            }
            echo "
---
";
            break;
    }
}

OUTPUT:
-------
Per year pricing | 1 year | 2 years | 3 years | 5 years | 10 years |
---
.COM | $12.99* $14.99* | $13.99* $14.99* | $14.33* $14.99* | $14.59* $14.99* | $14.79* $14.99* |
---
.CO | $12.99 $29.99 | $21.49 $29.99 | $24.33 $29.99 | $26.59 $29.99 | -- |
---
.INFO | $2.99* $14.99* | $8.99* $14.99* | $10.99* $14.99* | $12.59* $14.99* | $13.79* $14.99* |
---
.ORG | $9.99* $17.99* | $13.99* $17.99* | $15.33* $17.99* | $16.39* $17.99* | $17.19* $17.99* |
---
.NET | $9.99* $16.99* | $13.49* $16.99* | $14.66* $16.99* | $15.59* $16.99* | $16.29* $16.99* |
---
.ME | $9.99 $19.99 | $14.99 $19.99 | $16.66 $19.99 | $17.99 $19.99 | $18.99 $19.99 |
---
.MOBI | $9.99* $17.99* | $13.99* $17.99* | $15.33* $17.99* | $16.39* $17.99* | $17.19* $17.99* |
---
.US | $3.99 $19.99 | $11.99 $19.99 | $14.66 $19.99 | $16.79 $19.99 | $18.39 $19.99 |
---
.BIZ | $6.99* $16.99* | $11.99* $16.99* | $13.66* $16.99* | $14.99* $16.99* | $15.99* $16.99* |
---
.CA | $12.99 | $12.99 | $12.99 | $12.99 | $12.99 |
---
.CC | $19.99 | $19.99 | $19.99 | $19.99 | $19.99 |
---
.LA | $39.99 | $39.99 | $39.99 | $39.99 | $39.99 |
---
.TV | $39.99 | $39.99 | $39.99 | $39.99 | $39.99 |
---
.WS | $15.99 | $15.99 | $15.99 | $15.99 | $15.99 |
---
.ASIA | $19.99* | $19.99* | $19.99* | $19.99* | $19.99* |
---
.XXX | $99.99* | $99.99* | $99.99* | $99.99* | $99.99* |
---


text:
Q: How to fetch image and pdf file from json and display in tableviewcell swift 3 Hello all as i am a Fresher so dont know how to fetch image and pdf file from API and how to display in tableviewcell so that user can see the image and pdf file as well download it from there.I tried some code for image but its not working and dont have a single idea for pdf.Please help.
code for image :
I have declared an array of images like below :
var announimage : Array = [UIImage]()

Below is the format of my JSON data.
{
 "Download_Details": [
 {
"school_id": 1,
"class_id": "Pre - KG ",
"section": "A ",
"file_name": "427a3be0155b49db999cffb51f078f9c_431875732.pdf",
"title": "TeQ",
"message": "Hello Users",
"date": null
},
{
"school_id": 1,
"class_id": "Pre - KG ",
"section": "A ",
"file_name": "dce5ab53f45f4ec5b52894bc6286ed35_1376021.jpg",
"title": "Welcome",
"message": "Welcomes you.",
"date": null
},
{
 "school_id": 1,
 "class_id": "Pre - KG ",
 "section": "A ",
 "file_name": "9d3ff19bd54e48a087947227ee36c68c_13417773.png",
 "title": "TEST",
"message": "TEST",
"date": null
}
],
}

Below is the code i have tried :
let responseString = try! JSONSerialization.jsonObject(with: data!, options: .allowFragments) as? NSDictionary

let downarray = responseString?.value(forKey: "Download_Details") as? NSArray

for down in downarray!
{
    let dowdict = down as? NSDictionary

    let dmsgname = dowdict?.value(forKey: "message")

    self.announmessage.append(dmsgname as! String)

   let downimage = dowdict?.value(forKey: "file_name")

   self.announimage.append(downimage as! UIImage)

}

DispatchQueue.main.async
{
    self.annountable.reloadData()
}

UITableView DataSource :
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {

    let cell2 = tableView.dequeueReusableCell(withIdentifier: "cell1", for: indexPath) as! AnnounceCellTableViewCell
    cell2.announlabel.text = announmessage[indexPath.row]
    cell2.announdate.text = announcedates[indexPath.row]
    let image :UIImage = UIImage(data:announimage[indexPath.row] as! Data)!
    cell2.dataimage.image = image
     return cell2

}

A:     let imgUrlStr:String = "https://dncache-mauganscorp.netdna-ssl.com/thumbseg/378/378006-bigthumbnail.jpg";

    if let imgURL = URL.init(string: imgUrlStr) {
        do {
            let imageData = try Data(contentsOf: imgURL as URL);
            let image = UIImage(data:imageData);
            print("here you will find your image:- \(String(describing: image)) ");
        } catch {
            print("Unable to load data: \(error)")
        }
    }

Output:--
here you will find your image:- Optional(<UIImage: 0x6080000bca40>, {450, 338})

In your case get your full url by using following piece of code
    var prefixUrl = "http://apidomain.com/";
    let imageUrlStr = dowdict?.value(forKey: "file_name")

    prefixUrl.append(imageUrlStr);

    print("full url \(prefixUrl)");

FOR PDF -- as pdf does not display in image view, so you need to display it in webView. Just load request in webView for pdf.
    let webView = UIWebView.init();
    let pdfUrlStr:String = "http://www.pdf995.com/samples/pdf.pdf";
    let pdfUrl = URL.init(string: pdfUrlStr);
    let urlRequest = URLRequest.init(url: pdfUrl!, cachePolicy: URLRequest.CachePolicy.reloadIgnoringLocalAndRemoteCacheData, timeoutInterval: 30.0);
    webView.loadRequest(urlRequest);

A: Try below code on cell for row
let image : UIImage = UIImage(data: filteredAry[indexPath.row] as! Data)

cell2.dataimage.image = image


text:
Q: Using inheritance or modules in Ruby I'm creating an API wrapper so I've been looking at other libraries to get some ideas on how to structure it. I found that a lot of libraries mix in all their methods in a Client class instead of using inheritance.
Why?
Examples:
Octokit: https://github.com/octokit/octokit.rb/blob/master/lib/octokit/client.rb
Instagram: https://github.com/Instagram/instagram-ruby-gem/blob/master/lib/instagram/client.rb
Twitter (sort of): https://github.com/sferik/twitter/blob/master/lib/twitter/rest/api.rb
Why not use separate classes?
In Octokit you fetch commits by doing something like
client = Octokit::Client.new
client.commits

Why not use something like Octokit::Commit.all? (Perhaps I'm damaged by Rails and the AR API)
If you mix everything into one big class it seems like you would have issues with accidentally overriding methods all the time.
What do I not understand here? :)
UPDATE:
Here is an example of another library that uses more of an inheritance approach
https://github.com/jeremyw/swish/tree/master/lib/dribbble

A: I think you asked this on IRC too.
The answer provided on IRC was that you get more flexibility with an include-approach, due to the subclass linear cascading inheritance effect - they all need to have a parent.
This shapes the design, as you may recall from IRC - in the case of the subclassing, I gave the example of Sinatra:
class MyApp < Sinatra::Base

Another reason also is that it is convenient to put things into modules, and then re-use it.
Months ago I gave an example of storing my constants in a module called Constants (when I have like more than 50 of these constants) - I simply like to be able to have "iteration points" in my projects that can help identify where I put things. And when I need these constants available in other classes or modules of my code, I simply include that. I can not do the same as easily with subclassing, because subclassing forces me into a more rigid model. And I can only subclass from a class, not a module - but I can include code into a module or a class freely. (This is not a great design point in ruby IMHO - I think extending behaviour should work differently, but I did not design ruby.)
Also the example you gave of Octokit seems hugely bad.
Why not give saner examples like Rack?
Rack does not use many includes at all:
    lib/rack/response.rb:     include Helpers
    lib/rack/content_type.rb: include Rack::Utils
    lib/rack/chunked.rb:      include Rack::Utils

But you see the examples above are significantly better
for an include-based approach.


text:
Q: C# Scan for Memory Address Efficiently I've written a memory editor class that can read and write memory, but what I need to do is to scan the program's memory, and find the list of memory addresses that contain the memory I'm searching for.
This is the memory editor class.
class MemoryEditor
{
    public const uint DELETE = 0x00010000;
    public const uint READ_CONTROL = 0x00020000;
    public const uint WRITE_DAC = 0x00040000;
    public const uint WRITE_OWNER = 0x00080000;
    public const uint SYNCHRONIZE = 0x00100000;
    public const uint END = 0xFFF;
    public const uint PROCESS_ALL_ACCESS = (DELETE | READ_CONTROL | WRITE_DAC | WRITE_OWNER | SYNCHRONIZE | END);

    public Process targetedProcess;

    [DllImport("kernel32.dll")]
    public static extern int OpenProcess(uint dwDesiredAccess, bool bInheritHandle, int dwProcessId);

    [DllImport("kernel32.dll")]
    public static extern bool ReadProcessMemory(int hProcess, int lpBaseAddress, byte[] buffer, int size, int lpNumberOfBytesRead);

    [DllImport("kernel32.dll")]
    public static extern bool WriteProcessMemory(int hProcess, int lpBaseAddress, byte[] buffer, int size, int lpNumberOfBytesWritten);

    public Process targetProcess(string name, int index = 0)
    {
        return (targetedProcess = Process.GetProcessesByName(name)[index]);
    }

    public int getHandle(Process proc, uint access = PROCESS_ALL_ACCESS)
    {
        return OpenProcess(access, false, proc.Id);
    }

    public byte[] getBytesFromString(string str)
    {
        return Encoding.Unicode.GetBytes(str);
    }

    public string getStringFromBytes(byte[] byteArr)
    {
        return Encoding.Unicode.GetString(byteArr);
    }

    public int makeHex(string str)
    {
        return (int.Parse(str, System.Globalization.NumberStyles.HexNumber));
    }

    public byte[] ReadMemory(int address, int processSize)
    {
        byte[] buffer = new byte[processSize];
        ReadProcessMemory(getHandle(targetedProcess), address, buffer, processSize, 0);
        return buffer;
    }

    public List<int> GetAddress(byte[] memory, int index = 0)
    {
        List<int> buf = new List<int>();

        for (int i = 0; i < int.MaxValue; i++)
            if (ReadMemory(makeHex(i.ToString()), 1) == memory)
                buf.Add(i);

        return buf;
    }

    public void WriteMemory(int address, byte[] processBytes)
    {
        WriteProcessMemory(getHandle(targetedProcess), address, processBytes, processBytes.Length, 0);
    }

    public int GetObjectSize(object TestObject)
    {
        BinaryFormatter bf = new BinaryFormatter();
        MemoryStream ms = new MemoryStream();
        byte[] Array;
        bf.Serialize(ms, TestObject);
        Array = ms.ToArray();
        return Array.Length;
    }
}

And here is the function to try to find the memory addresses
    public List<int> GetAddress(byte[] memory, int index = 0)
    {
        List<int> buf = new List<int>();

        for (int i = 0; i < int.MaxValue; i++)
            if (ReadMemory(makeHex(i.ToString()), 1) == memory)
                buf.Add(i);

        return buf;
    }

It lags extremely badly, and I'm only targeting notepad. When I scan memory in Cheat Engine, it finds it immediately, without any lag. My program scans from 0, to the max value of an int, but Cheat Engine does it 0 to the max value of a long, so I don't know what I'm doing wrong.
Any way I can do this efficiently?

A: There are several problems I see right away.
1. You're only reading one byte at a time:
ReadMemory(makeHex(i.ToString()), 1)

I'm not certain, but I would assume that a call to ReadProcessMemory requires a system call to execute, and doing this for every byte is certainly going to be one source of slowdown.  Instead, you should read some size of "block" and then scan through that block in your process. (Doing one page at a time may be the most efficient.)
2. Why in the world are you doing all of the conversions back-and-forth to strings?!
public int makeHex(string str)
{
    return (int.Parse(str, System.Globalization.NumberStyles.HexNumber));
}

....

for (int i = 0; i < int.MaxValue; i++)
    if (ReadMemory(makeHex(i.ToString()), 1) == memory)

Every iteration of that loop, you're converting i to a string (the default, decimal - not hex), and then immediately passing it to makeHex which parses it (as hex, always) back to an integer.  What's the point of this? Just pass the integer! These conversions can be very expensive.
<pedantic>By the way, the name "makeHex" doesn't make sense - it's going from hex, and making an integer.</pedantic>


text:
Q: How to format string with integers and special characters I have a string with results of the athlete in the competition in the high jump. Here, + corresponds to a successful attempt,% unsuccessful, - skipped. The height and the corresponding attempts are separated by a space. I need to read the string and return the maximum height taken, or -1 if there is none or the format of the string is broken.
For example:

*

*"220 + 224 %+ 228 %- 230 + 232 %%- 234 %".// result in 230

*"226 +" // result is 226

*"???" // result is -1
I tried to use regular expressions, but did not achieve much success.
fun bestHighJump(jumps: String): Int {
    var result = 0
    val jumpsSplitted = jumps.split(" ")
    val regStr = Regex("""[.+\d]""")
    for (item in jumpsSplitted) {
        if (regStr.containsMatchIn(item)) result += item
    }
    //Don't know what to do next
}

Help with the solution of the problem and if not difficult, recommend resources where I can well learn the topic of string formatting.

A: (Rewritten in view of the question being clarified.)
As I understand it now, the string should contain integers alternating with symbols, and we want the largest integer which is followed by "+".
I'd approach this by splitting the string into words, and then looking at pairs of words.  We can do this with the zipWithNext() function, which gives a list of all the adjacent pairs.  We can then filter() to select only those where the second word is "+", mapNotNull() to convert the first word of such a pair to an Int where possible (ignoring the nulls from those which aren't valid integers), and take the max() of those numbers.  (If there aren't any, max() returns null, so we can use the Elvis operator to substitute -1 instead.)
fun String.bestHighJump()
    = split(" ")
      .zipWithNext()
      .filter{ it.second == "+" }
      .mapNotNull{ it.first.toIntOrNull() }
      .max() ?: -1

(I've made this an extension function on String, mostly because it seems to fit well; it also avoids having to declare and then use a parameter.  But a normal function would work in much the same way.)
To make this more idiomatic, it would probably be better to remove the Elvis operator and return a null directly if there were no matching scores; that makes the situation more obvious to the caller, who can then decide how to handle that case.
Since you're looking at regexes, here's an alternative solution using one of those:
fun String.bestHighJump()
    = Regex("""([0-9]+) [+]\B""")
      .findAll(this)
      .map{ it.groupValues[1].toInt() }
      .max() ?: -1

This is one line shorter, but I think it's a lot less clear.  In my experience regexes are often hard to get right, to debug, and to maintain, so I prefer other approaches.  (For comparison, the first version worked first time, while the regex version took many attempts!)
Here the regex matches one successful result (one or more digits, followed by a space, a +, and then a word boundary.  (The latter is needed because we don't know whether this result is the last one in the string, or is followed by others.  Regexes match greedily, so we don't need one at the start as well.)
findAll() searches the whole string, and returns a sequence of matches; we then take the first group from each (which is the number), convert it to an int (no need to handle invalid numbers this time, if the regex works), and take the max as before.
(The question still isn't clear on how to handle success indicators with multiple characters.  I'm assuming we only want to count results where the success indicator is just the one character '+'.  If we should also include cases where there is a '+' among '%'s and/or other characters, then both functions can be tweaked for that.  But again, the regex one would be harder to do.)
As for where to learn this sort of thing, I'm assuming you already know about the Kotlin docs.  (And I'd recommend the Kotlin In Action book for learning the language.)  There are different approaches to string processing, depending on your needs, so it's harder to recommend — but the basic principles aren't specific to Kotlin, so there are probably many places to look.  And if you have a trickier case, you could always post it as another question here!

A: First you need to trim and clean the argument jumps from multiple adjacent spaces.
Then after splitting it, create 2 lists:
the 1st contains the heights and
the 2nd contains the attempts.
It is necessary to check that the 1st list contains valid integers
and the 2 lists are the same size.
Then by removing all occurrences of % and - in every item of the 2nd list,
you get the index of the last + item.
This index is used to get the corresponding height from the 1st list.
fun bestHighJump(jumps: String): Int {
    val jumpsSplitted = jumps.trim().replace(Regex("\\s\\s+"), " ").split(" ")
    if (jumpsSplitted.size < 2 || jumpsSplitted.size % 2 == 1)
        return -1

    val heights = jumpsSplitted.filterIndexed { i, _ ->  (i % 2 == 0)}.mapNotNull { it.toIntOrNull() }
    val attempts = jumpsSplitted.filterIndexed { i, _ ->  (i % 2 == 1)}
    if (heights.size != attempts.size)
        return -1

    val index = attempts
            .map { it.replace("%", "").replace("-", "") }
            .indexOfLast { it == "+" }

    return if (index == -1) -1 else heights[index]
}

This
val jumps1 = "220 + 224 %+ 228 %- 230 + 232 %%- 234 %"
println(bestHighJump(jumps1))

will print 230
This
val jumps2 = "226 +"
println(bestHighJump(jumps2))

will print 226
This
val jumps3 = "???"
println(bestHighJump(jumps3))

will print -1

A: Using regex is a good idea. Groups become especially handy here.
([\\d]{1,3})([ +\\-%]*)

The regex will match any 1 to 3 digit number in its first group and the result of that attempt in the second group.
You retrieve a Sequence<MatchResult> with findAll and then you filter and map the values of interest.
In the end you return the maximum of the successful attempts or -1 if the input string was invalid or did not contain a successful jump.
fun bestHighJump(jumps: String): Int {
    val attempts = Regex("([\\d]{1,3})([ +\\-%]*)").findAll(jumps)

    val list = attempts.filter {
        it.groups[2]?.value?.let {
            '+' in it
        } == true
    }.map {
        it.groups[1]?.value
    }.mapNotNull { it?.toInt() }.toList()

    return if (list.isEmpty()) {
        -1
    } else {
        list.max()!!
    }
}

Note that in Kotlin's MatchGroupCollection the first group will have the index 1 and the second the index 2 because the group with index 0 are both groups combined.


text:
Q: unhandled exception of type 'System.Data.SqlClient.SqlException' occurred in System.Data.dll showing up I was trying to include datagrid view in my project and the error_({"A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)"}) was shown.
Additional information: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
This is the code where error pops up:-
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
        Dim connectionString As String = "Data Source=PatDatabaseDataSet;Initial Catalog=pubs;Integrated Security=True"
        Dim sql As String = "SELECT * FROM Name"
        Dim connection As New SqlConnection(connectionString)
        Dim dataadapter As New SqlDataAdapter(sql, connection)
        Dim ds As New DataSet()
        connection.Open(){underlined part was highlighted as the error location}
        dataadapter.Fill(ds, "Patient_table")
        connection.Close()
        DataGridView1.DataSource = ds.Tables()
        DataGridView1.DataMember = "Patient_table"
    End Sub

A: Make an exception in the code where the error has came , with Try-catch block
Here is the sample:
   Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
    Try
        connection()
        Sql = "Select * From LoginTable Where username='" & TextBox1.Text & "' And password='" & TextBox2.Text & "'"
        da = New SqlDataAdapter(Sql, conn)
        Dim ds As New DataSet
        da.Fill(ds, "LoginTable")
        If ds.Tables("LoginTable").Rows.Count <> 0 Then
            Me.Hide()
            Dim Menu As New Form
            Menu.Show()
        Else

            MsgBox("Login Failed")
        End If
        conn.Close()
    Catch
        MsgBox("Login Failed")
    End Try
End Sub


text:
Q: Ubuntu 19.04 stuck on boot I have an Asus Zenbook 14 with graphics card: Intel Corporation Device [8086:3ea0].
I tried to install ubuntu 19.04 but I'm getting stuck on boot with a purple screen. The install disk also got stuck on a black screen which I fixed by using the 'nomodeset' bypass but it won't work once installed.
Things I tried:
I've gone through hours of these questions and no answer seems to work. I've done all the 'nomodeset' and similar. I have also tried installing Ubuntu 18.10 (which worked) and then upgrading to 19.04 which lead to the same issue. Please note that for some reason, using nomodeset in a specific place worked once, so I know the operating system works fine, but once powered off, I retried the exact same thing and it failed again.
Thanks in advanced.

A: Following worked for me. Very simple but effective till now:

*

*Open terminal with Ctrl+Alt+T

*Type sudo gedit /etc/gdm3/custom.conf

*Type the password when prompted. (It will not be visible while typing.) edit the file and remove '#' located at the beginning of the following line (its 7th line)
#Wayland = false

*So now the line will look like this - Wayland = false

*Save and close the window

*Exit and restart

A: If anyone else faces this problem, but you cannot access to the terminal because the Nvidia driver, @sangharshs seems to be the clue.
We need to deactivate Wayland, in order to let the Nvidia driver work properly. As it only works with Xorg.
There are some chances that when you install Nvidia, you'll get stuck in a black or purple screen, when booting Ubuntu. If that's the case, then you need to do the following:

*

*Reboot your computer

*Select the Advanced options for Ubuntu option, below the "Ubuntu" one, in the Grub panel

*Select any of the recovery mode options that you get listed. Doesn't matter what kernel you choose, if you have more than one.

*Wait until a new panel appears. And choose the root option.

*Edit the /etc/gdm3/custom.conf file with nano, vi or vim. For example: vim /etc/gdm3/custom.conf

*Change the line #Wayland = false into Wayland = false (or WaylandEnable instead of Wayland)

*Run reboot
That's it! You have Ubuntu running along with the Nvidia driver again.

A: Same exact thing happened is happening to me, I'm on a Zenbook 15 with a Nvidia 1050. Did same things, exactly where you describe you are. I was able to prove that on 18.10, the kernel 4.19.13-generic was 100% working on everything, but wanted to use 19.04 because I wanted the latest gnome-shell + wayland experience. But got the same, even the working kernel and the same params that were working previous to the dist update. Now, one of the differences that I've noticed, is a bump on grub version (also looks like higher res now). so maybe it's a grub thing? I'm trying to boot and rollback to a previous version...
BTW, you can see some messages and power off quicker if you add acpi=off and remove quiet splash from the params.

A: Well I've finally figured it out. Unfortunately sangharshs answer didn't work for me. But updating the bios did! I found some blog that recommended updating the bios so I went to the Asus support and followed the instructions and now it works! Hope this helps those who were as frustrated as I was.


text:
Q: CXFreeze: python code with PyFiglet module occurs TypeError if I use the Figlet class of the PyFiglet (PyPi) module in a python code, freeze it with CXFreeeze (PyPi) and run it a TypeError occurs.
Example code
from pyfiglet import Figlet

Figlet()

Error that occured
Traceback (most recent call last):
  File "C:\Users\MrAnonymous\AppData\Local\Programs\Python\Python39\Lib\site-packages\cx_Freeze\initscripts\__startup__.py", line 120, in run
    module_init.run(name + "__main__")
  File "C:\Users\MrAnonymous\AppData\Local\Programs\Python\Python39\Lib\site-packages\cx_Freeze\initscripts\Console.py", line 16, in run
    exec(code, module_main.__dict__)
  File "C:\Users\MrAnonymous\Desktop\main.py", line 3, in <module>
    Figlet()
  File "C:\Users\MrAnonymous\AppData\Local\Programs\Python\Python39\lib\site-packages\pyfiglet\__init__.py", line 794, in __init__
    self.setFont()
  File "C:\Users\MrAnonymous\AppData\Local\Programs\Python\Python39\lib\site-packages\pyfiglet\__init__.py", line 801, in setFont
    self.Font = FigletFont(font=self.font)
  File "C:\Users\MrAnonymous\AppData\Local\Programs\Python\Python39\lib\site-packages\pyfiglet\__init__.py", line 126, in __init__
    self.data = self.preloadFont(font)
  File "C:\Users\MrAnonymous\AppData\Local\Programs\Python\Python39\lib\site-packages\pyfiglet\__init__.py", line 136, in preloadFont
    if pkg_resources.resource_exists('pyfiglet.fonts', fn):
  File "C:\Users\MrAnonymous\AppData\Local\Programs\Python\Python39\lib\site-packages\pkg_resources\__init__.py", line 1131, in resource_exists
    return get_provider(package_or_requirement).has_resource(resource_name)
  File "C:\Users\MrAnonymous\AppData\Local\Programs\Python\Python39\lib\site-packages\pkg_resources\__init__.py", line 360, in get_provider
    return _find_adapter(_provider_factories, loader)(module)
  File "C:\Users\MrAnonymous\AppData\Local\Programs\Python\Python39\lib\site-packages\pkg_resources\__init__.py", line 1390, in __init__
    self.module_path = os.path.dirname(getattr(module, '__file__', ''))
  File "C:\Users\MrAnonymous\AppData\Local\Programs\Python\Python39\lib\ntpath.py", line 223, in dirname
    return split(p)[0]
  File "C:\Users\MrAnonymous\AppData\Local\Programs\Python\Python39\lib\ntpath.py", line 185, in split
    p = os.fspath(p)
TypeError: expected str, bytes or os.PathLike object, not NoneType

Generate Error

*

*Create a python file with the code shown above: main.py

*Freeze it with CXFreeze in CMD: cxfreeze -c "main.py"

*Run it in CMD: main.exe


text:
Q: AttributeError: 'res.partner' object has no attribute 'check_vat_ve' - Odoo v10 community I'm inheriting res.partner:
class ResPartner(models.Model):
_name = 'res.partner'
_inherit = 'res.partner'

@api.model
def check_vat_ve(self, vat): #, context=None
    """ Check Venezuelan VAT number, locally called RIF.
    RIF: JXXXXXXXXX RIF VENEZOLAN
         IDENTIFICATION CARD: VXXXXXXXXX
         FOREIGN IDENTIFICATION CARD: EXXXXXXXXX
    """

    #if context is None:
        #context = {}
    if re.search(r'^[VJEGP][0-9]{9}$', vat):
        return True
    if re.search(r'^([VE][0-9]{1,8}|[D][0-9]{9})$', vat):
        return True
    return False

As You can see, there is a method called chack_vat_ve, and it's declared on res.partner object.
Now, I have this other (wizard) method which is for a button:
@api.multi
def search_partner_seniat(self):
    """ Check vat of the partner and update iva rate
    """
    self.ensure_one()
    vat = self.vat.upper()
    res = {
        'name': _('The requested contributor does not exist'),
        'vat_subjected': False,
        'vat': vat,
        'wh_iva_agent': False,
        'wh_iva_rate': 0.0
    }

    if 'VE' in vat:
        vat = vat[2:]

    # assumption: both methods in new api style
    if self.env['res.partner'].check_vat_ve(vat):
        res = self.env['seniat.url']._dom_giver(vat)
    self.write(res)

Every time I click on this, it throws me:
Traceback (most recent call last):
File "/home/kristian/.virtualenvs/odoov10/lib/python2.7/site-packages/odoo-10.0rc1c_20161005-py2.7.egg/odoo/http.py", line 638, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/home/kristian/.virtualenvs/odoov10/lib/python2.7/site-packages/odoo-10.0rc1c_20161005-py2.7.egg/odoo/http.py", line 675, in dispatch
result = self._call_function(**self.params)
File "/home/kristian/.virtualenvs/odoov10/lib/python2.7/site-packages/odoo-10.0rc1c_20161005-py2.7.egg/odoo/http.py", line 331, in _call_function
return checked_call(self.db, *args, **kwargs)
File "/home/kristian/.virtualenvs/odoov10/lib/python2.7/site-packages/odoo-10.0rc1c_20161005-py2.7.egg/odoo/service/model.py", line 119, in wrapper
return f(dbname, *args, **kwargs)
File "/home/kristian/.virtualenvs/odoov10/lib/python2.7/site-packages/odoo-10.0rc1c_20161005-py2.7.egg/odoo/http.py", line 324, in checked_call
result = self.endpoint(*a, **kw)
File "/home/kristian/.virtualenvs/odoov10/lib/python2.7/site-packages/odoo-10.0rc1c_20161005-py2.7.egg/odoo/http.py", line 933, in __call__
return self.method(*args, **kw)
File "/home/kristian/.virtualenvs/odoov10/lib/python2.7/site-packages/odoo-10.0rc1c_20161005-py2.7.egg/odoo/http.py", line 504, in response_wrap
response = f(*args, **kw)
File "/home/kristian/odoov10/odoo-10.0rc1c-20161005/odoo/addons/web/controllers/main.py", line 866, in call_button
action = self._call_kw(model, method, args, {})
File "/home/kristian/odoov10/odoo-10.0rc1c-20161005/odoo/addons/web/controllers/main.py", line 854, in _call_kw
return call_kw(request.env[model], method, args, kwargs)
File "/home/kristian/.virtualenvs/odoov10/lib/python2.7/site-packages/odoo-10.0rc1c_20161005-py2.7.egg/odoo/api.py", line 681, in call_kw
return call_kw_multi(method, model, args, kwargs)
File "/home/kristian/.virtualenvs/odoov10/lib/python2.7/site-packages/odoo-10.0rc1c_20161005-py2.7.egg/odoo/api.py", line 672, in call_kw_multi
result = method(recs, *args, **kwargs)
File "/home/kristian/odoov10/gilda/l10n_ve_fiscal_requirements/wizard/search_info_partner_seniat.py", line 63, in search_partner_seniat
if self.env['res.partner'].check_vat_ve(vat):
AttributeError: 'res.partner' object has no attribute 'check_vat_ve'

I'm almost sure there is some error with the wizard method, since I'm migrating these modules, from v8 to v10 community, they're still kind of buggy.
Any ideas?

A: You can try removing the _name = 'res.partner' attribute because that seems unnecessary and then let us know.


text:
Q: How to automaticly refresh a view with a trigger in Oracle 11g? I have a table
STORE (ID, NAME, CITY_ID)` and a table `CITY (ID, NAME)`

and a view
CITY_STORE (CITY_ID, CITY_NAME, COUNT_STORES)

I have created a view V_CITY_STORE where I have a column which shows the count of the stores in a particular city, COUNT_STORES (COUNT(STORE.ID))
CREATE OR REPLACE VIEW V_CITY_STORE AS
SELECT C.ID CITY_ID, C.NAME CITY_NAME, COUNT(S.ID) COUNT_STORES
FROM CITY C
LEFT JOIN STORE S ON S.CITY = C.ID
GROUP BY C.ID, C.NAME;

I want to create a trigger which will automatically update the count of the stores for each city when some store is updated, deleted or a new store is inserted.
I tried to make a trigger in which I refreshed the view:
CREATE OR REPLACE TRIGGER T_CITY_STORE
AFTER INSERT OR UPDATE OR DELETE ON STORE
BEGIN
REPLACE VIEW V_CITY_STORE AS
SELECT C.ID CITY_ID, C.NAME CITY_NAME, COUNT(S.ID) COUNT_STORES
FROM CITY C
LEFT JOIN STORE S ON S.CITY = C.ID
GROUP BY C.ID, C.NAME;
END;

But this returns me an error - I suppose that I cannot have a view inside a trigger. I am quite new to triggers and procedures, I learnt them for only 2 days.
How can I do this?

A: If stores are rarely updated, deleted, or inserted, then it might be acceptable to do what you say you want to do. In which case, an autonomous transaction in the body of an after statement trigger might be acceptable and will allow you to re-materialize the view.
However, if there is any doubt about about how rare such events are or if you don't want to create a brittle system (which it will surely be), then I recommend you go to the project sponsor and negotiate the amount of time between refreshes of the materialized view. Under such circumstances you would create a dbms_scheduler job that would perform the task.


text:
Q: Remove guid string from url I'm currently trying to remove a guid id from a url, example provided below. It isn't removing the guid id, what am I doing wrong?
example url: "/something/9a2cd43-58c6-52e5-a0c1-700b462d613a"

window.location.pathname.replace(/\b[a-f\d]{32}\b/, '');

A: You missed hyphen
\b[a-f\d-]{35}\b


text:
Q: libtool: 'make' command ends without errors but don't creates any executable When I run 'make', in a project with autotools and libtool, the library is builded correctly, but the executable is not created in its path. This is the line generated by automake:
/bin/bash ../libtool --tag=CXX   --mode=link g++  -g -O0   -o foo foo-foo.o ../libfoo/src/libfoo.la

This line doesn't print anything (even errors). There is something wrong with this Makefile.am?
bin_PROGRAMS=foo

foo_SOURCES= \
    foo.cc

foo_CPPFLAGS = \
    -I$(top_srcdir)/libfoo/include \
    -DLOCALEDIR=\"$(localedir)\"

foo_LDADD = \
    ../libfoo/src/libfoo.la \
    $(LIBINTL)